Skip to content

[P1][bug] StatusBar.tsx is 404 LOC and the update-error overlay renders 90 LOC inline #451

Closed

Description

@EVWorth

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:

  1. Connection indicator (lines 175-216) — host/port, env badge, db badge, server version.
  2. Connection error chip (lines 218-227) — click-to-dismiss.
  3. Result error chip (lines 228-237) — expand-on-click.
  4. Warning count chip (lines 238-244).
  5. Executing spinner (lines 245-250).
  6. Result row/time summary (lines 251-254).
  7. Update-available button (lines 255-275) — with two guards (isExecuting and dirty tabs) wired inline.
  8. Manual-update-required copy button (lines 276-283).
  9. 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  # 5

Expected

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

  1. added
    audit
    severity/p1
    kind/bug
    on Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cross-cuttingauditkind/bugseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions