Skip to content

feat(layer): add custom content components and UI primitives for extending apps#8

Merged
amondnet merged 3 commits intomainfrom
2-support-custom-content-components-that-use-layer-ui-components-in-extending-apps
Dec 4, 2025
Merged

feat(layer): add custom content components and UI primitives for extending apps#8
amondnet merged 3 commits intomainfrom
2-support-custom-content-components-that-use-layer-ui-components-in-extending-apps

Conversation

@amondnet
Copy link
Copy Markdown
Contributor

@amondnet amondnet commented Dec 4, 2025

Summary

  • Add custom content components (BrowserFrame, ProseIcon, UColorModeImage) for MDC support in extending apps
  • Add Switch and Table UI components as shadcn-vue primitives
  • Enhance Tabs styling with better icon support and improved type safety
  • Add landing page components (ColorModeSwitch) with dark/light mode mode-aware images
  • Update MDC component mappings in nuxt.config.ts for content layer integration
  • Update components.json with new component definitions

Closes #2

Test plan

  • Verify new content components render correctly in apps/docs
  • Test ColorModeSwitch component in landing page
  • Test Switch and Table UI components with different states
  • Verify tabs styling looks correct with icons
  • Check dark/light mode images switch properly
  • Ensure no TypeScript errors in layer package
  • Test layout and responsive behavior

…nding apps

- Add BrowserFrame, ProseIcon, UColorModeImage content components for MDC support
- Add Switch and Table UI components as shadcn-vue primitives
- Enhance Tabs styling with better icon support and type safety
- Add landing page components (ColorModeSwitch) with dark/light mode images
- Update MDC component mappings in nuxt.config.ts
- Update components.json with new component definitions

Closes #2
@amondnet amondnet linked an issue Dec 4, 2025 that may be closed by this pull request
4 tasks
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @amondnet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the UI and content capabilities of the application layer by introducing a set of new, reusable components. It provides developers with custom content components for richer Markdown experiences, essential UI primitives like Switch and Table for building consistent interfaces, and enhances existing components like Tabs for better usability and type safety. These additions aim to streamline development and improve the overall visual consistency and functionality of extending applications.

Highlights

  • New MDC Content Components: Introduced BrowserFrame, ProseIcon, and UColorModeImage components to enhance content rendering capabilities within Markdown (MDC) for extending applications.
  • New UI Primitives: Added Switch and a full suite of Table components (Table, TableBody, TableCaption, TableCell, TableEmpty, TableFooter, TableHead, TableHeader, TableRow) as shadcn-vue inspired primitives.
  • Tabs Component Enhancements: Refactored existing Tabs components to improve styling, enhance icon support, and bolster type safety, providing a more robust and flexible tab interface.
  • Landing Page Integration: Implemented a ColorModeSwitch component for the landing page and added dark/light mode-aware images, demonstrating the new color mode capabilities.
  • Configuration Updates: Updated nuxt.config.ts to map the new content components for MDC integration and adjusted components.json for style consistency.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @amondnet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the component library by introducing several new content components and UI primitives. It aims to provide more flexible and powerful tools for extending applications, particularly with Markdown Content (MDC) support. Additionally, existing Tabs components have received styling and type safety improvements, and the landing page now features enhanced color mode awareness.

Highlights

  • New MDC Content Components: Introduced custom content components such as BrowserFrame, ProseIcon, and UColorModeImage to enhance Markdown Content (MDC) support in extending applications.
  • New UI Primitives: Added Switch and Table components as shadcn-vue primitives, providing more foundational UI elements for application development.
  • Tabs Component Enhancements: Improved the styling of existing Tabs components to better support icons and enhanced their type safety for more robust usage.
  • Landing Page Color Mode Awareness: Integrated a new ColorModeSwitch component and utilized UColorModeImage to enable dark/light mode-aware images and functionality on the landing page.
  • MDC Configuration Updates: Updated nuxt.config.ts to map the newly added content components, ensuring they are correctly recognized and rendered within the MDC system.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds several useful components for extending apps, including custom content components like BrowserFrame and UColorModeImage, and UI primitives like Switch and Table. The styling for Tabs components has also been enhanced. My review focuses on improving type safety, correcting component implementation to leverage Nuxt features, and flagging a potentially incorrect file addition. Overall, these are great additions that will improve the developer experience.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several new components and UI primitives to extend applications, including custom content components like BrowserFrame, ProseIcon, and UColorModeImage, as well as Switch and Table components based on shadcn-vue. The styling for Tabs has also been enhanced. My review focuses on improving type safety and component implementation. I've identified a couple of areas for improvement, such as using more specific types instead of any and leveraging NuxtImg for better performance and functionality in the UColorModeImage component. Overall, this is a solid contribution that adds valuable features.

Comment on lines +16 to +30
<SwitchRoot
:checked="isLight"
aria-label="Toggle color mode"
class="relative w-[140px] h-[280px] rounded-lg bg-muted cursor-pointer transition-colors"
@update:checked="toggleColorMode"
>
<SwitchThumb
class="absolute top-[2px] left-[2px] flex items-center justify-center rounded-lg bg-background shadow-lg transition-all duration-300 ease-in-out size-[136px] data-[state=checked]:translate-y-[140px]"
>
<Icon
:name="isLight ? 'lucide:sun' : 'lucide:moon'"
class="size-16 text-foreground"
/>
</SwitchThumb>
</SwitchRoot>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The dimensions and positioning of the switch and its thumb are defined with hardcoded 'magic numbers' in the Tailwind classes (e.g., w-[140px], h-[280px], size-[136px], translate-y-[140px]). These values appear to be related (280 = 140 * 2, 136 = 140 - 2 * 2). Using hardcoded values makes the component difficult to maintain and update. If the width 140px changes, several other values need to be manually recalculated and updated.

Consider using CSS variables to define these related values, which would make the component more maintainable and readable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

⏭️ Not applied

  • Reason: The magic numbers are tightly coupled visual values for this specific decorative component. Using CSS variables would add complexity without significant maintenance benefit since these values won't change frequently.
  • Alternative: The component works correctly as-is with readable, self-documenting class names.

Thank you for the consideration, @gemini-code-assist!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thank you for the detailed explanation, @amondnet. I understand your reasoning regarding the trade-off between maintainability and added complexity for this specific decorative component. Your approach is reasonable given the context.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Dec 4, 2025

Deploying docs-please with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4e52c2e
Status:🚫  Deploy failed.

View logs

Remove mistakenly added React table.tsx file from packages/app.
This file was not part of the Vue-based documentation layer.
- Use NuxtImg instead of img in UColorModeImage for Nuxt Image optimization
- Pass format prop to NuxtImg for image format negotiation
- Improve type safety in ProseIcon using Component and HTMLAttributes types
- Fix lint issues: use single quotes, format template attributes
@amondnet amondnet merged commit 7615ad7 into main Dec 4, 2025
1 check failed
@amondnet amondnet deleted the 2-support-custom-content-components-that-use-layer-ui-components-in-extending-apps branch December 4, 2025 06:40
@amondnet amondnet self-assigned this Dec 4, 2025
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.

Support custom content components that use layer UI components in extending apps

1 participant