Skip to content

Conversation

@MaxLee-dev
Copy link
Contributor

Related Issues

N/A

Description of Changes

  • Added a toggle group for responsive support in block examples.
  • Added an iframe-preview component for iframe rendering in block examples for responsive support.

Checklist

Before submitting the PR, please make sure you have checked all of the following items.

  • The PR title follows the Conventional Commits convention. (e.g., feat, fix, docs, style, refactor, test, chore)
  • I have added tests for my changes.
  • I have updated the Storybook or relevant documentation.
  • I have added a changeset for this change. (e.g., for any changes that affect users, such as component prop changes or new features).
  • I have performed a self-code review.
  • I have followed the project's coding conventions and component patterns.

@MaxLee-dev MaxLee-dev self-assigned this Sep 24, 2025
@MaxLee-dev MaxLee-dev added the scope: docs Issues related to the Docs component. label Sep 24, 2025
@changeset-bot
Copy link

changeset-bot bot commented Sep 24, 2025

⚠️ No Changeset found

Latest commit: 0835bf5

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

vercel bot commented Sep 24, 2025

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

Project Deployment Preview Comments Updated (UTC)
vapor-ui Ready Ready Preview Comment Oct 29, 2025 7:55am

@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 significantly upgrades the website's component demonstration capabilities by implementing a responsive preview system. It introduces a new toggle group for device selection and transitions component examples to an iframe-based rendering, allowing users to accurately visualize how UI components adapt to different screen dimensions. This enhancement aims to provide a more robust and user-friendly documentation experience.

Highlights

  • Responsive Preview Toggle: A new toggle group has been introduced, allowing users to easily switch between desktop, tablet, and mobile views for component examples, enhancing the preview experience.
  • Iframe-based Previews: Component previews are now rendered within iframes, providing better isolation and ensuring accurate responsive behavior across different device simulations.
  • Demo Component Refactor: The core Demo component has undergone a significant refactoring to integrate the new responsive toggle and iframe preview system, improving its modularity and functionality.
  • Form Component Responsiveness: Several form examples have been updated to utilize width="100%", ensuring they adapt gracefully to various screen sizes and maintain their layout.
  • Live Code Block Removal: The LiveCodeBlock component and its associated files have been removed, streamlining the codebase and potentially simplifying the documentation rendering process.
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은 문서 사이트의 컴포넌트 예시에 반응형 토글 기능을 추가하고, 이를 위해 iframe을 사용한 미리보기로 업데이트하는 변경 사항을 담고 있습니다. 전반적으로 코드 구조가 개선되고 새로운 기능이 잘 구현되었지만, 몇 가지 중요한 보안 및 스타일 가이드 관련 개선점이 필요합니다. 특히, 동적 컴포넌트 로딩 시 경로 조작 취약점이 발견되어 수정이 시급합니다. 또한, 새로 추가된 컴포넌트에서 스타일 가이드에 맞지 않는 하드코딩된 색상 값과 default export 사용이 확인되었습니다. 코드 리뷰 의견을 참고하여 수정하시면 코드의 안정성과 일관성을 더욱 높일 수 있을 것입니다.

Comment on lines +53 to +57
if (!componentPath) {
setError('No component path provided');
setIsLoading(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.

critical

보안 취약점: componentPath를 동적 import에 사용하기 전에 유효성 검사를 추가해야 합니다. 현재 코드는 searchParams에서 받은 경로를 그대로 사용하므로 경로 조작(Path Traversal) 공격에 취약할 수 있습니다.

componentPath../와 같은 문자가 포함되어 있는지 확인하고, 허용된 문자(예: 영문, 숫자, -, /, _)만으로 구성되었는지 검증하는 로직을 이 부분에 추가하는 것을 권장합니다.

Comment on lines 54 to 61
useEffect(() => {
// Small delay to ensure DOM is updated and mask is centered properly
const timer = setTimeout(() => {
updateMaskPosition(selectedValue);
}, 0);

return () => clearTimeout(timer);
}, [selectedValue]);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

DOM 레이아웃 정보를 읽어 스타일을 업데이트하는 로직에는 useEffect보다 useLayoutEffect를 사용하는 것이 더 적합합니다. useEffect는 비동기적으로 실행되므로, 렌더링 후 마스크 위치가 업데이트되기까지 미세한 딜레이가 발생하여 깜빡임(flicker) 현상을 유발할 수 있습니다. useLayoutEffect는 브라우저가 화면을 그리기 전에 동기적으로 실행되므로, 이러한 문제를 방지하고 더 부드러운 시각적 경험을 제공합니다. setTimeout을 사용하는 현재 방식 대신 useLayoutEffect로 변경하고, React import 구문에 useLayoutEffect를 추가하는 것을 권장합니다.

Comment on lines 56 to 70
<div
ref={containerRef}
className="resizable-preview-container"
style={{
width: `${getInitialWidth()}px`,
maxWidth: '100%',
minWidth: '320px',
margin: '0 auto',
resize: 'horizontal',
overflow: 'hidden',
border: '2px dashed #e5e7eb',
borderRadius: '8px',
backgroundColor: 'white',
position: 'relative',
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

컴포넌트 내에 인라인 스타일이 광범위하게 사용되었습니다. 프로젝트에서는 Vanilla Extract를 통한 스타일링을 지향하고 있으므로, 일관성 및 유지보수성 향상을 위해 이 스타일들을 별도의 .css.ts 파일로 분리하고 recipestyle 함수를 사용하여 클래스로 관리하는 것을 권장합니다. 이렇게 하면 테마 변수 활용도 용이해집니다.

Comment on lines 100 to 109
export default function Page({ searchParams }: PreviewPageProps) {
const resolvedSearchParams = React.use(searchParams);
const componentPath = resolvedSearchParams.path;

return (
<Suspense fallback={<div>Loading...</div>}>
<DynamicComponent componentPath={componentPath} />
</Suspense>
);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

page for render demo examples with iframe

Copy link
Contributor

@ZeroChoi2781 ZeroChoi2781 left a comment

Choose a reason for hiding this comment

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

Nit

Unnecessary comments should be removed.

fix(button-toggle-group): update background color and text color for better visibility
fix(source.config): change dark theme from 'slack-dark' to 'github-dark'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: docs Issues related to the Docs component.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants