Skip to content

Comments

feat(mdx): add Image component to MDX rendering#2032

Merged
ComputelessComputer merged 1 commit intomainfrom
feat/add-image-component-mdx
Dec 1, 2025
Merged

feat(mdx): add Image component to MDX rendering#2032
ComputelessComputer merged 1 commit intomainfrom
feat/add-image-component-mdx

Conversation

@ComputelessComputer
Copy link
Collaborator

No description provided.

@netlify
Copy link

netlify bot commented Dec 1, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit 43757e1
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/692d0ba380b6ca00080ec729
😎 Deploy Preview https://deploy-preview-2032--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

📝 Walkthrough

Walkthrough

Adds Image component support to MDX content rendering across five route pages (changelog, company-handbook, docs, legal, roadmap) by importing the Image component and mapping it to MDXContent components, with both Image and img: Image entries. Includes minor styling adjustments in the docs and roadmap routes.

Changes

Cohort / File(s) Summary
Image component integration for MDX rendering
apps/web/src/routes/_view/changelog/$slug.tsx, apps/web/src/routes/_view/company-handbook/-components.tsx, apps/web/src/routes/_view/legal/$slug.tsx, apps/web/src/routes/_view/roadmap/$slug.tsx
Added Image component import from @/components/image and updated MDXContent components prop to include Image and img: Image alias across all locations where MDXContent is used
Docs MDX components restructuring
apps/web/src/routes/_view/docs/-components.tsx
Added Image component import and mapping; consolidated duplicate component entries (CtaCard, DeeplinksList, HooksList, OpenAPIDocs); added prose styling rules (prose-code:bg-transparent, prose-code:border-0, prose-code:p-0) to article container
Roadmap styling enhancement
apps/web/src/routes/_view/roadmap/$slug.tsx
Extended prose-pre block styling with additional classes for transparent background and borderless code blocks alongside Image component integration

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • All changes follow a consistent pattern of adding Image component imports and MDXContent mappings across multiple files, making them repetitive and straightforward to verify
  • Docs file requires slightly more attention due to the consolidation of duplicate component entries and additional styling rules
  • Verify that Image component import path is correct and consistent across all files
  • Confirm prose styling classes are correctly applied and don't conflict with existing styles

Possibly related PRs

  • upgraded changelog #1755: Modifies the same changelog route file, introducing ChangelogContent/ChangelogContentSection components that are now receiving Image support
  • fix landing #1661: Modifies the same docs MDX rendering components file, restructuring DocLayout/ArticleHeader alongside the Image component additions
  • ui changes #1781: Adds or modifies the Image component implementation itself, directly related to the component being integrated here

Suggested reviewers

  • yujonglee

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether a description is related to the changeset. Add a pull request description explaining the purpose, motivation, and impact of adding Image component support to MDX rendering.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly describes the main change: adding an Image component to MDX rendering across multiple files in the codebase.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/add-image-component-mdx

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

@netlify
Copy link

netlify bot commented Dec 1, 2025

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit 43757e1
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/692d0ba337e86300084e9e2f
😎 Deploy Preview https://deploy-preview-2032--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@argos-ci
Copy link

argos-ci bot commented Dec 1, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
web (Inspect) ⚠️ Changes detected (Review) 2 changed Dec 1, 2025, 3:33 AM

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: 0

🧹 Nitpick comments (2)
apps/web/src/routes/_view/roadmap/$slug.tsx (1)

151-161: Roadmap prose styling and Image mapping are consistent with docs

The expanded prose classes (notably the prose-pre:prose-code:* overrides and prose-img:* image styling) should give consistent MDX rendering, and wiring { Image, img: Image, mermaid: Mermaid, Mermaid, Tweet } mirrors the other routes without removing existing functionality.

If you find these long prose class strings diverging across pages over time, consider extracting a shared constant or utility for the common prose config to reduce drift.

apps/web/src/routes/_view/docs/-components.tsx (1)

107-133: Docs MDX article styling and components map are well‑structured

The updated prose classes (including prose-pre:prose-code:* overrides and prose-img:* rules) look coherent, and consolidating all MDX components—including CtaCard, DeeplinksList, HooksList, OpenAPIDocs, and Image/img: Image—into a single components object removes duplication while expanding capabilities.

Given docs, roadmap, and handbook now share very similar prose configurations, you might later factor the common Tailwind prose class string into a shared constant to avoid subtle divergence across pages.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7747cb6 and 43757e1.

📒 Files selected for processing (5)
  • apps/web/src/routes/_view/changelog/$slug.tsx (2 hunks)
  • apps/web/src/routes/_view/company-handbook/-components.tsx (2 hunks)
  • apps/web/src/routes/_view/docs/-components.tsx (2 hunks)
  • apps/web/src/routes/_view/legal/$slug.tsx (2 hunks)
  • apps/web/src/routes/_view/roadmap/$slug.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props, just inline them instead.
Never do manual state management for form/mutation. Use useForm (from tanstack-form) and useQuery/useMutation (from tanstack-query) instead for 99% of cases. Avoid patterns like setError.
If there are many classNames with conditional logic, use cn (import from @hypr/utils). It is similar to clsx. Always pass an array and split by logical grouping.
Use motion/react instead of framer-motion.

