Skip to content

Comments

feat(docs): add ReactVersionSwitcher and LatestVersionBanner#1253

Open
te6-in wants to merge 14 commits intodevfrom
docs/switch-docs-versions
Open

feat(docs): add ReactVersionSwitcher and LatestVersionBanner#1253
te6-in wants to merge 14 commits intodevfrom
docs/switch-docs-versions

Conversation

@te6-in
Copy link
Member

@te6-in te6-in commented Feb 19, 2026

Summary

  • React 문서 사이드바에 VersionSwitcher 추가 — v1.0, v1.1, v1.2(latest) 간 전환 가능
  • *.pages.dev 프리뷰/이전 배포에서 seed-design.io로 안내하는 LatestVersionBanner 추가
  • 장식용 이미지에 alt="", 아이콘 컨테이너에 aria-hidden 적용 등 접근성 개선

Test plan

  • 로컬에서 bun --filter @seed-design/docs dev 실행 후 /react 섹션에서 VersionSwitcher 확인
  • pages.dev 호스트네임에서 LatestVersionBanner가 표시되는지 확인
  • seed-design.io (또는 seed-design.pages.dev)에서는 배너가 표시되지 않는지 확인

🤖 Generated with Claude Code

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 리액트 문서에 버전 전환 드롭다운 추가
    • 문서 레이아웃의 상단 및 사이드바에 최신 버전 알림 배너 추가 (프리뷰/이전 버전 문서 표시 시 안내 및 링크 제공)
  • 접근성 / UI

    • 일부 탭 아이콘과 컴포넌트 카드 표지 이미지의 alt 속성 비우기
    • 사이드바 아이콘 래퍼에 aria-hidden 속성 추가

@changeset-bot
Copy link

changeset-bot bot commented Feb 19, 2026

⚠️ No Changeset found

Latest commit: 80611f7

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

사이드바에 ReactVersionSwitcher 배너를 주입하고 레이아웃 본문 상단에 LatestVersionBanner를 렌더링합니다. 몇몇 탭 아이콘과 컴포넌트 카드의 이미지 alt를 빈 문자열로 변경하고 SidebarTabIconContaineraria-hidden을 추가했습니다.

Changes

Cohort / File(s) Summary
레이아웃 구성
docs/app/layout.config.tsx, docs/app/layout.tsx
reactOptions.sidebar.banner<ReactVersionSwitcher /> 추가 및 레이아웃 본문 최상단에 <LatestVersionBanner /> 렌더링 삽입. SidebarTabIconContaineraria-hidden 속성 추가.
새 배너 컴포넌트
docs/components/latest-version-banner.tsx
클라이언트 컴포넌트 추가. 호스트네임 검사로 조건부 렌더링하여 pages.dev 도메인일 때 배너 표시(링크 포함).
버전 전환 컴포넌트
docs/components/react-version-switcher.tsx
클라이언트 팝오버 컴포넌트 추가. 현재 버전 표시, 버전 목록 제공, 비현재 항목은 새 탭으로 오픈.
컴포넌트 카드 접근성 변경
docs/components/component-card.tsx
커버 이미지 alt를 동적 설명에서 빈 문자열로 변경.
아이콘 대체 텍스트 조정
docs/app/layout.config.tsx
탭 아이콘들(logo.webp, react.webp, lynx.svg)의 alt를 빈 문자열로 변경.

Sequence Diagram(s)

sequenceDiagram
    participant Browser as Browser
    participant Layout as Docs Layout
    participant Latest as LatestVersionBanner
    participant Sidebar as Sidebar
    participant Switcher as ReactVersionSwitcher
    participant External as External Site

    Browser->>Layout: 페이지 요청 및 렌더링
    Layout->>Latest: 마운트 시 호스트네임 검사 (useEffect)
    Latest-->>Layout: 배너 렌더 여부 결정
    Layout->>Sidebar: sidebar.banner에 Switcher 전달
    Sidebar->>Switcher: Switcher 렌더 및 현재 버전 결정
    Browser->>Switcher: 사용자 클릭 (팝오버 열기)
    Switcher->>Browser: 팝오버에 버전 목록 표시
    Browser->>External: 비현재 버전 클릭 → 새 탭으로 이동
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 사이드바에 스위처 깡충 뛰고,
창가엔 최신 배너가 살금 왔네.
alt는 비우고 시선은 가볍게,
링크는 새 탭으로 훌쩍—
문서 숲을 깡충깡충! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 주요 변경사항을 명확하게 요약합니다. 두 개의 새로운 컴포넌트(ReactVersionSwitcher와 LatestVersionBanner) 추가라는 핵심 내용을 정확히 반영하고 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/switch-docs-versions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2026

Alpha Preview (Stackflow SPA)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2026

Alpha Preview (Storybook)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2026

Alpha Preview (Docs)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
docs/components/latest-version-banner.tsx (1)

6-26: 코딩 가이드라인: 신규 컴포넌트에 displayName 미적용

