Skip to content

refactor(status-bar): move the update-error panel out of the strip - #610

Merged
EVWorth merged 1 commit into
mainfrom
refactor/statusbar-update-overlay
Sep 10, 2026
Merged

EVWorth merged 1 commit into
mainfrom
refactor/statusbar-update-overlay

Conversation

@EVWorth

@EVWorth EVWorth commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Closes #451.

StatusBar carried ninety lines of inline JSX for the update-failure panel, plus its own state, ref, click-outside effect, diagnostic assembly and two handlers — in a component meant to show indicators. None of it was shared with the rest of the bar.

UpdateErrorDetails owns all of it. StatusBar drops 506 → 383 lines and loses two useState, one useRef and two useEffect.

One thing the tests caught, and I had wrong

I removed StatusBar's "close the panel when the status leaves error" effect, on the reasoning that the extracted component returns null and therefore unmounts. It doesn't. React keeps the instance and its state while the element stays in the same position, so the panel would have come back open on the next failure.

I'd already written a comment asserting the wrong thing before the test disagreed with me. The reset is still needed — it now lives with the state it resets, which is where it belonged.

Unchanged on purpose

The diagnostic is still built on render rather than memoised: it carries a timestamp, and one frozen at mount would report when the app started rather than when the user copied it.

Verification

12 new tests. Unit 2014, browser 300, 0 lint errors.

StatusBar carried ninety lines of inline JSX for the update-failure panel,
plus its own state, ref, click-outside effect, diagnostic assembly and two
handlers — in a component meant to show indicators (#451). None of it was
shared with the rest of the bar.

UpdateErrorDetails owns all of it. StatusBar drops from 506 lines to 383,
and loses two useState, one useRef and two useEffect calls.

One thing the tests caught, worth stating because I had it wrong in a
comment before the test disagreed: an early `return null` does not unmount a
component. React keeps the instance and its state while the element stays in
the same position, so the panel would have come back open on the next
failure. The reset StatusBar used to own is still needed — it now lives with
the state it resets, which is where it belonged.

The diagnostic is still built on render rather than memoised. It carries a
timestamp, and one frozen at mount would report when the app started rather
than when the user copied it.

Closes #451

Co-Authored-By: Claude Opus 5 <[email protected]>
@EVWorth
EVWorth merged commit d1cc604 into main Sep 10, 2026
12 checks passed
@EVWorth
EVWorth deleted the refactor/statusbar-update-overlay branch September 10, 2026 03:53
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.

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

1 participant