Files:

  • apps/web/src/routes/_view/legal/$slug.tsx
  • apps/web/src/routes/_view/company-handbook/-components.tsx
  • apps/web/src/routes/_view/roadmap/$slug.tsx
  • apps/web/src/routes/_view/changelog/$slug.tsx
  • apps/web/src/routes/_view/docs/-components.tsx
🧠 Learnings (4)
📚 Learning: 2025-11-24T16:32:23.055Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:32:23.055Z
Learning: Applies to **/*.{ts,tsx} : If there are many classNames with conditional logic, use `cn` (import from `hypr/utils`). It is similar to `clsx`. Always pass an array and split by logical grouping.

Applied to files:

  • apps/web/src/routes/_view/roadmap/$slug.tsx
📚 Learning: 2025-11-24T16:32:19.706Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:32:19.706Z
Learning: Applies to **/*.{ts,tsx} : If there are many classNames with conditional logic, use `cn` (import from `hypr/utils`), similar to `clsx`. Always pass an array and split by logical grouping.

Applied to files:

  • apps/web/src/routes/_view/roadmap/$slug.tsx
📚 Learning: 2025-11-24T16:32:29.314Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: apps/web/content/changelog/AGENTS.md:0-0
Timestamp: 2025-11-24T16:32:29.314Z
Learning: Applies to apps/web/content/changelog/** : Only keep desktop-related changes when maintaining changelog entries from commits and diffs

Applied to files:

  • apps/web/src/routes/_view/changelog/$slug.tsx
📚 Learning: 2025-11-24T16:32:30.770Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: apps/web/content/changelog/AGENTS.md:0-0
Timestamp: 2025-11-24T16:32:30.770Z
Learning: Applies to apps/web/content/changelog/** : Only include desktop-related changes in the changelog when reading through commits and diffs

Applied to files:

  • apps/web/src/routes/_view/changelog/$slug.tsx
🧬 Code graph analysis (4)
apps/web/src/routes/_view/legal/$slug.tsx (3)
apps/web/src/components/image.tsx (1)
  • Image (4-24)
apps/web/src/components/mdx/index.ts (1)
  • Mermaid (1-1)
apps/web/src/components/mdx/mermaid.tsx (1)
  • Mermaid (5-7)
apps/web/src/routes/_view/company-handbook/-components.tsx (1)
apps/web/src/components/image.tsx (1)
  • Image (4-24)
apps/web/src/routes/_view/roadmap/$slug.tsx (1)
apps/web/src/components/image.tsx (1)
  • Image (4-24)
apps/web/src/routes/_view/changelog/$slug.tsx (2)
apps/web/src/components/image.tsx (1)
  • Image (4-24)
apps/web/src/components/mdx/mermaid.tsx (1)
  • Mermaid (5-7)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Redirect rules - hyprnote
  • GitHub Check: Header rules - hyprnote
  • GitHub Check: Pages changed - hyprnote
  • GitHub Check: ci
  • GitHub Check: fmt
🔇 Additional comments (8)
apps/web/src/routes/_view/legal/$slug.tsx (2)

5-6: Image import wiring looks correct

The new Image import is straightforward and used below; nothing unused or cyclic here.


59-62: MDX components map extension is consistent and non‑breaking

Adding { Image, img: Image, mermaid: Mermaid, Mermaid, Tweet } keeps existing MDX components intact while enabling both <Image> and <img> to go through the shared Image component; consistent with the other routes in this PR.

apps/web/src/routes/_view/company-handbook/-components.tsx (2)

17-18: Image import added appropriately

The Image import is local, side‑effect free, and only used in the MDX components map; no issues here.


102-121: Handbook MDX prose and Image integration look good

The updated <article> prose classes (including prose-img:rounded-sm prose-img:my-8 max-w-none) are coherent, and passing both Image and img: Image into MDXContent aligns this layout with the other MDX views.

apps/web/src/routes/_view/roadmap/$slug.tsx (1)

8-9: Roadmap Image import usage is clean

Image is imported once and consumed directly in the MDX components map; no dead code or layering concerns.

apps/web/src/routes/_view/docs/-components.tsx (1)

20-23: Image import aligns with new MDX usage

The docs layout now imports Image alongside the other MDX helpers; import order and usage are consistent with the rest of the codebase.

apps/web/src/routes/_view/changelog/$slug.tsx (2)

29-32: Changelog Image import is straightforward

Image is imported once and used only in the MDX components map; no side effects or unused imports.


577-583: Changelog MDX body now consistently supports Image

The new prose configuration (especially prose-pre:prose-code:* and prose-img:* classes) should align changelog MDX rendering with docs/roadmap, and mapping { Image, img: Image, mermaid: Mermaid, Mermaid, Tweet } gives MDX content the same Image behavior without altering existing Mermaid/Tweet support.

@ComputelessComputer ComputelessComputer merged commit 42a92d7 into main Dec 1, 2025
12 of 13 checks passed
@ComputelessComputer ComputelessComputer deleted the feat/add-image-component-mdx branch December 1, 2025 03:59
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