Skip to content

feat(ui): デザインシステム基盤とDesign Labを追加 - #648

Merged
hmjn023 merged 3 commits into
developfrom
feat/design-system-foundation
Jul 29, 2026
Merged

feat(ui): デザインシステム基盤とDesign Labを追加#648
hmjn023 merged 3 commits into
developfrom
feat/design-system-foundation

Conversation

@hmjn023

@hmjn023 hmjn023 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

概要

既存UIを整理するための実動プロトタイプを /design-lab に追加し、今回合意したデザイン骨子を公式design.md形式の DESIGN.md として固定します。

変更内容

  • Library、Media Detail、Manager、Jobs、Settingsを含むDesign Labを追加
  • Sources、Import inbox、検索composer、Popover、Modal、Drawer、Toastの操作パターンを実装
  • 未保存Overlayの破棄確認、一覧状態復元、レスポンシブ表示、reduced motionを整理
  • 共通Dialogへ右Drawer配置を追加し、AlertDialogの出現位置を安定化
  • Toastを成功・Job投入・警告・失敗の4用途へ整理
  • ルート DESIGN.md に色、文字、余白、形状、画面骨格、各UIの判断基準を記述
  • @google/design.md 0.4.0 と design:lint を導入し、通常checkへ組み込み
  • AGENTS.mdからDESIGN.mdを主要ドキュメントとして参照

技術詳細

DESIGN.mdは機械可読tokenと人向けの設計理由を併記し、公式lintでerrors 0・warnings 0です。実画面移植時はDESIGN.mdを規範、/design-labを挙動の参照実装、Solid UIを共有primitive基盤として扱います。

検証

  • bun run check
  • server unit: 163 passed
  • server integration: 68 passed
  • CLI: 11 passed
  • core: 14 passed
  • UI: 51 passed
  • Design Labのwide/mobileブラウザ確認
  • axe accessibility violations: 0

Summary by CodeRabbit

  • 新機能

    • /design-lab にデザインシステムの参照画面を追加しました。
    • メディア検索、詳細表示、ジョブ管理、設定、各種レイアウトやオーバーレイの操作例を確認できます。
    • ダイアログを中央配置または右側配置で表示できるようになりました。
  • 改善

    • 通知に閉じるボタン、表示件数、表示時間、アクセシビリティ設定を追加しました。
    • ダイアログや確認画面のアニメーションを調整しました。
  • ドキュメント

    • UIデザインシステムの指針、アクセシビリティ、実装ルールを追加しました。

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@hmjn023, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 46d173d3-6969-4b44-93c8-dbca02dcfc8b

📥 Commits

Reviewing files that changed from the base of the PR and between d96b674 and 71ca522.

📒 Files selected for processing (2)
  • apps/server/src/routes/__root.tsx
  • packages/ui/src/screens/design-concept-screen.tsx
📝 Walkthrough

Walkthrough

デザインシステム文書と検証スクリプトを追加し、/design-lab ルートと統合UIを実装しました。Dialog、AlertDialog、Toastの表示仕様も更新し、デザインラボではライブラリ、詳細、管理、設定、ジョブ、オーバーレイ画面を提供します。

Changes

デザインシステムとデザインラボ

Layer / File(s) Summary
デザイン規範と検証導線
DESIGN.md, AGENTS.md, package.json
デザイン tokens、レイアウト、コンポーネント、アクセシビリティ、運用規則を追加し、checkdesign:lint を組み込みました。
ダイアログと通知プリミティブ
packages/ui/src/dialog.tsx, packages/ui/src/alert-dialog.tsx, packages/ui/src/toast.tsx
Dialogの中央・右配置、AlertDialogのアニメーション変更、Toasterの閉じる操作と表示設定を追加しました。
デザインラボのルート統合
apps/server/src/routes/__root.tsx, apps/server/src/routes/design-lab.tsx
/design-lab でSSRを無効化して画面を表示し、共通のAppShellを除外するルーティングを追加しました。
ライブラリとメディア詳細フロー
packages/ui/src/screens/design-concept-screen.tsx
サイドバー、メディア一覧、検索・フィルター、インスペクター、詳細画面、Import inboxを実装しました。
画面パターンと管理ビュー
packages/ui/src/screens/design-concept-screen.tsx
画面レイアウト、インタラクション、Manager、Data transfer、Jobs、設定、Overlay patternsを実装し、ビュー切替を統合しました。

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant RootComponent
  participant DesignLabRoute
  participant DesignConceptScreen

  Browser->>RootComponent: /design-labを表示
  RootComponent->>RootComponent: pathnameを確認
  RootComponent->>DesignLabRoute: AppShellなしでOutletを表示
  DesignLabRoute->>DesignConceptScreen: デザインラボを返す
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Design System文書とDesign Lab追加という変更の主旨を簡潔に表しており、内容と一致しています。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/design-system-foundation

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
packages/ui/src/screens/design-concept-screen.tsx (2)

2681-2700: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

型キャストではなく型ガードで絞り込んでください。

area() as Exclude<...>ManagerArea に新しい値を追加したときに型チェックをすり抜け、ManagerBatchToolPanelcontent()undefined を返して L2349 の content().title が実行時エラーになります。バッチツール用の型ガードを用意すれば、キャストなしで網羅性がコンパイル時に担保されます。

コーディングガイドラインの「アプリケーション本体コードでは型のごまかしを禁止する。型ガードを優先」にも沿います。

♻️ 提案するリファクタ

L2294 付近に追加:

type ManagerBatchArea = Extract<ManagerArea, "duplicates" | "tagging" | "vectors">;

function isManagerBatchArea(area: ManagerArea): area is ManagerBatchArea {
	return area === "tagging" || area === "vectors" || area === "duplicates";
}

呼び出し側:

 					<Show
 						fallback={
-							<Show
-								fallback={
-									<ManagerBatchToolPanel
-										area={
-											area() as Exclude<
-												ManagerArea,
-												"characters" | "ips" | "projects" | "transfer"
-											>
-										}
-									/>
-								}
-								when={area() === "transfer"}
-							>
-								<DataTransferToolPanel />
-							</Show>
+							<Show fallback={<DataTransferToolPanel />} when={isManagerBatchArea(area())}>
+								{/* Show は when の真値を渡すため、型ガード済みの値を受け取る */}
+								<ManagerBatchToolPanel area={area() as ManagerBatchArea} />
+							</Show>
 						}
 						when={isManagerEntityArea(area())}
 					>

