Skip to content

chore: fix dark mode bug + some improvements + rad ui with types#1306

Merged
kotAPI merged 2 commits intomainfrom
kotapi/aug-6-docs-improvements
Aug 7, 2025
Merged

chore: fix dark mode bug + some improvements + rad ui with types#1306
kotAPI merged 2 commits intomainfrom
kotapi/aug-6-docs-improvements

Conversation

@kotAPI
Copy link
Copy Markdown
Collaborator

@kotAPI kotAPI commented Aug 5, 2025

Summary by CodeRabbit

  • New Features

    • Added breadcrumb generation and structured data support for improved navigation and SEO.
  • Style

    • Updated button background and hover border colors for a lighter appearance.
    • Adjusted copy button positioning in code blocks for better alignment.
    • Explicitly set a light gray background in light mode for the main container.
  • Chores

    • Upgraded "@radui/ui" dependency to the latest version.
    • Removed two meta tags related to theme color from the documentation layout.
  • Refactor

    • Deleted the unused Theme component from the layout.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 5, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This set of changes updates UI styling in several documentation components, removes two meta tags from the HTML head, deletes the Theme component, bumps the @radui/ui dependency version, and introduces a new utility module for generating breadcrumb navigation and structured data. No changes were made to public interfaces except for the addition of breadcrumb-related exports and the removal of the Theme component.

Changes

Cohort / File(s) Change Summary
Meta Tag Removal
docs/app/layout.js
Removed two meta tags: msapplication-TileColor and theme-color from the HTML <head>.
Copy Button Styling
docs/components/Copy.js
Updated button background to a lighter blue and adjusted hover border color; no logic changes.
Main Layout Enhancements
docs/components/Main/Main.js
Added a console.log for darkModeSsrValue and explicitly sets bg-gray-50 class when dark mode is off.
CodeBlock Copy Button Position
docs/components/layout/Documentation/helpers/CodeBlock.js
Changed copy button container's right offset from right-2 (8px) to right-[20px] (20px).
Theme Component Removal
docs/components/layout/Theme.js
Deleted the Theme React component, which conditionally applied a dark theme class.
Dependency Update
docs/package.json
Updated @radui/ui dependency version from ^0.0.46 to ^0.0.47.
Breadcrumb Utilities
docs/utils/seo/generateBreadcrumbData.ts
Added new module with interfaces and functions for generating breadcrumb navigation items and JSON-LD structured data.

Sequence Diagram(s)

sequenceDiagram
  participant Page as Page Component
  participant BreadcrumbUtil as generatePageBreadcrumbs
  participant StructuredDataUtil as generateBreadcrumbStructuredData

  Page->>BreadcrumbUtil: generatePageBreadcrumbs(pathname, currentPageTitle)
  BreadcrumbUtil-->>Page: BreadcrumbItem[]
  Page->>StructuredDataUtil: generateBreadcrumbStructuredData(BreadcrumbItem[])
  StructuredDataUtil-->>Page: BreadcrumbStructuredData (JSON-LD)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • GoldGroove06

Poem

A bunny hopped through docs today,
Tidying themes and breadcrumbs' way.
Colors lighter, tags now gone,
Copy buttons scoot along.
With structured trails and UI new,
This code feels fresh—hippity-hoo!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 a572ed7 and 8a5c724.

📒 Files selected for processing (1)
  • docs/package.json (1 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kotapi/aug-6-docs-improvements

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
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: 1

🧹 Nitpick comments (2)
docs/components/Main/Main.js (1)

19-19: Remove debug console.log statement.

This debug logging statement should be removed before merging to production.

-    console.log(darkModeSsrValue)
docs/utils/seo/generateBreadcrumbData.ts (1)

23-60: Solid breadcrumb generation logic with room for improvement.

The function correctly builds breadcrumb hierarchy and handles segment name formatting. However, consider adding input validation and edge case handling.

Consider these improvements:

 export function generatePageBreadcrumbs(pathname: string, currentPageTitle: string): BreadcrumbItem[] {
+  if (!pathname || !currentPageTitle) {
+    throw new Error('pathname and currentPageTitle are required');
+  }
+  
   const segments = pathname.split('/').filter(Boolean);

Also consider handling special characters and URL encoding in segment names.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 406ea64 and a572ed7.

⛔ Files ignored due to path filters (1)
  • docs/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • docs/app/layout.js (0 hunks)
  • docs/components/Copy.js (1 hunks)
  • docs/components/Main/Main.js (2 hunks)
  • docs/components/layout/Documentation/helpers/CodeBlock.js (1 hunks)
  • docs/components/layout/Theme.js (0 hunks)
  • docs/package.json (1 hunks)
  • docs/utils/seo/generateBreadcrumbData.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • docs/app/layout.js
  • docs/components/layout/Theme.js
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: kotAPI
PR: rad-ui/ui#640
File: .github/workflows/build-rad-ui.yml:5-5
Timestamp: 2024-12-14T02:25:41.034Z
Learning: In the `rad-ui/ui` repository, the `security-fixes` branch only updates dependencies, so linting and Chromatic workflows are not required for this branch.
📚 Learning: in the `rad-ui/ui` repository, the `security-fixes` branch only updates dependencies, so linting and...
Learnt from: kotAPI
PR: rad-ui/ui#640
File: .github/workflows/build-rad-ui.yml:5-5
Timestamp: 2024-12-14T02:25:41.034Z
Learning: In the `rad-ui/ui` repository, the `security-fixes` branch only updates dependencies, so linting and Chromatic workflows are not required for this branch.

Applied to files:

  • docs/package.json
📚 Learning: the code object in docs/app/docsv2/components/aspect-ratio/docs/codeusage.js requires two closing br...
Learnt from: GoldGroove06
PR: rad-ui/ui#889
File: docs/app/docsv2/components/aspect-ratio/docs/codeUsage.js:16-17
Timestamp: 2025-02-22T18:53:12.639Z
Learning: The code object in docs/app/docsv2/components/aspect-ratio/docs/codeUsage.js requires two closing braces - one for the inner `javascript` object and another for the outer `code` object.

Applied to files:

  • docs/components/layout/Documentation/helpers/CodeBlock.js
🧬 Code Graph Analysis (1)
docs/components/Main/Main.js (1)
docs/app/layout.js (1)
  • darkModeSsrValue (101-101)
🔇 Additional comments (5)
docs/package.json (1)

17-17: LGTM! Dependency update looks good.

The @radui/ui version bump from ^0.0.46 to ^0.0.47 aligns with the PR objectives. Since this is a pre-1.0 package, ensure the update is compatible with existing component usage throughout the codebase.

docs/components/Copy.js (1)

34-34: Good UI refinement with consistent color adjustments.

The changes to lighter blue shades (bg-blue-100 and hover:border-blue-500) make the copy button more subtle and visually consistent. This aligns well with the UI improvements mentioned in the PR objectives.

docs/components/Main/Main.js (1)

33-33: Good improvement to explicit background color handling.

Adding explicit bg-gray-50 for light mode ensures consistent background styling instead of relying on default/inherited colors. This is a solid improvement for the dark mode implementation.

docs/components/layout/Documentation/helpers/CodeBlock.js (1)

110-110: Improved copy button positioning.

Increasing the right offset from 8px to 20px provides better visual spacing for the copy button. The use of arbitrary value right-[20px] suggests this specific spacing was needed for optimal layout.

docs/utils/seo/generateBreadcrumbData.ts (1)

1-15: Well-structured TypeScript interfaces for breadcrumb data.

The interfaces clearly define the expected data structures for both internal breadcrumb items and schema.org-compliant structured data. Good use of TypeScript for type safety.

Comment on lines +67 to +80
export function generateBreadcrumbStructuredData(breadcrumbs: BreadcrumbItem[]): BreadcrumbStructuredData {
const baseUrl = 'https://rad-ui.com';

return {
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": breadcrumbs.map((breadcrumb, index) => ({
"@type": "ListItem",
"position": index + 1,
"name": breadcrumb.name,
"item": `${baseUrl}${breadcrumb.url}`
}))
};
} No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Make base URL configurable instead of hard-coding.

The hard-coded baseUrl = 'https://rad-ui.com' should be configurable to support different environments (development, staging, production).

-export function generateBreadcrumbStructuredData(breadcrumbs: BreadcrumbItem[]): BreadcrumbStructuredData {
-  const baseUrl = 'https://rad-ui.com';
+export function generateBreadcrumbStructuredData(
+  breadcrumbs: BreadcrumbItem[], 
+  baseUrl: string = 'https://rad-ui.com'
+): BreadcrumbStructuredData {

This allows for environment-specific URLs while maintaining backward compatibility.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export function generateBreadcrumbStructuredData(breadcrumbs: BreadcrumbItem[]): BreadcrumbStructuredData {
const baseUrl = 'https://rad-ui.com';
return {
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": breadcrumbs.map((breadcrumb, index) => ({
"@type": "ListItem",
"position": index + 1,
"name": breadcrumb.name,
"item": `${baseUrl}${breadcrumb.url}`
}))
};
}
export function generateBreadcrumbStructuredData(
breadcrumbs: BreadcrumbItem[],
baseUrl: string = 'https://rad-ui.com'
): BreadcrumbStructuredData {
return {
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": breadcrumbs.map((breadcrumb, index) => ({
"@type": "ListItem",
"position": index + 1,
"name": breadcrumb.name,
"item": `${baseUrl}${breadcrumb.url}`
}))
};
}
🤖 Prompt for AI Agents
In docs/utils/seo/generateBreadcrumbData.ts around lines 67 to 80, the baseUrl
is hard-coded as 'https://rad-ui.com', which limits flexibility across
environments. Modify the function to accept the baseUrl as a parameter or
retrieve it from a configuration or environment variable, so it can be set
dynamically for development, staging, or production. Ensure the existing
functionality remains intact by providing a default value if no baseUrl is
supplied.

@kotAPI kotAPI merged commit b942aff into main Aug 7, 2025
5 checks passed
@kotAPI kotAPI deleted the kotapi/aug-6-docs-improvements branch August 7, 2025 11:27
@coderabbitai coderabbitai Bot mentioned this pull request Mar 30, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Apr 6, 2026
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