Skip to content

Show all new runs in a clickable list #20

Description

@williamthorsen

Problem

The Factory sidebar uses cascading <select> dropdowns (Project → Ticket → Run) to navigate runs. This requires 3 clicks to reach a run and provides no at-a-glance view of all available runs or their statuses.

Proposed solution

Add a RunList component to the sidebar that shows all runs in a flat, scrollable list sorted by most recent. Each item displays a color-coded status indicator (CGA-16 palette), is clickable to select the run for viewing, and has a dismiss (×) button. A "Clear all" button dismisses all visible runs at once.

The fetchProjects call is lifted from RunSelector to App.tsx so both components share the same ProjectIndex data. RunSelector is refactored to accept the index as a prop.

Key considerations

  • Dismiss state scope: Uses React useState (session-scoped). Dismissed runs reset on page refresh, matching "keep until manually removed" without cross-session persistence.
  • Run key uniqueness: Runs are identified by projectSlug/runId composite key.
  • RunSelector preserved: The existing cascading dropdowns remain alongside the new list. Their removal is deferred to a follow-up ticket.
  • Status indicators: Unicode symbols with CGA-16 colors — cyan (in_progress), green (completed), red (failed), yellow (needs_manual_review).

Acceptance criteria

  • Sidebar displays a flat list of all runs below the RunSelector, sorted by startedAt descending
  • Each run item shows: status indicator (color-coded), run ID, project slug / ticket ID
  • Clicking a run item selects it (loads in StatusBar + GameCanvas)
  • The currently selected run is visually highlighted (blue left border)
  • Each run item has an × button that dismisses it from the list
  • A "Clear all" button dismisses all visible runs
  • Dismissed runs do not reappear until page refresh
  • Long run IDs truncate with ellipsis
  • Empty state shows "No runs" when all runs are dismissed
  • All new code has tests; existing tests updated for refactored RunSelector
  • Typecheck, lint, and tests pass

Files

New:

  • packages/factory/src/shared/types/api.tsFlatRunInfo type
  • packages/factory/src/client/helpers/flatten-project-index.ts + tests
  • packages/factory/src/client/hooks/useDismissedRuns.ts + tests
  • packages/factory/src/client/components/RunList.tsx + CSS + tests

Modified:

  • packages/factory/src/client/App.tsx — lift fetch, wire RunList
  • packages/factory/src/client/components/RunSelector.tsx — accept index prop
  • Test files for App and RunSelector

Metadata

Metadata

Labels

featureAdded or improved external functionalityscope:factory

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions