-
Notifications
You must be signed in to change notification settings - Fork 10
docs: improve component explorer UI and apply design tokens #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ponent explorer - Created anatomy JSON files for Popover, RadioGroup, Radio, Select, Sheet, Switch, Table, Tabs, Toast, Tooltip components. - Implemented a script to generate anatomy files from component parts. - Enhanced the preview page to support an explorer mode for visualizing component anatomy. - Developed the ComponentExplorer and AnatomyPanel components for displaying component parts. - Added highlight overlay functionality to visually indicate hovered parts in the component preview. - Updated the layout and styling of the preview components for better user experience.
…proved typography
- Remove 'Live Preview' header from component explorer for cleaner UI - Replace hardcoded colors with Vapor UI design tokens in highlight overlay - Remove chevron icon from part button for simplified design Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @MaxLee-dev, 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 introduces a significant new interactive feature to the Vapor UI documentation: a 'Component Explorer'. This tool allows users to delve into the internal structure of UI components, providing a visual representation of their individual parts and how they are composed. The implementation includes a new automated process for generating component anatomy data, a dedicated UI for the explorer, and a robust communication mechanism between the main documentation page and the component preview iframe to enable interactive highlighting. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
이 PR은 문서 사이트에 컴포넌트의 구조를 시각적으로 탐색할 수 있는 'Component Explorer' 기능을 추가하는 중요한 리팩토링입니다. 전반적으로 코드 품질이 높고, 새로운 기능이 잘 구현되었습니다. 특히 postMessage를 이용한 iframe 통신과 하이라이트 로직이 인상적입니다. 몇 가지 UI 및 성능 개선을 위한 제안 사항을 코드에 남겼습니다. 이 멋진 기능 추가에 감사드립니다!
apps/website/src/components/component-explorer/component-explorer.tsx
Outdated
Show resolved
Hide resolved
apps/website/src/components/component-explorer/iframe/highlight-overlay.tsx
Show resolved
Hide resolved
apps/website/src/components/component-explorer/iframe/highlight-overlay.tsx
Outdated
Show resolved
Hide resolved
- Add AbortController to prevent race conditions when componentName changes rapidly - Add error state management and display error UI with icon and message - Add retry button for failed anatomy data fetches - Check HTTP response status and handle network errors properly - Fix highlight overlay z-index from z-1 to z-10 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
| if (highlightedPart === 'Trigger') { | ||
| const dialogPopup = document.querySelector( | ||
| '[data-part="PopupPrimitive"], [data-part="Popup"]', | ||
| ); | ||
| if (dialogPopup) { | ||
| setIsVisible(false); | ||
| return; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dialog can definitely be ambiguous... However, since elements like Menu and Select don't overlap with Trigger and Popup, I'm concerned that not displaying the Trigger when it's open might actually cause confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good suggestion. Having considered that point, I believe an Overlay covering the entire screen is semantically more appropriate than a Popup, so I've completed the modification. (PopupPrimitive → OverlayPrimitive)
1d513c5
apps/website/src/components/component-explorer/iframe/highlight-overlay.tsx
Show resolved
Hide resolved
| onBlur?: () => void; | ||
| } | ||
|
|
||
| export const PartButton = memo(function PartButton({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that using memo to memoize a component prevents the component itself from re-rendering. Is this part okay?
| onBlur, | ||
| }: PartButtonProps) { | ||
| return ( | ||
| <Button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth considering whether this element should actually be a button. Currently, it directly handles all mouse events, and clicking it doesn't trigger any action.
Also, simply hovering the mouse sets aria-pressed to true, which seems to be an incorrect WAI-ARIA pattern!
…s-component-analyzer
…component explorer
Description of Changes
The UI of the Component Explorer has been improved and design tokens applied:
Checklist