Skip to content

Launch Markdown rendering! On the main item displaying system#19

Merged
hpware merged 3 commits intomasterfrom
canery
Dec 14, 2025
Merged

Launch Markdown rendering! On the main item displaying system#19
hpware merged 3 commits intomasterfrom
canery

Conversation

@hpware
Copy link
Owner

@hpware hpware commented Dec 14, 2025

Summary by CodeRabbit

  • New Features

    • Improved Markdown list rendering with styled ordered/unordered lists
    • Collection pages now render user and content data via a new client component
  • Bug Fixes

    • Avatar images load lazily for better performance
  • Chores

    • Project version bumped to 0.1.14
    • Version handling now treats updates as stable
    • CI/CD and automated release workflows updated/removed
    • Database migration adjusted footer copyright value

✏️ Tip: You can customize this high-level summary in your review settings.

@dokploy-hpwartwweb2
Copy link

dokploy-hpwartwweb2 bot commented Dec 14, 2025

Dokploy Preview Deployment

Name Status Preview Updated (UTC)
app ✅ Done Preview URL 2025-12-14T09:30:02.343Z

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 14, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Removed several CI/CD workflows, simplified version-stability logic to always mark releases stable, bumped the web app version to a stable tag, added a collection client/page pair, enhanced Markdown list rendering, added system_info fetching to navigation, and adjusted a DB migration string value.

Changes

Cohort / File(s) Summary
CI/CD Workflow Removals
.github/workflows/build_docker_image.yml.disabled, .github/workflows/production-release.yml, .github/workflows/version-and-build.yml
Removed three GitHub Actions workflows (Docker build/push, production-release pipeline, PR-based version-and-build pipeline).
Workflow Trigger Change (disabled file)
.github/workflows/auto-update-version.yml.disabled
Changed trigger from push to pull_request (opened) in the disabled auto-update-version workflow.
Version increment script
.github/scripts/increment-version.js
Removed prerelease detection in isStableRelease so it now always returns true, causing all new versions to be treated as stable.
Project version update
apps/web/projectData.ts
Updated exported data.version from "0.1.13-canary-1" to "0.1.14".
Collection page components
apps/web/src/app/c/[slug]/client.tsx, apps/web/src/app/c/[slug]/page.tsx
Added a new client component and integrated it into the collection page; typed data props and populated client with userInfo and collection metadata.
Content Markdown rendering
apps/web/src/app/i/[slug]/page.tsx
Replaced plain text rendering with Markdown rendering for textData; added loading="lazy" to avatar image.
Markdown renderer enhancements
apps/web/src/components/markdownRender.tsx
Added list and listitem handlers to support ordered (<ol>) and unordered (<ul>) lists with Tailwind classes.
Navigation — system info
apps/web/src/components/navigation.tsx
Added React Query fetch for /api/data/system_info, display of dynamic copyrightOwner, and conditional version display when optionalExposeVersion is true.
DB migration string change
packages/db/src/migrations/0014_reflective_roughhouse.sql
Modified copyrightOwner value to include escaped quotation marks inside the stored string.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Review impact of removed workflows on release automation and any downstream expectations in repo docs or team processes.
  • Verify increment-version.js change to isStableRelease aligns with intended versioning policy and won't cause unintended stable releases.
  • Inspect apps/web/src/app/c/[slug]/client.tsx and page.tsx for type correctness and SSR/CSR boundaries.
  • Confirm Markdown renderer list handlers produce expected HTML/CSS and handle edge cases.
  • Validate navigation.tsx React Query usage and that system_info endpoint returns expected shape.
  • Check the DB migration change for backward compatibility with existing data and migration ordering.

Possibly related PRs

Poem

🐰
I hopped through workflows, quiet and spry,
Canary feathers drifted from the sky,
I tucked lists in Markdown, made pages sing,
A stable version now takes wing —
Fluffy cheers for every little thing! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The PR title partially relates to the changeset. While markdown rendering is implemented in markdownRender.tsx and integrated into page.tsx, the title is vague and doesn't clearly convey the primary changes, which include version handling modifications, workflow restructuring, and multiple feature additions across several files. Clarify the title to better reflect the main objective. Consider: 'Add markdown rendering and update version/workflow configuration' or focus on the single most important change if this PR addresses multiple concerns.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a54e75 and d4fd6c0.

📒 Files selected for processing (2)
  • apps/web/projectData.ts (1 hunks)
  • apps/web/src/app/i/[slug]/page.tsx (3 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
.github/workflows/auto-update-version.yml.disabled (1)

17-17: Incompatible condition for pull_request events.

The condition references github.event.head_commit.message, which is available for push events but not for pull_request events. If this workflow is re-enabled, it may fail or not work as intended.

Consider updating the condition to work with pull requests:

-    if: "!contains(github.event.head_commit.message, '🤖 Auto-increment version')"
+    if: "!contains(github.event.pull_request.title, '🤖 Auto-increment version')"
apps/web/src/app/c/[slug]/page.tsx (2)

36-47: Critical: Missing null check for getUserInfo.

The code accesses getUserInfo[0] without verifying the array contains results. If the user referenced by content[0].byUser doesn't exist (e.g., deleted user, orphaned reference), this will throw a runtime error.

Apply this diff to add a safety check:

  const getUserInfo = await db
    .select()
    .from(auth_schema.user)
    .where(dorm.eq(auth_schema.user.id, content[0].byUser));

+ if (getUserInfo.length === 0) {
+   notFound();
+ }
+
  return (
    <Client
      data={{
        userInfo: {
          id: getUserInfo[0].id,
          name: getUserInfo[0].name,
          image: getUserInfo[0].image,
        },

74-88: Critical: Missing null check for getUserInfo in metadata generation.

Same issue as in the Page function: getUserInfo[0] is accessed without verifying results exist. This will crash during metadata generation if the user is missing.

Apply this diff:

  const getUserInfo = await db
    .select()
    .from(auth_schema.user)
    .where(dorm.eq(auth_schema.user.id, content[0].byUser));
+
+ if (getUserInfo.length === 0) {
+   return {
+     title: "Undefined",
+   };
+ }
+
  const kvTitle = await db
    .select()
    .from(main_schema.kvData)
🧹 Nitpick comments (3)
apps/web/src/components/navigation.tsx (2)

31-31: Remove unused queryClient.

The queryClient is assigned but never used in this component.

-  const queryClient = useQueryClient();

32-39: Consider adding error handling and loading state for system info query.

The query lacks error handling and the footer will display empty values during loading or on error. Consider adding isLoading and isError checks, or providing default fallback values.

Example enhancement:

const querySystemData = useQuery({
  queryFn: async () => {
    const req = await fetch("/api/data/system_info");
    if (!req.ok) throw new Error("Failed to fetch system info");
    return await req.json();
  },
  queryKey: ["system_info"],
  staleTime: 5 * 60 * 1000, // Cache for 5 minutes
});

// Then in the footer:
{querySystemData.data?.copyright_owner || "Default Owner"}
apps/web/src/components/markdownRender.tsx (1)

4-4: Remove unused import.

The Ultra font import is not used anywhere in the component.

-import { Ultra } from "next/font/google";
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8fb909e and 8a54e75.

📒 Files selected for processing (12)
  • .github/scripts/increment-version.js (1 hunks)
  • .github/workflows/auto-update-version.yml.disabled (1 hunks)
  • .github/workflows/build_docker_image.yml.disabled (0 hunks)
  • .github/workflows/production-release.yml (0 hunks)
  • .github/workflows/version-and-build.yml (0 hunks)
  • apps/web/projectData.ts (1 hunks)
  • apps/web/src/app/c/[slug]/client.tsx (1 hunks)
  • apps/web/src/app/c/[slug]/page.tsx (4 hunks)
  • apps/web/src/app/i/[slug]/page.tsx (2 hunks)
  • apps/web/src/components/markdownRender.tsx (2 hunks)
  • apps/web/src/components/navigation.tsx (3 hunks)
  • packages/db/src/migrations/0014_reflective_roughhouse.sql (1 hunks)
💤 Files with no reviewable changes (3)
  • .github/workflows/production-release.yml
  • .github/workflows/version-and-build.yml
  • .github/workflows/build_docker_image.yml.disabled
🧰 Additional context used
🧬 Code graph analysis (1)
apps/web/src/app/c/[slug]/page.tsx (1)
apps/web/src/app/c/[slug]/client.tsx (1)
  • Client (9-29)
🔇 Additional comments (7)
apps/web/projectData.ts (1)

2-2: Verify the version downgrade is intentional.

The version has been downgraded from "0.1.13-canary-1" to "0.1.12". Version rollbacks are unusual and could indicate an unintended change or a deliberate rollback to a stable release. Please confirm this downgrade aligns with your release strategy.

apps/web/src/app/i/[slug]/page.tsx (2)

15-16: LGTM! Markdown rendering properly imported.

The imports for Markdown rendering are correctly added.


69-71: LGTM! Markdown rendering properly implemented.

The text content is now rendered as Markdown with proper null handling (?? ""). The custom renderer will provide consistent styling for markdown elements including the newly added list support.

.github/scripts/increment-version.js (1)

55-57: Verify removal of prerelease detection logic.

The isStableRelease function now always returns true, effectively removing the ability to distinguish between stable and prerelease versions. All versions will be treated as stable releases going forward. Please confirm this aligns with your version management strategy and that you no longer need canary/prerelease version detection.

apps/web/src/components/markdownRender.tsx (1)

79-95: LGTM! List rendering properly implemented.

The list and listitem handlers correctly support both ordered and unordered lists with appropriate styling. The start attribute handling for ordered lists is properly implemented with a sensible default.

apps/web/src/app/c/[slug]/client.tsx (1)

1-29: LGTM! Component structure is sound.

The Client component is properly typed using inferred schema types. Note that several props (userInfo, createdAt, updatedAt) are currently unused but are likely intended for future enhancements.

apps/web/src/app/c/[slug]/page.tsx (1)

41-55: Client component integration looks correct.

The data prop structure correctly matches the Client component's expected interface, with proper mapping of userInfo, slug, title, createdAt, and updatedAt fields.

Note: This approval is contingent on fixing the critical query and null-check issues flagged in previous comments.

@hpware hpware merged commit a799a19 into master Dec 14, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant