fix(desktop): pre-check backend updates in poller; client button first

Two follow-ups from testing the two-button bar:

- The background poller and focus handler only checked the client, so the
  backend behind-count and changelog stayed empty until the user opened the
  overlay — and the overlay's first render then hit the empty-commits fallback
  ('Improvements and fixes') instead of the real changelog. Check the backend
  alongside the client on poller start, interval, and focus so its state is
  ready before the button is clicked.
- Order the status bar client-first, backend-second.
This commit is contained in:
yoniebans 2026-06-06 21:28:39 +02:00 committed by Teknium
parent 56be1a63a3
commit cfaa46fcae
2 changed files with 8 additions and 6 deletions

View file

@ -442,8 +442,8 @@ export function useStatusbarItems({
variant: 'action' as const
})
},
...(backendVersionItem ? [backendVersionItem] : []),
clientVersionItem
clientVersionItem,
...(backendVersionItem ? [backendVersionItem] : [])
],
[
busy,

View file

@ -398,11 +398,15 @@ export function startUpdatePoller(): void {
pollerStarted = true
void checkUpdates()
void checkBackendUpdates()
void refreshDesktopVersion()
bridge.onProgress(ingestProgress)
window.addEventListener('focus', onFocus)
backgroundTimer = setInterval(() => void checkUpdates(), 30 * 60 * 1000)
backgroundTimer = setInterval(() => {
void checkUpdates()
void checkBackendUpdates()
}, 30 * 60 * 1000)
}
export function stopUpdatePoller(): void {
@ -424,8 +428,6 @@ function onFocus() {
lastFocusAt = now
void checkUpdates()
// Cheap and safe to re-read on every (throttled) focus: the user may have
// updated Hermes from another window/CLI between focuses, and About should
// catch up without forcing a restart.
void checkBackendUpdates()
void refreshDesktopVersion()
}