Repository navigation
Description
Context
propr-ui/src/components/Dashboard.tsx currently renders a metrics-first screen: a StatsGrid of four numbers, then TaskStatsChart, RepositoryBreakdown, TopModels, ActivitySparkline, and an embedded TaskList in a 70/30 split. It answers "how much work happened" but not "what needs my attention right now".
The specification replaces this with five sections, with live work getting most of the space:
- Summary strip — four clickable counts.
- Needs attention — what the user should do next.
- Happening now — the main operational view.
- Recent outcomes — a flat feed of meaningful results.
- Historical stats — three metrics and one compact chart.
The current top-model and repository-breakdown charts move out of the dashboard into a fuller analytics view, because "the dashboard benefits more from space for ongoing work."
This task consumes the API layer built in the previous task. It also has to get several live-update details right that the current dashboard does not handle: stable ordering while tasks run, distinguishing idle from unavailable, and showing a reconnecting state that retains the last known data.
Requirements
Summary strip
- Four compact, clickable numbers: Needs attention, Running, Queued, Completed today.
- Neutral colors for normal operation. Stronger emphasis on the attention count only when there is a problem or pending decision.
- Every number opens the corresponding filtered list.
Needs attention
- Show the three most important items, then "View all".
- Each row: reason, repository + issue/PR reference, readable title, waiting duration, one primary action.
- When empty, collapse to a quiet "Nothing needs your attention" (and on desktop, hide the panel entirely so it does not consume space).
Happening now
- Compact rows with state, repository, reference, title, elapsed time, and latest meaningful progress.
- Show five active items initially with inline expansion.
- Keep ordering stable while tasks run — rows must not jump on every update.
- Below active work, a compact queue summary with the reason for waiting when available.
- Do not display invented percentage progress and do not infer a stall from missing chat messages.
Recent outcomes
- Flat feed, last 24 hours by default with a seven-day option, eight items initially.
- Title prominent; score only when relevant with its scale labelled; optional short third line.
- Clicking a row opens the relevant task, review, or PR.
Historical stats
- Three metrics (Completed, Success rate, Spend) plus a small daily completions chart.
- Default seven days with a comparison against the preceding seven days.
- Unavailable data renders as unavailable, not as zero. Cost labelled "Recorded spend".
Layout
- Desktop: summary strip across the top; running work and recent outcomes in the main column; needs attention and historical stats in a narrower right column; empty attention panel hidden.
- Mobile: summary counts in a compact 2×2, then attention, happening now, recent outcomes, historical stats.
- Titles may wrap to two lines. Hide or relocate secondary metadata before truncating a title. A score column may align on desktop but must not reserve empty space on mobile.
Filtering and live updates
- One repository filter applying to every section, defaulting to all accessible repositories, preserved during navigation.
- Keep live sections current automatically; avoid reordering while someone is clicking or expanding a row.
- On disconnect, retain last known data and show "Reconnecting · Last updated 2 minutes ago".
- "No work running" and "Unable to load running work" must look different.
Implementation Specification
- Create
propr-ui/src/components/Dashboard/section components:SummaryStrip.tsx,NeedsAttentionPanel.tsx,HappeningNowSection.tsx,RecentOutcomesFeed.tsx,HistoricalStatsPanel.tsx. - Rewrite
propr-ui/src/components/Dashboard.tsxas the composition root holding only the repository filter, the socket subscription, and the responsive layout. - Share row styling and metadata components with the inbox, as the spec requires. Reuse
RepositoryIcon,ProviderLogo,ScoreBadge(fromTaskList/ScoreBadge.tsx), and the relative-time helpers inTaskList/utils.tsxrather than writing new ones. - Use
RepositorySelectorfor the filter and persist the selection in the URL query string so it survives navigation. - Use
useSocketfor live updates anduseLiveRefreshSchedulerto coalesce bursts, exactly asTaskList.tsxandLiveFileChips.tsxalready do. - Move
RepositoryBreakdownandTopModelsoff the dashboard into a new/analyticsroute. Do not delete the components.
Acceptance Criteria
- With zero attention items, the right-hand attention panel is absent from the desktop DOM (not merely visually hidden), and mobile shows the quiet empty line.
- With attention items present, the attention count in the summary strip uses the emphasised style; with zero, it uses the neutral style.
- Clicking each of the four summary numbers navigates to the correspondingly filtered list.
- Changing the repository filter updates all five sections and writes the selection into the URL; reloading the page restores it.
- Ten rapid task-update socket events produce a single refresh per section, verified by a test asserting the API call count.
- While a row is expanded, subsequent live updates do not reorder the list.
- With the socket disconnected, the previously loaded rows remain rendered and a "Reconnecting · Last updated …" line appears.
- An empty running list renders "No work running"; a failed running-work request renders "Unable to load running work" with a retry affordance. A test asserts these two states produce different text.
- Historical stats render "—" (or equivalent) for a null success rate rather than "0%".
- At 320px, no horizontal page overflow occurs and no empty score column is reserved.
Created by ProPR AI Planner
Activity
propr-dev commentedon Sep 23, 2026
Suggested Implementation:
Implementation Approach
This implementation splits the dashboard into five independently-fetching section components under a thin composition root, rather than keeping one large component that fetches everything.
The main reason is the spec's live-update requirements. Each section has different freshness needs — "Happening now" must update continuously while "Historical stats" is a seven-day rollup — and different failure modes. If one component owns all five fetches, a stats failure blanks the running-work list, which directly violates "Distinguish an idle system from an unavailable system." Independent sections let each own its loading, empty, and error state.
An alternative considered was a single
useDashboardDatahook returning everything. It was rejected because it forces all five sections to share one error boundary and one refresh cadence, and because it makes the "retain last known data while reconnecting" behaviour apply globally instead of per-section.For stable ordering, the approach is to sort once on first receipt and then merge updates in place by task ID, appending only genuinely new rows. Re-sorting on every socket event is what causes rows to jump; the spec calls this out explicitly. The trade-off is that a long-running row keeps its original position even if a newer task would technically sort above it — this is intentional, because predictable position beats strict ordering for a list the user is actively clicking.
For reuse, the row components deliberately import
ScoreBadge,RepositoryIcon,ProviderLogoand the time helpers fromTaskList/rather than reimplementing them, satisfying the spec's "Share row styling and metadata components with the inbox."File:
propr-ui/src/components/Dashboard/useDashboardSection.ts(new file)Why this file: Every section repeats the same lifecycle: fetch, coalesce socket-driven refreshes, keep last-known data on failure, and expose whether we are reconnecting. Extracting it once prevents five slightly-different implementations of the "retain last known data" rule, which is the behaviour most likely to be implemented inconsistently.
File:
propr-ui/src/components/Dashboard/SummaryStrip.tsx(new file)Why this file: The four counts are the first thing a user reads, and they must be clickable entry points into filtered lists. Isolating them keeps the emphasis rule ("stronger emphasis only when there is a problem") in one testable place.
File:
propr-ui/src/components/Dashboard/NeedsAttentionPanel.tsx(new file)Why this file: Attention is the highest-value section and has the strictest rule: it must never consume space when empty on desktop. Returning
nullfrom a dedicated component is the cleanest way to guarantee the panel is truly absent from the DOM rather than merely hidden with CSS.File:
propr-ui/src/components/Dashboard/HappeningNowSection.tsx(new file)Why this file: This is the largest and most behaviourally demanding section. It owns the stable-ordering rule, the expand-without-reorder rule, the queue summary, and the idle-versus-unavailable distinction — all of which need to live together because they interact.
File:
propr-ui/src/components/Dashboard/HistoricalStatsPanel.tsx(new file)Why this file: The stats section is where the "unavailable is not zero" rule matters most, because a 0% success rate and an unknown success rate look identical if implemented carelessly. Keeping it small and separate makes that rule easy to assert in a test.
File:
propr-ui/src/components/Dashboard.tsxWhy this file: This becomes a thin composition root. All fetching moved into the section components, so what remains is the shared repository filter, URL persistence, and the responsive layout described by the spec. Keeping it thin is what makes the desktop/mobile ordering difference easy to read.
File:
propr-ui/src/components/Dashboard/RecentOutcomesFeed.tsx(new file)Why this file: Outcomes are a flat feed with their own time-window control and their own score-display rule. Separating it keeps the "score only when relevant, scale labelled, no empty column on mobile" rule in one place.
File:
propr-ui/src/components/AnalyticsPage.tsx(new file)Why this file: The spec says to move the top-model and repository-breakdown charts into a fuller analytics view rather than delete them. A dedicated route preserves the existing, working components while freeing dashboard space for live work.
propr-dev commentedon Sep 23, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-52479/claude-opus-5-rebuild-the-dashboard-ui--20260923-1302-rj92478-epic-dashboard-data-2kiissue-2479-20260923-1302-claude-opus-5-rj9🔍 Track Task Execution