Skip to content

Conversation

@MaxLee-dev
Copy link
Contributor

@MaxLee-dev MaxLee-dev commented Feb 6, 2026

Description of Changes

The UI of the Component Explorer has been improved and design tokens applied:

  • Component Anatomy system implementation (anatomy JSON files, generate script)
  • ComponentExplorer and related UI components implementation (AnatomyPanel, HighlightOverlay, PartButton)
  • UI improvements and design token application
image

Checklist

  • The PR title follows the Conventional Commits convention.
  • I have added tests for my changes.
  • I have updated the Storybook or relevant documentation.
  • I have added a changeset for this change.
  • I have performed a self-code review.
  • I have followed the project's coding conventions and component patterns.

MaxLee-dev and others added 6 commits February 5, 2026 16:51
…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.
- 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>
@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2026

⚠️ No Changeset found

Latest commit: b8c61d1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Contributor

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vapor-ui Ready Ready Preview, Comment Feb 13, 2026 2:18am

Request Review

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 Component Explorer Feature: Introduced an interactive 'Component Explorer' that allows users to visualize and highlight the anatomical parts of UI components directly within the documentation. This enhances understanding of component structure.
  • Automated Anatomy Data Generation: Implemented a new build script (generate-anatomy.mjs) that automatically parses component source files to create structured JSON data describing each component's parts. This data is then used by the Component Explorer.
  • Design Token Integration: Replaced hardcoded color values (blue-500, white) in the highlight overlay with Vapor UI design tokens (v-blue-500, v-white), ensuring consistency with the project's design system.
  • UI Refinements: Streamlined the Component Explorer's user interface by removing an unnecessary 'Live Preview' header and simplifying the PartButton component by removing the ChevronRightOutlineIcon.

🧠 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
  • apps/website/content/docs/components/dialog.mdx
    • Added a new 'Anatomy' section for the Dialog component, integrating the new ComponentExplorer to showcase its structure.
  • apps/website/package.json
    • Added a new script generate:anatomy to automate the creation of component anatomy JSON data.
  • apps/website/public/components/anatomy/*.json
    • Added numerous new JSON files (e.g., avatar.json, breadcrumb.json, dialog.json, menu.json, select.json) that define the anatomical parts for various UI components. These files are generated by the new anatomy script.
  • apps/website/scripts/generate-anatomy.mjs
    • New script responsible for parsing component index.parts.ts files and generating corresponding JSON anatomy data, which is crucial for the Component Explorer.
  • apps/website/src/app/preview/[component]/page.tsx
    • Modified to accept an explorer search parameter, enabling a specialized rendering mode for the component preview page when accessed via the Component Explorer.
  • apps/website/src/app/preview/[component]/preview-wrapper.tsx
    • Updated to conditionally render the HighlightOverlay when in explorer mode and to ensure the dynamic component is centered within the preview iframe.
  • apps/website/src/app/preview/layout.tsx
    • Adjusted the html and body element styles to ensure full height and proper centering of content within the preview iframe, optimizing the display for the Component Explorer.
  • apps/website/src/components/component-explorer/anatomy-panel.tsx
    • New component responsible for displaying the list of component parts, filtering primitives, and managing hover interactions to trigger highlighting in the preview iframe.
  • apps/website/src/components/component-explorer/component-explorer.tsx
    • New core component that orchestrates the Component Explorer. It fetches anatomy data, renders the component preview in an iframe, and manages communication for interactive highlighting.
  • apps/website/src/components/component-explorer/iframe/highlight-overlay.tsx
    • New component rendered inside the component preview iframe. It creates a visual overlay to highlight specific component parts based on messages received from the parent window, now using Vapor UI design tokens for colors.
  • apps/website/src/components/component-explorer/iframe/use-highlight-receiver.ts
    • New custom React hook to facilitate receiving highlight messages from the parent window within the iframe context.
  • apps/website/src/components/component-explorer/index.ts
    • New entry point file for the Component Explorer module, exporting its main components and types.
  • apps/website/src/components/component-explorer/part-button.tsx
    • New component for interactive buttons representing individual component parts, with the ChevronRightOutlineIcon removed to simplify the interface.
  • apps/website/src/components/component-explorer/types.ts
    • New file defining TypeScript types and message constants for the internal communication within the Component Explorer system.
  • apps/website/src/components/component-explorer/use-explorer-communication.ts
    • New custom React hook to manage sending highlight messages from the parent window to the component preview iframe.
  • apps/website/src/components/demo/examples/dialog/anatomy-dialog.tsx
    • New example component for the Dialog, specifically structured with data-part attributes to be compatible with the Component Explorer's highlighting functionality.
  • apps/website/src/mdx-components.tsx
    • Integrated the new ComponentExplorer component, making it available for use within MDX documentation files.
Activity
  • MaxLee-dev created this pull request to refactor and improve the component explorer UI and apply design tokens.
  • The pull request includes a new script to generate component anatomy data, new components for the explorer UI, and updates to existing preview infrastructure.
  • MaxLee-dev has performed a self-code review and confirmed adherence to project coding conventions and component patterns.
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
Contributor

@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

이 PR은 문서 사이트에 컴포넌트의 구조를 시각적으로 탐색할 수 있는 'Component Explorer' 기능을 추가하는 중요한 리팩토링입니다. 전반적으로 코드 품질이 높고, 새로운 기능이 잘 구현되었습니다. 특히 postMessage를 이용한 iframe 통신과 하이라이트 로직이 인상적입니다. 몇 가지 UI 및 성능 개선을 위한 제안 사항을 코드에 남겼습니다. 이 멋진 기능 추가에 감사드립니다!

- 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>
Comment on lines 36 to 44
if (highlightedPart === 'Trigger') {
const dialogPopup = document.querySelector(
'[data-part="PopupPrimitive"], [data-part="Popup"]',
);
if (dialogPopup) {
setIsVisible(false);
return;
}
}
Copy link
Contributor

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.

Copy link
Contributor Author

@MaxLee-dev MaxLee-dev Feb 12, 2026

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

onBlur?: () => void;
}

export const PartButton = memo(function PartButton({
Copy link
Contributor

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
Copy link
Contributor

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!

@MaxLee-dev MaxLee-dev changed the title refactor: improve component explorer UI and apply design tokens docs: improve component explorer UI and apply design tokens Feb 12, 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.

2 participants