キャストを完全に排除するなら、Show when={...} の代わりに Switch/Match と型ガードを組み合わせ、ManagerBatchToolPanelprops.areaManagerArea 受け取り + 内部で default を持つ形にする方法もあります。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/screens/design-concept-screen.tsx` around lines 2681 - 2700,
Replace the `area() as Exclude<...>` cast passed to `ManagerBatchToolPanel` with
an `isManagerBatchArea` type guard and a corresponding `ManagerBatchArea` type
derived from `ManagerArea`. Use the guard in the rendering branch so
`ManagerBatchToolPanel` receives only valid batch areas, preserving compile-time
exhaustiveness when `ManagerArea` gains new values.

Source: Coding guidelines


4291-4315: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

7段のネスト三項をビューマップへ切り出すと読みやすくなります。

ビュー追加のたびにネストが深くなります。Switch/Match、またはビュー→コンポーネントのマップで置き換える方が保守しやすいです。

♻️ 提案するリファクタの方向性
+import { Match, Switch } from "solid-js";
-			<Show
-				fallback={
-					activeView() === "detail" ? (
-						<DesignMediaDetailScreen ... />
-					) : activeView() === "overlays" ? (
-						...
-					) : (
-						<InteractionPatternsScreen />
-					)
-				}
-				when={activeView() === "library"}
-			>
+			<Switch fallback={<InteractionPatternsScreen />}>
+				<Match when={activeView() === "detail"}>
+					<DesignMediaDetailScreen
+						media={selectedMedia()}
+						onBack={() => setActiveView("library")}
+						onNext={() => selectAdjacentMedia(1)}
+						onPrevious={() => selectAdjacentMedia(-1)}
+					/>
+				</Match>
+				<Match when={activeView() === "overlays"}>
+					<OverlayPatternsScreen onOpenJobs={() => setActiveView("jobs")} />
+				</Match>
+				<Match when={activeView() === "layouts"}><ScreenLayoutsScreen /></Match>
+				<Match when={activeView() === "manager"}><DesignManagerScreen /></Match>
+				<Match when={activeView() === "jobs"}><JobsScreen /></Match>
+				<Match when={activeView() === "settings"}><SettingsScreen /></Match>
+				<Match when={activeView() === "library"}>{/* library + inspector */}</Match>
+			</Switch>

library はインスペクターと2要素を返すため、Match 内でフラグメントにまとめる調整が必要です。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/screens/design-concept-screen.tsx` around lines 4291 - 4315,
Replace the nested activeView() ternary chain in the Show fallback with a
Switch/Match-based view selection or an equivalent view-to-component map.
Preserve each existing view mapping and callbacks, and ensure the library case
remains grouped as a fragment containing the inspector and its two elements.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/server/src/routes/__root.tsx`:
- Around line 56-59: Update the Show condition in the root route around
DesignConceptScreen so any pathname beginning with "/design-lab" uses the
design-lab full-screen path, including trailing slashes and nested routes, while
preserving the AppShell/Outlet fallback for all other paths.

In `@packages/ui/src/screens/design-concept-screen.tsx`:
- Around line 3133-3148: Update the Show condition around the Cancel job button
so it is displayed only when selectedJob().status is running or queued; keep the
Retry job button for failed jobs and ensure completed jobs display neither
action.
- Around line 631-645: Update the navigation button’s aria-label in the
component containing props.active, props.label, and props.badge so it includes
the badge count when props.badge is present, including the collapsed state.
Preserve the existing label unchanged when no badge exists, and keep the visual
badge rendering intact.

---

Nitpick comments:
In `@packages/ui/src/screens/design-concept-screen.tsx`:
- Around line 2681-2700: Replace the `area() as Exclude<...>` cast passed to
`ManagerBatchToolPanel` with an `isManagerBatchArea` type guard and a
corresponding `ManagerBatchArea` type derived from `ManagerArea`. Use the guard
in the rendering branch so `ManagerBatchToolPanel` receives only valid batch
areas, preserving compile-time exhaustiveness when `ManagerArea` gains new
values.
- Around line 4291-4315: Replace the nested activeView() ternary chain in the
Show fallback with a Switch/Match-based view selection or an equivalent
view-to-component map. Preserve each existing view mapping and callbacks, and
ensure the library case remains grouped as a fragment containing the inspector
and its two elements.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fe1015c2-b237-4ce5-8864-a916e8582174

📥 Commits

Reviewing files that changed from the base of the PR and between 51a701f and d96b674.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • AGENTS.md
  • DESIGN.md
  • apps/server/src/routes/__root.tsx
  • apps/server/src/routes/design-lab.tsx
  • package.json
  • packages/ui/src/alert-dialog.tsx
  • packages/ui/src/dialog.tsx
  • packages/ui/src/screens/design-concept-screen.tsx
  • packages/ui/src/toast.tsx

Comment thread apps/server/src/routes/__root.tsx
Comment thread packages/ui/src/screens/design-concept-screen.tsx
Comment thread packages/ui/src/screens/design-concept-screen.tsx
@hmjn023
hmjn023 merged commit 9214455 into develop Jul 29, 2026
1 check passed
@hmjn023
hmjn023 deleted the feat/design-system-foundation branch July 29, 2026 16:41
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