**/*.{tsx,jsx} 가이드라인에서는 forwardRefdisplayName 사용을 요구하지만, 이 프로젝트는 React 19.2.3을 사용 중이므로 forwardRef는 공식적으로 deprecated 상태이며 적용이 불필요합니다. 단, HOC/동적으로 생성되지 않는 명명된 함수 컴포넌트displayName이 자동으로 추론되므로, 가이드라인 자체를 React 19 환경에 맞게 업데이트하는 것을 검토해 볼 수 있습니다.

As per coding guidelines, **/*.{tsx,jsx} 파일에서는 forwardRefdisplayName 사용이 요구됩니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/components/latest-version-banner.tsx` around lines 6 - 26, The review
notes that the new component LatestVersionBanner does not set a displayName per
project guidelines; update the component to explicitly set
LatestVersionBanner.displayName = "LatestVersionBanner" (or wrap with forwardRef
and set displayName if you intend to support refs) so tooling and stack traces
show the proper name; reference the LatestVersionBanner function and ensure the
displayName assignment is added after the function declaration (or adjust
guidelines if you prefer to exempt plain named function components for React
19.2.3).
docs/components/react-version-switcher.tsx (1)

15-17: cva를 변형(variants) 없이 기본 클래스만으로 사용

itemVariants는 variant 없이 기본 클래스만 정의되어 있어 cva 대신 cn() 또는 clsx()로 대체하면 불필요한 의존성 없이 동일한 결과를 얻을 수 있습니다.

♻️ 제안 수정
-import { cva } from "class-variance-authority";
+import clsx from "clsx";

-const itemVariants = cva(
-  "text-sm p-2 rounded-lg inline-flex items-center gap-2 hover:text-fd-accent-foreground hover:bg-fd-accent [&_svg]:size-4",
-);
+const itemBase =
+  "text-sm p-2 rounded-lg inline-flex items-center gap-2 hover:text-fd-accent-foreground hover:bg-fd-accent [&_svg]:size-4";

호출부 수정:

-className={itemVariants({
-  className: "text-fd-primary pointer-events-none justify-between",
-})}
+className={clsx(itemBase, "text-fd-primary pointer-events-none justify-between")}
-className={itemVariants({ className: "justify-between" })}
+className={clsx(itemBase, "justify-between")}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/components/react-version-switcher.tsx` around lines 15 - 17, The
variable itemVariants uses cva only to hold a static class string; replace cva
usage with a simple className helper (cn or clsx) by: remove the cva import and
definition of itemVariants, create a constant (e.g., itemClasses) containing the
same class string, import cn/clsx instead, and update all usages of itemVariants
in the ReactVersionSwitcher component to use cn(itemClasses, ...) or
clsx(itemClasses, ...) so the behavior stays identical without the cva
dependency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/components/react-version-switcher.tsx`:
- Line 33: The decorative icons IconChevronDownLine (used near current?.label)
and IconCheckmarkLine (used near version.label) are missing aria-hidden, causing
screen readers to announce them; update their usages to include
aria-hidden="true" (matching the SidebarTabIconContainer change) so the icons
are ignored by assistive tech while the text labels provide the accessible
context.
- Around line 49-57: The anchor rendered in react-version-switcher.tsx uses
target="_blank" but omits rel="noopener noreferrer"; update the <a> element that
uses version.label and version.url (the element that also calls setOpen(false)
and uses itemVariants) to include rel="noopener noreferrer" to prevent the
opened page from accessing window.opener and improve security/compatibility.

---

Nitpick comments:
In `@docs/components/latest-version-banner.tsx`:
- Around line 6-26: The review notes that the new component LatestVersionBanner
does not set a displayName per project guidelines; update the component to
explicitly set LatestVersionBanner.displayName = "LatestVersionBanner" (or wrap
with forwardRef and set displayName if you intend to support refs) so tooling
and stack traces show the proper name; reference the LatestVersionBanner
function and ensure the displayName assignment is added after the function
declaration (or adjust guidelines if you prefer to exempt plain named function
components for React 19.2.3).

In `@docs/components/react-version-switcher.tsx`:
- Around line 15-17: The variable itemVariants uses cva only to hold a static
class string; replace cva usage with a simple className helper (cn or clsx) by:
remove the cva import and definition of itemVariants, create a constant (e.g.,
itemClasses) containing the same class string, import cn/clsx instead, and
update all usages of itemVariants in the ReactVersionSwitcher component to use
cn(itemClasses, ...) or clsx(itemClasses, ...) so the behavior stays identical
without the cva dependency.

@te6-in te6-in force-pushed the docs/switch-docs-versions branch from c1d7148 to 17ae62d Compare February 19, 2026 07:19
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docs/app/layout.config.tsx (1)

14-29: SidebarTabIconContainerdisplayName이 설정되지 않았습니다.

코딩 가이드라인에서는 React 컴포넌트에 displayName을 설정하도록 요구합니다. 현재 프로젝트는 React 19.2.3을 사용하고 있으므로 forwardRef는 deprecated되어 생략이 맞지만, displayName은 React DevTools에서 컴포넌트 이름을 올바르게 표시하기 위해 여전히 유효합니다.

♻️ displayName 추가 제안
 function SidebarTabIconContainer({
   children,
   className,
 }: PropsWithChildren<{ className?: string }>) {
   return (
     <div
       aria-hidden
       className={clsx(
         className,
         "[&_svg]:size-full rounded-lg size-full text-(--tab-color) max-md:bg-(--tab-color)/10 max-md:border max-md:p-1.5",
       )}
     >
       {children}
     </div>
   );
 }
+SidebarTabIconContainer.displayName = "SidebarTabIconContainer";

As per coding guidelines, "Use forwardRef and displayName for React components" (**/*.{tsx,jsx}).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/app/layout.config.tsx` around lines 14 - 29, The SidebarTabIconContainer
component is missing a displayName; set SidebarTabIconContainer.displayName =
"SidebarTabIconContainer" after the function declaration so React DevTools shows
the correct name (no forwardRef needed here); locate the SidebarTabIconContainer
function and add the displayName assignment referencing that exact function
name.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/app/layout.config.tsx`:
- Around line 14-29: The SidebarTabIconContainer component is missing a
displayName; set SidebarTabIconContainer.displayName = "SidebarTabIconContainer"
after the function declaration so React DevTools shows the correct name (no
forwardRef needed here); locate the SidebarTabIconContainer function and add the
displayName assignment referencing that exact function name.

@te6-in te6-in force-pushed the docs/switch-docs-versions branch from 9fda8e4 to 7bf2dec Compare February 19, 2026 07:30
@te6-in te6-in changed the title feat(docs): add VersionSwitcher and LatestVersionBanner feat(docs): add ReactVersionSwitcher and LatestVersionBanner Feb 19, 2026
@te6-in te6-in force-pushed the docs/switch-docs-versions branch from 7bf2dec to 80611f7 Compare February 19, 2026 07:39
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.

1 participant