Skip to content

Let people dismiss the update banner - #696

Merged
micahflee merged 1 commit into
mainfrom
updates-bar-dismissable
Sep 10, 2026
Merged

micahflee merged 1 commit into
mainfrom
updates-bar-dismissable

Conversation

@micahflee

Copy link
Copy Markdown
Member

What this does

The "Cyd update available" box in the bottom-right corner had no close button. On Linux it isn't even actionable — the text just says to use your package manager — so it was permanent furniture until you upgraded.

It now has a ×. Dismissing hides it for the rest of the session, whatever it's showing, including the actionable Restart to Update state on macOS/Windows: a box the user closed stays closed. Update information is still reachable any time from the hamburger menu's Check for updates, which reports current vs latest version.

App unmounts the bar when updatesAvailable goes false, so the dismissal resets and a genuinely new update is still shown even if an earlier one was dismissed. That's intentional and commented; the hourly re-check doesn't resurrect a dismissed bar, because it leaves updatesAvailable true.

Why it moved to a component

The banner lived inline in App.vue, which has no test file — 391 lines with an onMounted doing device info, API client, sign-in state, emitter wiring and five IPC listeners. Testing one boolean there would have meant building that entire mock scaffold first.

UpdatesBar.vue is purely presentational — updateStatus and platform in, restartToUpdateClicked out — so it tests with props and no IPC. The auto-updater listeners stay in App.vue; moving those too would be a good follow-up but isn't this PR's job.

Two small things came along because the move forced them:

  • UpdateStatus moves from a local enum in App.vue to types.ts, now that two files need it.
  • TabsView's updatesAvailable prop is removed. It was declared and never read, so the banner was already the only update indicator in the UI — leaving a dead prop next to new dismissal logic invites someone to wire the two together by mistake.

Testing

  • New UpdatesBar.test.ts: dismissal hides the bar and survives a status change; the dismiss button is present in all six update statuses across all three platforms, pinning the "always dismissable" rule; Linux shows package-manager text and never a restart button; the checking/downloading/downloaded/error states render and emit correctly.
  • npm test src/renderer — 1055 pass, no type errors.
  • npm run lint — clean.

🤖 Generated with Claude Code

The "Cyd update available" box sat in the corner with no way to close
it. On Linux it isn't even actionable — it just says to use your package
manager — so it was permanent furniture until you upgraded.

Dismissing hides it for the rest of the session, whatever it's showing;
update information stays reachable from the hamburger menu's "check for
updates". App unmounts the bar when updates stop being available, so a
genuinely new update still shows even if an earlier one was dismissed.

The banner moves to its own component to make that testable without
mounting App.vue, which has no test scaffolding of its own. UpdateStatus
moves to types.ts now that two files need it. TabsView's updatesAvailable
prop, which it never read, is gone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@micahflee
micahflee force-pushed the updates-bar-dismissable branch from cd7542e to 0bbb59e Compare September 10, 2026 18:11
@micahflee
micahflee merged commit f81f1d8 into main Sep 10, 2026
1 check passed
@micahflee
micahflee deleted the updates-bar-dismissable branch September 10, 2026 18:11
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.

1 participant