Skip to content

refactor(dashboard): group run components under components/run/#62

Merged
joefairburn merged 1 commit into
mainfrom
refactor/run-components-folder
Jul 22, 2026
Merged

refactor(dashboard): group run components under components/run/#62
joefairburn merged 1 commit into
mainfrom
refactor/run-components-folder

Conversation

@joefairburn

@joefairburn joefairburn commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

Pure file-reorganization refactor. Moves + import-specifier updates only —
no logic changes. Follows the playbook established by #61
(lib/github-* -> lib/github/), and the existing components/ subfolder
convention (analytics/, monitors/, settings/, ui/).

File mapping

All paths relative to apps/dashboard/src/components/:

Old New
run-detail-live.tsx run/detail-live.tsx
run-history-bar-hover.tsx run/history-bar-hover.tsx
run-history-branch-filter.shared.ts run/history-branch-filter.shared.ts
run-history-branch-filter.tsx run/history-branch-filter.tsx
run-history-chart.tsx run/history-chart.tsx
run-list-row.tsx run/list-row.tsx
run-meta-pills.tsx run/meta-pills.tsx
run-progress-group.tsx run/progress-group.tsx
run-progress-row.tsx run/progress-row.tsx
run-progress-skeletons.tsx run/progress-skeletons.tsx
run-progress.tsx run/progress.tsx
run-summary-live.tsx run/summary-live.tsx
run-tests-popover.tsx run/tests-popover.tsx
runs-filter-bar.tsx run/filter-bar.tsx

running-spinner.tsx was not moved — it only shares the run prefix and
is an unrelated generic primitive. No index.ts barrel was added, matching
sibling subfolders. No test files were renamed.

Every git mv shows as a 98-100% similarity rename. All non-moved-file
changes are one-line @/components/run-<name> -> @/components/run/<name>
(or runs-filter-bar -> run/filter-bar) specifier rewrites, including a
handful of doc-comment references to the old filenames (meta-pills.tsx,
use-run-summary.ts, status-registry.workers.test.ts, the runs list page,
and a Playwright spec). docs/worklog/ and the historical HTML review under
docs/reviews/ were intentionally left untouched as point-in-time records.

Verification

  • grep -rn '@/components/run-\|@/components/runs-' --include='*.ts' --include='*.tsx' . -> zero remaining hits (repo-wide, excluding historical docs/worklog/).
  • apps/dashboard/src/components/running-spinner.tsx confirmed intact and unmoved.
  • pnpm test (repo root): dashboard vitest lane 1 — 63 files passed, 1 skipped; 619 tests passed, 4 skipped. Dashboard workers lane — 116 files passed; 1360 tests passed. Reporter — 17 files passed; 300 tests passed.
  • pnpm check (repo root) exits 0 when scoped to apps + packages: 0 errors, 141 pre-existing warnings in untouched files (matches expected baseline). The unscoped root pnpm check surfaced one unrelated formatting issue from a concurrent sibling agent's in-progress, uncommitted work under .claude/worktrees/ (a separate parallel refactor branch) — not part of this diff.
  • Pre-commit hook (vp check --fix) ran clean on commit, no additional changes needed.

Notes for reviewers

  • Open PR Cross-run failure clustering on persisted error signatures #59 touches run-progress-row.tsx; git rename detection should
    auto-resolve the rebase (trivial, since this PR makes no logic changes to
    that file's contents).
  • A companion PR regrouping src/lib/ run/db/artifact/hook modules is in
    flight in parallel. Its import rewrites touch the contents of these moved
    components, so whichever of the two PRs merges second will need a trivial
    rebase.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Run details now update live with current status, duration, test counts, and outcome summaries.
    • Added search, status, branch, author, environment, origin, and date filters for runs.
    • Added test previews from run summary counts, including loading, error, and empty states.
    • Added contextual hover details for run-history bars.
    • Improved loading placeholders for grouped test progress lists.
  • Refactor
    • Updated dashboard components and pages to use the reorganized run interface without changing existing behavior.

Pure move: git mv the fourteen run-*/runs-* components in
apps/dashboard/src/components/ into src/components/run/ (dropping the
redundant filename prefix, following the existing analytics/ / monitors/ /
settings/ / ui/ convention) and rewrite the @/components/run-<name> and
@/components/runs-filter-bar specifiers to @/components/run/<name>. No logic
changes.

running-spinner.tsx is deliberately excluded: it only shares the "run"
prefix and is a generic primitive unrelated to this component family. No
index.ts barrel was added, matching the sibling subfolders. Doc-comment
references to the old filenames (in meta-pills.tsx, use-run-summary.ts,
status-registry.workers.test.ts, the runs page, and a Playwright spec) were
updated to match; docs/worklog/ and the historical HTML review under
docs/reviews/ were left untouched as point-in-time records.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9cf90389-231c-473d-a83c-47a348706c52

📥 Commits

Reviewing files that changed from the base of the PR and between 482ba9b and 255df61.

📒 Files selected for processing (33)
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/flaky.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/run-duration.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/slowest-tests.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/suite-size.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/monitors/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/monitors/monitors-list.client.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/index.server.ts
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/tests/[testResultId]/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/tests.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/tests/[testId]/index.tsx
  • apps/dashboard/src/__tests__/parse-branch-param.workers.test.ts
  • apps/dashboard/src/__tests__/status-registry.workers.test.ts
  • apps/dashboard/src/components/run/detail-live.tsx
  • apps/dashboard/src/components/run/filter-bar.tsx
  • apps/dashboard/src/components/run/history-bar-hover.tsx
  • apps/dashboard/src/components/run/history-branch-filter.shared.ts
  • apps/dashboard/src/components/run/history-branch-filter.tsx
  • apps/dashboard/src/components/run/history-chart.tsx
  • apps/dashboard/src/components/run/list-row.tsx
  • apps/dashboard/src/components/run/meta-pills.tsx
  • apps/dashboard/src/components/run/progress-group.tsx
  • apps/dashboard/src/components/run/progress-row.tsx
  • apps/dashboard/src/components/run/progress-skeletons.tsx
  • apps/dashboard/src/components/run/progress.tsx
  • apps/dashboard/src/components/run/summary-live.tsx
  • apps/dashboard/src/components/run/tests-popover.tsx
  • apps/dashboard/src/lib/analytics/params.ts
  • apps/dashboard/src/lib/test-history-view.ts
  • apps/dashboard/src/realtime/use-run-summary.ts
  • packages/e2e/tests-dashboard/test-replay.spec.ts

📝 Walkthrough

Walkthrough

The dashboard adds run filtering, live run-detail rendering, history hover summaries, and test-preview popovers. Existing pages, utilities, tests, and components are migrated to the components/run module layout.

Changes

Run dashboard updates

Layer / File(s) Summary
Runs filtering and branch parameters
apps/dashboard/src/components/run/filter-bar.tsx, apps/dashboard/src/components/run/history-branch-filter.shared.ts, apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/index.tsx
Adds URL-synchronized search, status, branch, author, environment, origin, and date filters, plus shared branch-query parsing.
Live run detail and progress UI
apps/dashboard/src/components/run/detail-live.tsx, apps/dashboard/src/components/run/summary-live.tsx, apps/dashboard/src/components/run/progress*.tsx, apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/index.tsx
Adds streamed run status, duration, test counts, outcome summaries, progress rows, and loading skeletons.
History hover and test previews
apps/dashboard/src/components/run/history-bar-hover.tsx, apps/dashboard/src/components/run/tests-popover.tsx, apps/dashboard/src/components/run/history-chart.tsx, apps/dashboard/src/components/run/list-row.tsx
Adds query-backed history tooltips and test-preview popovers with loading, error, empty, and populated states.
Dashboard consumer migration
apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/**, apps/dashboard/src/lib/**, apps/dashboard/src/__tests__/**, packages/e2e/tests-dashboard/test-replay.spec.ts
Updates imports and source-path comments to the components/run module structure without changing existing consumer logic.

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

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant RunsFilterBar
  participant Router
  participant RunsPage
  User->>RunsFilterBar: change search or filter
  RunsFilterBar->>Router: replace URL query parameters
  Router->>RunsPage: load filtered runs
Loading
sequenceDiagram
  participant RunDetailPage
  participant useRunSummary
  participant currentSummary
  participant LiveHeader
  RunDetailPage->>useRunSummary: subscribe to run progress
  useRunSummary->>currentSummary: merge streamed data with initial summary
  currentSummary->>LiveHeader: render current status, duration, count, and outcomes
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.50% 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 The title clearly matches the main change: reorganizing dashboard run components under components/run/ and removing old run-/runs- prefixes.
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/run-components-folder

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
wrightful 255df61 Jul 22 2026, 10:24 AM

@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: 1

🧹 Nitpick comments (1)
apps/dashboard/src/components/run/filter-bar.tsx (1)

44-58: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Locally redeclared NavigateFn type duplicates useNavigate's options type.

NavigateFn/its inline options shape mirrors the NavigateOptions type already defined for useNavigate in @/lib/navigate. Importing/reusing the shared type instead of re-declaring it here would avoid drift if the navigate options shape changes.

🤖 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 `@apps/dashboard/src/components/run/filter-bar.tsx` around lines 44 - 58,
Remove the local NavigateFn declaration and reuse the shared navigate
function/options type exported by "`@/lib/navigate`" in applyFilters. Update the
relevant import and preserve the existing navigation behavior and history:
"replace" option.
🤖 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/dashboard/src/components/run/tests-popover.tsx`:
- Around line 73-80: Update the PopoverTrigger rendering the test count to
include a descriptive accessible name that conveys the action and status, such
as “Show 3 failed tests,” while preserving the visible count and existing
prefetch behavior.

---

Nitpick comments:
In `@apps/dashboard/src/components/run/filter-bar.tsx`:
- Around line 44-58: Remove the local NavigateFn declaration and reuse the
shared navigate function/options type exported by "`@/lib/navigate`" in
applyFilters. Update the relevant import and preserve the existing navigation
behavior and history: "replace" option.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9cf90389-231c-473d-a83c-47a348706c52

📥 Commits

Reviewing files that changed from the base of the PR and between 482ba9b and 255df61.

📒 Files selected for processing (33)
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/flaky.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/run-duration.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/slowest-tests.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/suite-size.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/monitors/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/monitors/monitors-list.client.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/index.server.ts
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/tests/[testResultId]/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/tests.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/tests/[testId]/index.tsx
  • apps/dashboard/src/__tests__/parse-branch-param.workers.test.ts
  • apps/dashboard/src/__tests__/status-registry.workers.test.ts
  • apps/dashboard/src/components/run/detail-live.tsx
  • apps/dashboard/src/components/run/filter-bar.tsx
  • apps/dashboard/src/components/run/history-bar-hover.tsx
  • apps/dashboard/src/components/run/history-branch-filter.shared.ts
  • apps/dashboard/src/components/run/history-branch-filter.tsx
  • apps/dashboard/src/components/run/history-chart.tsx
  • apps/dashboard/src/components/run/list-row.tsx
  • apps/dashboard/src/components/run/meta-pills.tsx
  • apps/dashboard/src/components/run/progress-group.tsx
  • apps/dashboard/src/components/run/progress-row.tsx
  • apps/dashboard/src/components/run/progress-skeletons.tsx
  • apps/dashboard/src/components/run/progress.tsx
  • apps/dashboard/src/components/run/summary-live.tsx
  • apps/dashboard/src/components/run/tests-popover.tsx
  • apps/dashboard/src/lib/analytics/params.ts
  • apps/dashboard/src/lib/test-history-view.ts
  • apps/dashboard/src/realtime/use-run-summary.ts
  • packages/e2e/tests-dashboard/test-replay.spec.ts

@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.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/dashboard/src/components/run/filter-bar.tsx (1)

44-58: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Locally redeclared NavigateFn type duplicates useNavigate's options type.

NavigateFn/its inline options shape mirrors the NavigateOptions type already defined for useNavigate in @/lib/navigate. Importing/reusing the shared type instead of re-declaring it here would avoid drift if the navigate options shape changes.

🤖 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 `@apps/dashboard/src/components/run/filter-bar.tsx` around lines 44 - 58,
Remove the local NavigateFn declaration and reuse the shared navigate
function/options type exported by "`@/lib/navigate`" in applyFilters. Update the
relevant import and preserve the existing navigation behavior and history:
"replace" option.
🤖 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/dashboard/src/components/run/tests-popover.tsx`:
- Around line 73-80: Update the PopoverTrigger rendering the test count to
include a descriptive accessible name that conveys the action and status, such
as “Show 3 failed tests,” while preserving the visible count and existing
prefetch behavior.

---

Nitpick comments:
In `@apps/dashboard/src/components/run/filter-bar.tsx`:
- Around line 44-58: Remove the local NavigateFn declaration and reuse the
shared navigate function/options type exported by "`@/lib/navigate`" in
applyFilters. Update the relevant import and preserve the existing navigation
behavior and history: "replace" option.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9cf90389-231c-473d-a83c-47a348706c52

📥 Commits

Reviewing files that changed from the base of the PR and between 482ba9b and 255df61.

📒 Files selected for processing (33)
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/flaky.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/run-duration.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/slowest-tests.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/suite-size.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/monitors/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/monitors/monitors-list.client.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/index.server.ts
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/tests/[testResultId]/index.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/tests.tsx
  • apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/tests/[testId]/index.tsx
  • apps/dashboard/src/__tests__/parse-branch-param.workers.test.ts
  • apps/dashboard/src/__tests__/status-registry.workers.test.ts
  • apps/dashboard/src/components/run/detail-live.tsx
  • apps/dashboard/src/components/run/filter-bar.tsx
  • apps/dashboard/src/components/run/history-bar-hover.tsx
  • apps/dashboard/src/components/run/history-branch-filter.shared.ts
  • apps/dashboard/src/components/run/history-branch-filter.tsx
  • apps/dashboard/src/components/run/history-chart.tsx
  • apps/dashboard/src/components/run/list-row.tsx
  • apps/dashboard/src/components/run/meta-pills.tsx
  • apps/dashboard/src/components/run/progress-group.tsx
  • apps/dashboard/src/components/run/progress-row.tsx
  • apps/dashboard/src/components/run/progress-skeletons.tsx
  • apps/dashboard/src/components/run/progress.tsx
  • apps/dashboard/src/components/run/summary-live.tsx
  • apps/dashboard/src/components/run/tests-popover.tsx
  • apps/dashboard/src/lib/analytics/params.ts
  • apps/dashboard/src/lib/test-history-view.ts
  • apps/dashboard/src/realtime/use-run-summary.ts
  • packages/e2e/tests-dashboard/test-replay.spec.ts
🛑 Comments failed to post (1)
apps/dashboard/src/components/run/tests-popover.tsx (1)

73-80: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Give the count trigger a descriptive accessible name.

It is currently announced only as the number. Include the status and action, e.g. “Show 3 failed tests.”

Proposed fix
       <PopoverTrigger
+        aria-label={`Show ${count} ${variantLabel(variant)} tests`}
         className={TRIGGER_CLASS}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

      <PopoverTrigger
        aria-label={`Show ${count} ${variantLabel(variant)} tests`}
        className={TRIGGER_CLASS}
        onFocus={prefetch}
        onPointerEnter={prefetch}
        style={{ color: statusToken(variant) }}
      >
        {count}
      </PopoverTrigger>
🤖 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 `@apps/dashboard/src/components/run/tests-popover.tsx` around lines 73 - 80,
Update the PopoverTrigger rendering the test count to include a descriptive
accessible name that conveys the action and status, such as “Show 3 failed
tests,” while preserving the visible count and existing prefetch behavior.

@joefairburn
joefairburn merged commit 56ab7b6 into main Jul 22, 2026
18 checks passed
@joefairburn
joefairburn deleted the refactor/run-components-folder branch July 22, 2026 12:38
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