fix(web): disable server update Button until connected #6204
main fromrefs/pull/6204/head·opened View on GitHubA remote server could show an active Update button while it was still connecting. This change keeps the action disabled until the connection is ready, then enables it automatically.
What Changed#
- Disabled Update and Retry unless the environment is connected, with a tooltip explaining why.
- Added the same connection check inside the click handler to prevent stale or programmatic actions.
- Kept Copy update command available because it does not require a server connection.
- Applied the behavior through the shared update component used by local web, hosted web, and desktop.
- Documented the connection requirement.
Why#
Saved remote environments retain their last known version and update capabilities. After launching or updating the client, that cached information could render an active update action before the remote connection was ready.
Clicking the action during that window attempted an unavailable RPC and displayed an error toast. Using the existing reactive connection presentation fixes the problem without adding local state: the button rerenders and becomes available when the phase reaches connected.
UI Changes#
Before#
The update action was enabled while the remote environment was still connecting.

After#
The update action remains disabled until the remote environment connects.

Interaction video#
This clip shows the saved environment while it is connecting, with Update disabled, and after the real test server connects, with Update enabled again.

Watch or download the H.264 MP4
Testing#
Automated coverage verifies that:
- self-update is disabled during
available,offline,connecting,reconnecting, anderror; - a guarded click does not send the update command;
- disconnected self-update actions explain that they become available after connecting;
- the action becomes enabled when the connection changes from
connectingtoconnected; - the manual copy-command path remains available while disconnected;
- existing success, interruption, progress, and double-click behavior remains intact.
Manual browser verification used an isolated saved remote environment with cached version-mismatch metadata and a real connection attempt held in the connecting state. The update action had disabled=true, and attempting to activate it produced no update request or error toast. Pairing the same client with a real isolated server then moved the environment to connected and changed the update action to disabled=false.
Commands run:
vp test run apps/web/src/components/ServerUpdateAction.test.tsx
vp run --filter @t3tools/web typecheck
vp lint --report-unused-disable-directives apps/web/src/components/ServerUpdateAction.tsx apps/web/src/components/ServerUpdateAction.test.tsx
vp fmt --check apps/web/src/components/ServerUpdateAction.tsx apps/web/src/components/ServerUpdateAction.test.tsx docs/user/updating.md
git diff --check
Result: all 14 focused tests passed. Typecheck, lint, formatting, and diff validation passed.
Implementation plan
- Read the repository's agent, contribution, testing, documentation, and pull-request requirements.
- Locate every place where the server-update action is rendered.
- Trace the environment connection presentation and confirm that it updates reactively.
- Check local web, hosted web, desktop, and mobile to determine which clients expose the action.
- Search open and merged pull requests for server-update, connecting, reconnecting, disabled-action, and error-toast changes.
- Confirm that no existing pull request implements this connection guard.
- Keep the fix in the shared
ServerUpdateActioncomponent so every applicable entry point receives the same behavior. - Derive readiness from the existing connection presentation instead of introducing local component state.
- Disable self-update actions unless the connection phase is exactly
connected. - Apply the same condition inside the click handler as a defensive guard.
- Leave the manual copy-command path available because it does not contact the remote server.
- Add focused tests for every non-connected phase.
- Add coverage proving that the action becomes enabled after the environment connects.
- Preserve existing update lifecycle, interruption, progress, and double-click behavior.
- Update the user documentation.
- Run focused tests, targeted type checking, linting, formatting, and diff validation.
- Reproduce the original state in an isolated browser environment.
- Capture matching before/after screenshots.
- Rebase the branch onto the latest
mainbefore opening the pull request.
Related pull requests were reviewed for overlap. The closest open work changes environment availability or adjacent controls but does not guard server updates while connecting.
Checklist#
- This PR is small and focused
- I explained what changed and why
- I included before/after screenshots for any UI changes
- I included a video for the interaction change
Implemented with GPT-5.6-Sol using the Codex harness in T3 Code.
Note
Disable ServerUpdateAction button until environment is connected#
- Reads the environment connection phase via
useEnvironmentPresentationand disables the self-updateButtonwhenconnection.phase !== 'connected' - Guards
handleUpdateto no-op when disconnected, and wraps the disabled button in aTooltipthat reads "Available once {serverLabel} is connected." - Adds tests in ServerUpdateAction.test.tsx covering disabled states across non-connected phases, enablement on connection, tooltip messaging, and manual update availability
- Updates updating.md to document that Update and Retry stay disabled while connecting or reconnecting
- Risk: manual update command path is unchanged, but reviewers should confirm
isConnecteddoes not suppress the manual update path in ServerUpdateAction.tsx
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
aff40e3Macroscope's review found this PR approvable — Straightforward UX fix that disables the server update button while disconnected, preventing a user action that would fail anyway. Changes are self-contained to a single component with comprehensive test coverage and documentation updates.
No code changes detected at
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).476f936. Prior analysis still applies.maciekczech(GitHub profile, opens in a new tab) changed the title
One finding on the newly disabled Update/Retry control. See the inline comment.
Posted via Macroscope — UI Consistencyapps/web/src/components/ServerUpdateAction.tsx lines 160 to 160Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -154,4 +157,4 @@154157 }155158156159 return (157- <Button size="xs" onClick={() => void handleUpdate()}>160+ <Button size="xs" disabled={!isConnected} onClick={() => void handleUpdate()}>components/ServerUpdateAction.tsx:160The native
disabledattribute here leaves the user with a dead Update/Retry button and no way to learn why:Button's base class setsdisabled:pointer-events-none, so the control is also unhoverable and out of the tab order, and nothing else in the notice explains that it is waiting for the environment to connect.Elsewhere the codebase always pairs an unavailable action with a hoverable reason —
GitActionsControl(quickActionDisabledReason+aria-disabled+ hover popover),ThemeEditorPanel("a real disabled attribute would swallow the pointer events"), and the disabled Switch / "Managed above" rows inConnectionsSettings, which wrap the disabled control in a<span className="inline-flex">trigger so the tooltip still fires. Consider following that pattern;Tooltip/TooltipTrigger/TooltipPopupare already imported in this file andhandleUpdatealready guards on!isConnected.- return ( - <Button size="xs" disabled={!isConnected} onClick={() => void handleUpdate()}> - {label} - </Button> - ); + const action = ( + <Button size="xs" disabled={!isConnected} onClick={() => void handleUpdate()}> + {label} + </Button> + ); + return isConnected ? ( + action + ) : ( + <Tooltip> + <TooltipTrigger render={<span className="inline-flex">{action}</span>} /> + <TooltipPopup side="top">Available once {serverLabel} is connected.</TooltipPopup> + </Tooltip> + );No longer relevant as of aff40e3151b9c19f09145dde4f9e006b909456e1
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge added labelsmacroscope-review
Note
Written by
claude-opus-5-5on behalf of MariaHi! We are cleaning up open PRs, and this one appears to have been created with an older model (
gpt-5.6-sol). If this change is really important, we recommend rebuilding the PR with a newer model if possible.maria-rcks closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
8335dc28-c9d3-4681-a39d-5146c5f03bb5You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share