Repository navigation
Description
Context
StatusBar is the bottom indicator strip. It should be a thin strip of indicators; in practice it carries 9 distinct concerns.
Problem
src/components/layout/StatusBar.tsx is 404 LOC with 6 useState calls and 5 useEffect calls. Nine concerns mashed together:
- Connection indicator (lines 175-216) — host/port, env badge, db badge, server version.
- Connection error chip (lines 218-227) — click-to-dismiss.
- Result error chip (lines 228-237) — expand-on-click.
- Warning count chip (lines 238-244).
- Executing spinner (lines 245-250).
- Result row/time summary (lines 251-254).
- Update-available button (lines 255-275) — with two guards (
isExecutingand dirty tabs) wired inline. - Manual-update-required copy button (lines 276-283).
- Update-error overlay (lines 308-389) — 90 LOC inline JSX including:
- Its own click-outside handler (lines 88-95).
- 3 separate "copied" flags:
copied,copiedDiagnostic,copiedCommand(lines 62-64). - Issue-report URL builder (
handleReportIssue, lines 147-159) — hardcodes the GitHub repo URL. - Retry button (lines 372-380).
The hardcoded repo URL is already flagged separately as #345, but here the concern is that the entire URL builder is buried in the StatusBar. Refactoring is the cleanup.
The cross-cutting audit (docs/audits/cross-cutting.md F6) flagged this as P1.
Files
- src/components/layout/StatusBar.tsx:1-404
Repro
wc -l src/components/layout/StatusBar.tsx # 404
grep -c "useState" src/components/layout/StatusBar.tsx # 6
grep -c "useEffect" src/components/layout/StatusBar.tsx # 5Expected
StatusBar is < 120 LOC and is purely an indicator strip. Each sub-indicator (<ConnectionIndicator />, <UpdateIndicator /> with <UpdateErrorOverlay /> as a portal-based component, <ExecutionStatus />) is independently testable. The hardcoded GitHub repo URL is a config constant.
Proposed fix
Scope M. Split into:
<ConnectionIndicator />— host, env, db, version.<ExecutionStatus />— error/warn/executing/row-time.<UpdateIndicator />— available/manual-required/checking/downloading/error chip + Retry.<UpdateErrorOverlay />— portal-based, owns its own click-outside + copy flags.- The hardcoded repo URL moves to
src/lib/app-meta.ts(a tiny constants file).
Each component subscribes narrowly to its own slice of stores (see #451 / F13 for the selector concern).
Acceptance
StatusBar.tsx is < 120 LOC and is purely a layout component. Each sub-indicator has its own test file ≥ 30 LOC. The GitHub repo URL appears once in the codebase.
Needs human verify
No (refactor only).
Labels: audit, area/cross-cutting, severity/p1, kind/bug
Activity