PR #10219 review: update button in the new shell's title bar

PR #10219 · Review workspace · author AviPeltz · reviewed at 5350473

Summary

The PR replaces the new shell's navigation-rail update icon with a fixed-width (76×24px) update button at the end of the title bar's left control group. It has ready, downloading and installing states (with a dithered canvas fill), plus updated and error states. The update state machine moves out of UpdatesPill into a shared renderer/hooks/useUpdateControl hook. It also fixes two right-pane title-bar bugs: the tab bar's minimum width no longer flips by 40px when the add button moves in or out of the scroller, and the side slot lays out at the pane's resting width while SidebarSlide animates.

Verdict

minor issues The approach is sound, CI is green, and every update-button state works in the real app. The remaining issues are an i18n rule miss, a weaker error affordance, one component moved without a second user, a fragile DOM lookup, and no tests for the extracted logic.

Findings

minorapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TitleBar/components/UpdateButton/UpdateButton.tsx:36
The download label is built as `${Math.floor(percent)}%`. AGENTS.md says numbers go through @superset/i18n/format, and some locales format percent differently (for example 41 % in fr/de, %41 in tr).
Fix: formatPercent(Math.floor(percent) / 100, { maximumFractionDigits: 0 }).
minorUpdateButton.tsx:48 and :63
In the error state the tooltip and aria-label show only the raw error, for example "Simulated error for testing" (see screenshot). The old pill showed "<error>. Click to retry". Because aria-label replaces the visible text, a screen reader never hears "Retry". In the downloading state it never hears the percent either.
Fix: make the error hint t`${error}. Click to retry`. Keep the visible label in the accessible name: drop aria-label and use aria-describedby or title for the hint.
minorapps/desktop/src/renderer/components/DownloadRing/DownloadRing.tsx
DownloadRing is promoted to the shared renderer/components/, but only UpdatesPill imports it. UpdateButton uses DitherFill instead. This breaks the co-location rule in AGENTS.md. The PR description says both controls use it, which is true only of PreUpdateConfirmPopover.
Fix: leave DownloadRing under components/UpdatesPill/components/DownloadRing/.
minorapps/desktop/src/renderer/routes/_authenticated/_dashboard/providers/TitleBarSlotsProvider/TitleBarSlotsProvider.tsx:125
pane.firstElementChild?.firstElementChild depends on the exact element nesting inside SidebarSlide, which is in another file. If someone adds a wrapper there, the code still compiles but measures the wrong element, and the close bug comes back silently. Also, during an expand or restore move, contentWidth is "100%" (SidebarSlide.tsx:100), so the "resting" width follows the animating width. The PR lists that path as not checked.
Fix: have SidebarSlide publish its target width (for example data-rest-width next to data-moving), or mark the content element with a data attribute and use querySelector.
minorapps/desktop/src/renderer/hooks/useUpdateControl/useUpdateControl.ts:125
No tests cover the extracted state machine or the TabBar min-width fix. resolvePhase is a pure function, and the ADD_TAB_SLOT_WIDTH min-width rule could be a one-line util test. The Testing section lists bun test for UpdatesPill, but the repo has no UpdatesPill test file.
Fix: export resolvePhase and add a small table test (installing only while READY, updated → null after confirmationDone, undefined → null). Correct the Testing section.

Evidence

Desktop, new shell, Linux dev build in the cloud sandbox (Xvfb, 1920×1108, 100% zoom), driven over CDP on port 9333 with renderer URL localhost:3005 (this workspace's DESKTOP_VITE_PORT). States were set with the real command palette (Ctrl+Shift+K → "Simulate update: …"), and the update was started by a real mouse click. At every state, CDP measured the button at x=259, width 76, height 24, so it does not move or change size.

Initial new-shell window
Baseline: new shell, signed in, up to date. No update control in the title bar or the rail.
Downloading state
Downloading: dithered accent fill with the percent (41%).
Ready state
Ready: solid accent "Update" button.
Ready tooltip
Ready on hover: tooltip "Install the update. Sessions keep running · v99.0.0-test".
Installing state
After a real click on Update: "Updating…" (the dither sweep was off the visible span in this frame).
Updated state
"Updated" confirmation, shown for about 5s.
Button gone
After the confirmation: the button is removed.
Error state
Error: "Retry". The tooltip shows only the raw error text (finding 2).

Not verified:

Questions for the author

Test / CI notes