Skip to content

fix(settings): keep the standing restart row beside an update card without one - #39370

Open
leonlaiyc wants to merge 2 commits into
kirodotdev:mainfrom
leonlaiyc:claude/about-restart-row-in-app-update
Open

leonlaiyc wants to merge 2 commits into
kirodotdev:mainfrom
leonlaiyc:claude/about-restart-row-in-app-update

Conversation

@leonlaiyc

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: While an update is offered on an install whose update card has no Restart button of its own, Settings → About still shows the standing "Restart gateway" control.

On a managed-venv install (nightly, in-app update), the About panel has no restart control at all while an update is offered or armed. The standing "Restart gateway" row is guarded by restartControls && !showManualUpdate, so it hides whenever any update card is on screen. Only one branch of that card draws its own RestartGatewayButton: the installer-command branch with a command to show. The in-app arm flow (InAppUpdateFlow) draws none, and neither does the policy-managed note or an installer card with no command. The only way to restart is kirocrew restart on the host.

Why it matters

Under updates never restart a running gateway, an armed update is applied only by a user restart. The row disappears in exactly the window where restarting is the next step, so a person who approves an in-app update from the dashboard is left with no way to finish it there. That matters most for someone on a phone or a remote dashboard with no shell on the host.

Not a goal

  • The issue's second part, the applying_restart_note copy in InAppUpdateFlow. That is a wording change across 12 catalogs. Open PR fix(settings): show the arm poll notices after three failed polls #38160 is also changing AboutPanelUpdateFlow.tsx, so it is left for a separate change.
  • Rewording the standing row's label ("Restart the gateway process without updating"). It is unchanged here.
  • Adding a second Restart button inside the in-app card. The standing row is the one control.

What changed (motivation → approach → change)

Symptom: zero restart controls during the in-app update lifecycle.

Root cause: the standing row's guard !showManualUpdate stands in for "the card already has a Restart". That is true for only one of the card's four branches.

The issue suggests !effectiveCommand. That alone is not enough: an armable managed-venv install also reports an update_command, the one shown under "Or re-run the installer manually", yet it renders InAppUpdateFlow and no button. So the guard has to follow the card's own branch order.

Change: in website/src/pages/settings/AboutPanelGatewayUpdate.tsx, a new cardHasRestart = showManualUpdate && !effectiveGwCanArm && !gwManagedByCommand && !!effectiveCommand mirrors the conditions under which the card draws its in-card Restart. The standing row and its ErrorNotice now hide only when cardHasRestart is true. The comment on the row says why.

The screenshots below are committed under temp-screenshots/39354/ because this is a fork PR. The capture harness that produced them stays out of the diff.

Backwards compatibility

Compatible: the row appears in more states and never in fewer. The installer-command branch still shows exactly one Restart button, and does not render two Restart buttons at once still passes.

Removes nothing: nothing is hidden or removed; a control that was hidden in three card states now shows.

Tests

website/src/test/AboutPanel.gatewayChannelRestart.test.tsx gains keeps the standing Restart beside $name, with three cases:

  • the in-app arm flow of a managed-venv install, with a command included;
  • an installer card with no command;
  • a policy-managed update with no in-app apply.

Each case asserts four things:

  • its card renders;
  • gateway-restart-row is present;
  • no in-card gateway-restart exists, so there is still one Restart;
  • two clicks on the standing button POST /api/restart.

Proof: not provable -- frontend test (prove.py runs Python only)

Negative control by hand: with main's AboutPanelGatewayUpdate.tsx restored over fix commit fce0bc6eb51c, all 3 new cases fail and the other 27 in the file pass. With the fix, all 30 pass.

Run locally on Windows 11, Node, a fresh npm ci: npx vitest run src/test/AboutPanel.gatewayChannelRestart.test.tsx src/test/AboutPanel.inAppApply.test.tsx src/test/AboutPanel.desktopRestart.test.tsx → 3 files, 71 tests passed. npx tsc --noEmit -p tsconfig.app.json is clean, and eslint on the changed files is clean.

Manual verification

I rendered the real AboutPanel with the stubbed status of a nightly managed-venv install offering an in-app update (update_can_arm: true, update_managed_by: 'kirocrew', update_command set). On main there is no restart control. On head the "Restart gateway" row appears under the auto-update switch (screenshots below).

Real-machine verification

Machine: own computer, Windows 11 Home 10.0.26200, x86_64, Chromium (Playwright) against a Vite dev server.
Before (main c313abe): a Playwright script that mounts the real AboutPanel (stubbed status and API, locale: 'en-US') and counts [data-testid="gateway-restart-row"] (label before) -> gateway-restart-row count=0 in dark and light
After (head cd99679): same command with label after -> gateway-restart-row count=1 in dark and light
Cleanup: own computer; the Vite server was stopped.

Screenshots / video

Before, main: an in-app update with no restart control anywhere on the card.

before, dark

After, head: the standing "Restart gateway" row under the auto-update switch.

after, dark

After, light

after, light

Related Issues

Part of #39354

Sibling sweep

Swept: git grep -n "showManualUpdate" -- website/src/
Sibling: website/src/pages/settings/AboutPanelGatewayUpdate.tsx -- changed here: both guards (the row and its ErrorNotice) now use cardHasRestart
Sibling: website/src/pages/settings/AboutPanel.tsx -- not affected -- it only computes showManualUpdate and passes it down; the desktop branch draws its own DesktopGatewayRestartRow

Pattern harvest

Not generalizable: a single guard that used "a card is shown" for "the card has this button"; the fix ties the guard to the card's own branch conditions.

Checklist

  • A Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...); PR Hygiene does not count commits
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

🤖 Generated with Claude Code

leonlaiyc and others added 2 commits November 19, 2026 10:30
…thout one

While an update is offered on a managed-venv install, Settings > About
showed no restart control at all: the standing "Restart gateway" row
hid whenever the update card was on screen, but only the installer
command branch of that card draws its own Restart. The in-app arm flow,
the policy-managed note and a command-less installer card draw none,
and an armed update is applied by exactly that user restart. The row
now hides only when the card renders its own button.

Part of kirodotdev#39354

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant