Conversation
…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
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| <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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
⏭️ 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!
There was a problem hiding this comment.
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.
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
Summary
Closes #2
Test plan