Repository navigation
feat(web): improve UI design consistency and fix drilldown graph overlap - #600
Conversation
- Establish design foundation: brand color system (indigo), next/font Inter, fadeIn animation - Unify status colors across all components (approved=blue, implemented=emerald) - Add reusable UI components: Button (4 variants × 3 sizes), Card (default/hero) - Improve dashboard: hero card gradient, SVG warning icons, GitHub-linked issues - Enhance tables: sortable headers with aria-sort, zebra stripes, empty state with filter reset - Improve accessibility: aria-sort, aria-label, role="tab", aria-selected, focus-visible - Fix drilldown graph: dynamic layout to prevent issue node overlap, add missing xyflow CSS - Add 88 new tests covering all UI changes (TDD) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @kicchann's task in 1m 56s —— View job コードレビュー結果
全体的に品質の高いPRです。デザイン基盤の整備、アクセシビリティ対応、グラフの重なり修正がよく実装されています。いくつか指摘事項を挙げます。 🐛 バグ・正確性の問題1.
// 現在(誤)
<th ...>
<button aria-sort={...}>...</button> // ❌ button に aria-sort
</th>
// 正しくは
<th aria-sort={...}> // ✅ th に aria-sort
<button>...</button>
</th>2.
// 現在
<nav className="-mb-px flex space-x-8">
// 修正案
<nav className="-mb-px flex space-x-8" role="tablist">3. バージョンの辞書順ソートが正しくない
// 現在(辞書順・不正確)
case "version":
cmp = a.version.localeCompare(b.version);
break;バージョンが常に 4. ドリルダウングラフの要件ノードY座標の計算が不正確
// 現在
const lastSpecY = specYPositions.length > 0 ? specYPositions[specYPositions.length - 1] : 0;
nodes.push({ position: { x: LAYOUT.REQ_X, y: lastSpecY / 2 }, ... });
// 正確な中心を求めるなら totalHeight / 2 が適切
const totalHeight = currentY; // ループ後の currentY がグラフ全体の高さ
nodes.push({ position: { x: LAYOUT.REQ_X, y: totalHeight / 2 }, ... });
|
Replace text-only "Reqord" brand link with the logo SVG from assets/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the web UI design system (brand colors, typography, focus styles), unifies common UI components, improves dashboard UX/accessibility, and fixes drilldown graph issue-node overlap via dynamic layout.
Changes:
- Introduces brand theme colors, Inter font via
next/font, global focus-visible styling, and a fade-in transition. - Adds shared UI primitives (Card/Button) and applies consistent status colors across badges and graph nodes.
- Fixes drilldown graph overlap by dynamically computing spec/issue Y positions and adds missing
@xyflow/reactCSS import; expands a11y attributes across UI.
Reviewed changes
Copilot reviewed 44 out of 45 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/web/src/lib/drilldown-graph-data.ts | Dynamic Y positioning to avoid issue-node overlap in drilldown graphs. |
| packages/web/src/components/ui/tabs.tsx | Adds role="tab" / aria-selected to tabs. |
| packages/web/src/components/ui/nav.tsx | Refactors nav links into NAV_ITEMS and adds active styling based on pathname. |
| packages/web/src/components/ui/card.tsx | Adds a shared Card component with variants. |
| packages/web/src/components/ui/button.tsx | Adds a shared Button component with variants/sizes and focus-visible styling. |
| packages/web/src/components/ui/badge.tsx | Updates status badge colors to the unified brand palette. |
| packages/web/src/components/specification/specification-table.tsx | Improves table sorting UX/a11y, empty states, and filter controls styling. |
| packages/web/src/components/requirement/requirement-table.tsx | Mirrors spec table improvements for requirements (sorting, empty state, filters). |
| packages/web/src/components/graph/specification-node.tsx | Aligns node styling with brand palette and shows label when distinct from id. |
| packages/web/src/components/graph/requirement-node.tsx | Updates status colors and visual polish (shadow/handle colors). |
| packages/web/src/components/graph/issue-node.tsx | Updates status colors and badge styling for issue nodes. |
| packages/web/src/components/graph/edge-styles.ts | Updates edge stroke colors to the new palette. |
| packages/web/src/components/graph/drilldown-graph.tsx | Adds missing @xyflow/react stylesheet import and adjusts fit/zoom options. |
| packages/web/src/components/graph/drilldown-breadcrumb.tsx | Updates back-button hover styling to brand colors. |
| packages/web/src/components/feedback/feedback-filters.tsx | Adds friendly labels for filter types and refactors segmented-button options handling. |
| packages/web/src/components/dashboard/warning-alert.tsx | Redesigns alert presentation and adds severity icons. |
| packages/web/src/components/dashboard/status-card.tsx | Improves card styling and adds status-colored breakdown badges. |
| packages/web/src/components/dashboard/project-health.tsx | Restyles as a hero card with indigo gradient and updated score colors. |
| packages/web/src/components/dashboard/progress-bar.tsx | Updates progress bar height and transition styling. |
| packages/web/src/components/dashboard/critical-path-display.tsx | Restyles items and adds GitHub issue number linking + priority badges. |
| packages/web/src/app/specifications/loading.tsx | Improves loading skeleton to match updated filter/table layout. |
| packages/web/src/app/requirements/loading.tsx | Improves loading skeleton to match updated filter/table layout. |
| packages/web/src/app/layout.tsx | Applies Inter font via next/font/google to the app body. |
| packages/web/src/app/globals.css | Adds brand theme tokens, fade-in animation, and global focus-visible outline. |
| packages/web/src/app/dashboard/page.tsx | Reorganizes dashboard page sections into zones with updated spacing. |
| packages/web/src/tests/lib/drilldown-graph-data.test.ts | Updates/adds tests for dynamic graph layout positioning. |
| packages/web/src/tests/components/ui/tabs.test.tsx | Adds tabs accessibility tests. |
| packages/web/src/tests/components/ui/nav.test.tsx | Adds nav rendering + active state tests. |
| packages/web/src/tests/components/ui/card.test.tsx | Adds Card component tests. |
| packages/web/src/tests/components/ui/button.test.tsx | Adds Button component tests. |
| packages/web/src/tests/components/ui/badge.test.tsx | Adds badge styling tests aligned to new palette. |
| packages/web/src/tests/components/specification/specification-table.test.tsx | Adds tests for sorting a11y, filters, empty state, and header styling. |
| packages/web/src/tests/components/requirement/requirement-table.test.tsx | Adds tests for sorting a11y, filters, empty state, and header styling. |
| packages/web/src/tests/components/graph/specification-node.test.tsx | Updates tests for new spec node styling and label rendering. |
| packages/web/src/tests/components/graph/requirement-node.test.tsx | Adds tests for brand color system and updated visuals. |
| packages/web/src/tests/components/graph/issue-node.test.tsx | Updates tests for issue node palette and badge styling. |
| packages/web/src/tests/components/graph/edge-styles.test.ts | Updates tests for new edge stroke colors. |
| packages/web/src/tests/components/graph/drilldown-breadcrumb.test.tsx | Adds test for brand hover styles on back button. |
| packages/web/src/tests/components/feedback/feedback-filters-improved.test.tsx | Adds tests for shortened filter labels and padding changes. |
| packages/web/src/tests/components/dashboard/warning-alert.test.tsx | Updates tests for new warning alert presentation. |
| packages/web/src/tests/components/dashboard/status-card.test.tsx | Adds tests for new status-card styling and badge classes. |
| packages/web/src/tests/components/dashboard/project-health.test.tsx | Updates tests for new hero styling and updated score colors. |
| packages/web/src/tests/components/dashboard/progress-bar.test.tsx | Adds tests for new progress-bar track/fill styling. |
| packages/web/src/tests/components/dashboard/critical-path-display.test.tsx | Adds tests for GitHub link rendering and priority badge styling. |
Comments suppressed due to low confidence (2)
packages/web/src/lib/drilldown-graph-data.ts:83
- Task-to-spec lookups are computed by filtering
tasksmultiple times (once per spec forspecTaskCounts, and again per spec forspecTasks). This is O(specs*tasks) twice and can get slow as task counts grow. Consider building a map fromspecId -> tasks[]in a single pass and reuse it for both counts and node generation.
packages/web/src/components/ui/tabs.tsx:36 - The markup is mixing a
navwithrole="tab"buttons, but it’s missing the required tablist semantics (role="tablist") and tab keyboard behavior (arrow keys), plus there are noid/aria-controlsrelationships to associated panels. Either implement the full ARIA Tabs pattern (tablist + tabs + panels) or droprole="tab"and keep these as regular buttons/links.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| <th | ||
| key={column} | ||
| className="cursor-pointer px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 hover:text-gray-900" | ||
| onClick={() => handleSort(column)} | ||
| className="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500" | ||
| > | ||
| {label}{arrow} | ||
| <button | ||
| type="button" | ||
| onClick={() => handleSort(column)} | ||
| className={`inline-flex items-center gap-1 transition-colors ${ | ||
| isActive ? "text-brand-600" : "hover:text-gray-900" | ||
| }`} | ||
| aria-sort={isActive ? (sortDir === "asc" ? "ascending" : "descending") : undefined} | ||
| > |
There was a problem hiding this comment.
aria-sort is being applied to the inner <button>, but per WAI-ARIA the attribute is intended for the column header element (e.g. the <th> with role="columnheader"). Screen readers may ignore aria-sort on a button. Move aria-sort onto the <th> (and consider scope="col"), and keep the button purely for the click target (optionally add an aria-label that includes current sort direction).
There was a problem hiding this comment.
Fixed in 059959c — moved aria-sort to <th> with scope="col", button now only handles click.
| const PRIORITY_BADGE_CLASSES: Record<string, string> = { | ||
| high: "bg-red-100 text-red-800", | ||
| medium: "bg-orange-100 text-orange-800", | ||
| low: "bg-gray-100 text-gray-800", | ||
| }; |
There was a problem hiding this comment.
CriticalPathItem.priority is populated from task.priority (e.g. "P0"/"P1"/"P2"/"P3" in TaskEntrySchema), but PRIORITY_BADGE_CLASSES only handles "high"/"medium"/"low". This means real data will fall back to the gray default. Update the mapping (or normalize priority values in extractCriticalPath) so the badge colors match the actual priority values used in the data model.
There was a problem hiding this comment.
Fixed in 059959c — updated PRIORITY_BADGE_CLASSES to map P0/P1/P2/P3 instead of high/medium/low.
| {label} | ||
| <span className={`text-[10px] ${isActive ? "opacity-100" : "opacity-30"}`}> | ||
| {isActive && sortDir === "desc" ? "▼" : "▲"} | ||
| </span> |
There was a problem hiding this comment.
The sort indicator characters (▲/▼) are part of the button text and may be announced by screen readers as “black up-pointing triangle”, etc. Consider marking the indicator <span> as aria-hidden="true" (and/or providing a clearer aria-label that includes sort direction) so the accessible name stays clean.
There was a problem hiding this comment.
Fixed in 059959c — added aria-hidden="true" to the sort indicator <span>.
| <th | ||
| key={column} | ||
| className="cursor-pointer px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 hover:text-gray-900" | ||
| onClick={() => handleSort(column)} | ||
| className="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500" | ||
| > | ||
| {label}{arrow} | ||
| <button | ||
| type="button" | ||
| onClick={() => handleSort(column)} | ||
| className={`inline-flex items-center gap-1 transition-colors ${ | ||
| isActive ? "text-brand-600" : "hover:text-gray-900" | ||
| }`} | ||
| aria-sort={isActive ? (sortDir === "asc" ? "ascending" : "descending") : undefined} | ||
| > |
There was a problem hiding this comment.
aria-sort is set on the <button> inside the table header, but assistive tech expects aria-sort on the header cell (<th> / role="columnheader"). Move aria-sort to the <th> (and consider scope="col") so sorting state is announced reliably.
There was a problem hiding this comment.
Fixed in 059959c — same fix as requirement-table: moved aria-sort to <th> with scope="col".
| </Link> | ||
| <div className="flex gap-4"> | ||
| <Link | ||
| href="/dashboard" | ||
| className="text-sm font-medium text-gray-600 hover:text-gray-900" | ||
| > | ||
| Dashboard | ||
| </Link> | ||
| <Link | ||
| href="/requirements" | ||
| className="text-sm font-medium text-gray-600 hover:text-gray-900" | ||
| > | ||
| Requirements | ||
| </Link> | ||
| <Link | ||
| href="/specifications" | ||
| className="text-sm font-medium text-gray-600 hover:text-gray-900" | ||
| > | ||
| Specifications | ||
| </Link> | ||
| <Link | ||
| href="/feedback" | ||
| className="text-sm font-medium text-gray-600 hover:text-gray-900" | ||
| > | ||
| Feedback | ||
| </Link> | ||
| <Link | ||
| href="/graph" | ||
| className="text-sm font-medium text-gray-600 hover:text-gray-900" | ||
| > | ||
| Graph | ||
| </Link> | ||
| <div className="flex gap-1"> | ||
| {NAV_ITEMS.map(({ href, label }) => { | ||
| const isActive = | ||
| pathname === href || pathname.startsWith(href + "/"); | ||
| return ( | ||
| <Link | ||
| key={href} | ||
| href={href} | ||
| className={`rounded-md px-3 py-2 text-sm font-medium transition-colors ${ | ||
| isActive | ||
| ? "bg-brand-50 text-brand-700" | ||
| : "text-gray-600 hover:bg-gray-100 hover:text-gray-900" | ||
| }`} |
There was a problem hiding this comment.
The active nav link is styled visually, but there is no semantic indicator for assistive tech. Add aria-current="page" (or aria-current={isActive ? "page" : undefined}) to the active <Link> so screen readers can announce the current page.
There was a problem hiding this comment.
Fixed in 059959c — added aria-current={isActive ? "page" : undefined} to active nav links.
| <a | ||
| href={`https://github.com/kicchann/reqord/issues/${item.issueNumber}`} | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| className="text-sm font-medium text-blue-600 hover:underline" | ||
| > | ||
| #{item.issueNumber} | ||
| </a> |
There was a problem hiding this comment.
The GitHub link is hard-coded to https://github.com/kicchann/reqord/issues/..., but CriticalPathItem already includes a url field. Using a hard-coded repo can produce incorrect links in other environments (forks, different org/repo). Prefer href={item.url} (optionally validate/fallback when missing).
There was a problem hiding this comment.
Fixed in 059959c — now uses item.url from the data model instead of hardcoded URL.
| return ( | ||
| <button | ||
| className={`inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none disabled:opacity-50 ${variantClasses[variant]} ${sizeClasses[size]} ${className}`} | ||
| {...props} | ||
| > |
There was a problem hiding this comment.
This shared Button component doesn’t set a default type. In HTML the default is submit, which can cause accidental form submissions when the button is used inside a <form>. Consider defaulting type to "button" unless the caller explicitly passes type.
There was a problem hiding this comment.
Fixed in 059959c — added type="button" as default before the spread {...props}, so callers can still override to type="submit" when needed.
| from { opacity: 0; transform: translateY(8px); } | ||
| to { opacity: 1; transform: translateY(0); } | ||
| } | ||
|
|
There was a problem hiding this comment.
The global fadeIn animation is applied to all direct children of <main>, but it doesn’t respect users who prefer reduced motion. Add a @media (prefers-reduced-motion: reduce) override to disable the animation (and potentially the transform) for accessibility.
| @media (prefers-reduced-motion: reduce) { | |
| main > * { | |
| animation: none; | |
| } | |
| } |
There was a problem hiding this comment.
Fixed in 059959c — added @media (prefers-reduced-motion: reduce) block to disable the animation.
| <button | ||
| key={opt} | ||
| onClick={() => onChange(opt)} | ||
| aria-label={`${label} ${opt}`} | ||
| aria-pressed={value === opt} | ||
| className={`rounded-md px-2.5 py-1 text-xs font-medium transition-colors ${ | ||
| value === opt | ||
| key={opt.value} | ||
| onClick={() => onChange(opt.value)} | ||
| aria-label={`${label} ${opt.value}`} | ||
| aria-pressed={value === opt.value} | ||
| className={`rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${ | ||
| value === opt.value | ||
| ? "bg-blue-600 text-white" | ||
| : "bg-gray-100 text-gray-600 hover:bg-gray-200" | ||
| }`} | ||
| data-testid={`filter-${label.toLowerCase()}-${opt}`} | ||
| data-testid={`filter-${label.toLowerCase()}-${opt.value}`} | ||
| > | ||
| {opt} | ||
| {opt.label} | ||
| </button> |
There was a problem hiding this comment.
aria-label for each segmented button uses opt.value (e.g. "requirement-gap") even when the visible label is a friendlier opt.label (e.g. "Req Gap"). This can cause screen readers to announce the less readable internal value. Prefer basing the accessible name on opt.label (or omit aria-label and rely on the visible text).
There was a problem hiding this comment.
Fixed in 059959c — changed from opt.value to opt.label for the aria-label.
| {label} | ||
| <span className={`text-[10px] ${isActive ? "opacity-100" : "opacity-30"}`}> | ||
| {isActive && sortDir === "desc" ? "▼" : "▲"} | ||
| </span> | ||
| </button> |
There was a problem hiding this comment.
The ▲/▼ sort glyph is included in the button’s accessible name and may be read out by screen readers. Consider aria-hidden="true" on the indicator <span> (and/or an explicit aria-label including sort direction) to avoid noisy announcements.
There was a problem hiding this comment.
Fixed in 059959c — added aria-hidden="true" to sort indicator glyphs in both tables.
Logo uses warm cream (#f5f2ed) + red accent (#ff3b2f), but UI was using cool indigo. Switch brand palette to red-600 (#DC2626) base to match the logo's design language. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The logo uses warm cream (#f5f2ed) with a small red accent dot (#ff3b2f). Redesign the entire color system to match: - Background: warm cream (warm-50/warm-100) instead of cool gray - Nav bar: warm-100 background matching the logo's cream - Brand colors: warm neutrals (#4A3F35 base) for primary UI elements - Red accent: used only as small indicator (accent bar, danger button) - Project Health: cream card with red accent line, not a red block - All components updated to use warm-* tokens Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tton type) - Move aria-sort from <button> to <th> per WAI-ARIA spec (requirement-table, specification-table) - Add aria-hidden="true" to sort indicator glyphs (▲/▼) - Fix PRIORITY_BADGE_CLASSES to use actual data values (P0/P1/P2/P3 instead of high/medium/low) - Use item.url instead of hardcoded GitHub URL in critical-path-display - Default Button type to "button" to prevent accidental form submissions - Add @media (prefers-reduced-motion: reduce) for fadeIn animation - Add aria-current="page" to active nav link - Use opt.label instead of opt.value for feedback filter aria-label Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@copilot Thanks for the thorough review! All 8 actionable comments have been addressed in 059959c:
Intentionally deferred (low-confidence suggestions):
|
|
@claude 詳細なレビューありがとうございます!8件の指摘について対応状況をまとめます。 ✅ 対応済み(059959c)
🔄 延期(別タスクで対応予定)
良い点として挙げていただいた |
|
Claude finished @kicchann's task in 45s —— View job レビューフォローアップ確認
対応状況を確認しました。 ✅ 対応済み修正の確認(059959c)コードを直接確認した結果、すべて正しく実装されています:
🔄 延期項目への所見延期の判断はいずれも妥当です:
このPRは品質の高い実装になっています。マージに問題はありません。 |
- Remove eslint-disable comment for undefined @next/next/no-img-element rule - Fix Requirement test mock: use FormatSchema union, add files field, remove nonexistent flags - Fix Specification test mock: add files field, remove nonexistent flags Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Test plan
pnpm testでフルスイート確認済/graph?req=req-000023のissueノード重なり解消を目視確認🤖 Generated with Claude Code