Skip to content

feat(ui): unify Control UI offline state into one indicator and a queueing composer hint - #112600

Merged
steipete merged 2 commits into
mainfrom
claude/offline-state-unification-970ae1
Jul 22, 2026
Merged

steipete merged 2 commits into
mainfrom
claude/offline-state-unification-970ae1

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Control UI showed three competing offline indicators for the same gateway connection state: a top-center "Gateway connection lost / Retry now" banner, a red presence dot + "Offline" label on the sidebar agent card, and an "Offline" label in the sidebar footer. The banner used the raw connection flag (flickering on brief blips) while the two sidebar surfaces shared a 2s debounce implemented locally in the sidebar component. The agent-card dot was also semantically wrong: the gateway link is client-session state, not agent presence. Meanwhile the composer gave no visible cue that sends made while offline are safely queued by the existing durable outbox.

Why This Change Was Made

One canonical presentation model: silence when connected, one calm indicator when offline, and the composer explaining that messages queue.

  • offlineStable (2s debounce) now lives in the gateway store; the sidebar-local timer is deleted. The online transition is never debounced.
  • Connection banner: deleted. Agent-card presence dot: deleted.
  • The sidebar footer indicator is canonical: an offline button with "Reconnecting…" detail, a redacted lastError tooltip, and click-to-retry (absorbing the banner's "Retry now"). Connected state renders nothing — no green anywhere (settings sidebar footer included).
  • The composer stays fully usable offline and shows a hint strip: "Offline — messages will be queued and sent when the connection returns." No send/queue logic changed; the durable outbox already replays queued sends idempotently on reconnect.

User Impact

Offline is now one glanceable state instead of three: the bottom-left indicator (click to retry) plus an amber composer hint that makes the queue-and-flush behavior explicit. Brief transport blips no longer flash a full-width banner.

State Before After
Offline (dark) before offline dark after offline dark
Offline (light) before offline light after offline light
Online (light) before online light after online light

Artifact manifest: https://artifacts.openclaw.ai/pr-offline-state-unification-20260722/artifact-manifest.json

Evidence

  • Focused Vitest (gateway-store, app-sidebar, chat-composer, settings-sidebar): 4 files, 204 tests passed (re-run after rebase onto latest origin/main).
  • New gateway-store debounce tests: sustained-disconnect flip at exactly 2s, sub-2s blip stays quiet, immediate clear on reconnect, timer cleared on stop(), no offline before start().
  • Browser E2E (mock gateway): zero chat.send while offline, exactly one idempotent delivery after reconnect, queue cleanup verified.
  • pnpm ui:i18n:verify clean (en.ts-only string changes; keys connection.lostTitle, connection.offlineHint, chat.gatewayStatus removed with usages verified gone; chat.composer.offlineHint added).
  • node scripts/check-max-lines-ratchet.mjs OK post-rebase.
  • Autoreview (Codex gpt-5.6-sol): clean, no accepted findings.
  • Net diff: 52 files, +328/−336; production code net −158 LOC.

Screenshots via the mock-gateway e2e harness (installMockGateway + setOnline(false)), no real gateway involved.

@steipete
steipete marked this pull request as ready for review July 22, 2026 08:01
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Jul 22, 2026
steipete added 2 commits July 22, 2026 03:21
…ueing composer hint

The Control UI showed three competing offline surfaces (top connection
banner, agent-card presence dot, sidebar footer label), each deriving its
own view of the same gateway snapshot with inconsistent debounce.

- Centralize the 2s offline debounce as `offlineStable` in the gateway
  store; delete the sidebar-local timer.
- Delete the connection banner and the agent-card presence dot; the
  gateway link is client state, not agent presence.
- The sidebar footer indicator is now canonical: a single offline button
  with reconnect detail, redacted last-error tooltip, and click-to-retry
  (absorbs the banner's "Retry now"). Connected state renders nothing.
- Settings sidebar footer follows the same offline-only rule (no green
  connected dot).
- The composer shows an offline hint strip ("messages will be queued and
  sent when the connection returns") while staying fully usable; the
  existing durable outbox already replays queued sends on reconnect.
@steipete
steipete force-pushed the claude/offline-state-unification-970ae1 branch from 148ec90 to 1aef0d3 Compare July 22, 2026 10:22
@clawsweeper

clawsweeper Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: feat(ui): unify Control UI offline state into one indicator and a queueing composer hint This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete merged commit 01da67e into main Jul 22, 2026
91 checks passed
@steipete
steipete deleted the claude/offline-state-unification-970ae1 branch July 22, 2026 10:32
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 23, 2026
…ueing composer hint (openclaw#112600)

* feat(ui): unify Control UI offline state into one indicator and a queueing composer hint

The Control UI showed three competing offline surfaces (top connection
banner, agent-card presence dot, sidebar footer label), each deriving its
own view of the same gateway snapshot with inconsistent debounce.

- Centralize the 2s offline debounce as `offlineStable` in the gateway
  store; delete the sidebar-local timer.
- Delete the connection banner and the agent-card presence dot; the
  gateway link is client state, not agent presence.
- The sidebar footer indicator is now canonical: a single offline button
  with reconnect detail, redacted last-error tooltip, and click-to-retry
  (absorbs the banner's "Retry now"). Connected state renders nothing.
- Settings sidebar footer follows the same offline-only rule (no green
  connected dot).
- The composer shows an offline hint strip ("messages will be queued and
  sent when the connection returns") while staying fully usable; the
  existing durable outbox already replays queued sends on reconnect.

* fix(ui): keep offline debounce constant module-local for knip production scan
steipete added a commit that referenced this pull request Aug 26, 2026
… in the sidebar footer

The sidebar footer has been the canonical offline indicator since #112600
(which deleted the top connection banner in its favor), but #125070's footer
compaction made it sr-only + aria-hidden - invisible to everyone. Restore the
visible red offline pill (click-to-retry, queued count, redacted error
tooltip) and add a restart-aware amber state: the gateway already broadcasts
shutdown { restartExpectedMs } before restarting and refuses drain-phase work
with reason "gateway-restarting", so the Control UI now shows "Restarting..."
immediately - before the socket drops - and degrades to the offline pill when
a restart overruns max(3x restartExpectedMs, 15s).

One shared renderSidebarConnectionStatus serves the main and settings
sidebars; the dead sr-only spans and clipped live region are deleted. The
drain reason strings become shared gateway-protocol constants. The e2e mock
now passes Vite's vite-hmr client socket through to the native WebSocket so
going offline in source-served suites no longer triggers a dev-client page
reload mid-test.
steipete added a commit that referenced this pull request Aug 26, 2026
…ounce restarts (#130025)

* fix(ui): restore visible gateway offline status and announce restarts in the sidebar footer

The sidebar footer has been the canonical offline indicator since #112600
(which deleted the top connection banner in its favor), but #125070's footer
compaction made it sr-only + aria-hidden - invisible to everyone. Restore the
visible red offline pill (click-to-retry, queued count, redacted error
tooltip) and add a restart-aware amber state: the gateway already broadcasts
shutdown { restartExpectedMs } before restarting and refuses drain-phase work
with reason "gateway-restarting", so the Control UI now shows "Restarting..."
immediately - before the socket drops - and degrades to the offline pill when
a restart overruns max(3x restartExpectedMs, 15s).

One shared renderSidebarConnectionStatus serves the main and settings
sidebars; the dead sr-only spans and clipped live region are deleted. The
drain reason strings become shared gateway-protocol constants. The e2e mock
now passes Vite's vite-hmr client socket through to the native WebSocket so
going offline in source-served suites no longer triggers a dev-client page
reload mid-test.

* refactor(ui): delete dead sr-only footer subtitle spans and fit the startup budget

The connected-state identity subtitle spans (gateway health dot, name,
build subtitle) were the same sr-only + aria-hidden dead-markup class the
previous commit fixed for offline: invisible to sighted users and screen
readers, with the identity button's aria-label already carrying the same
information. Delete them plus their orphaned CSS; tests now assert the
aria-label contract.

The e2e mock's Vite dev-client socket passthrough keys on the vite-hmr
subprotocol. The gateway store drops validation the shared timer clamp
already owns and re-arms the restart deadline on every fresh drain
rejection (server still says restarting, so amber stays honest). The
startup-budget baseline refresh (340901 -> 341446, jitter-safe max of
three builds) records the ~530 B this feature legitimately adds over the
512 B per-change tolerance; reason stored in the baseline file.

* fix(ui): keep ordinary gateway stops on the offline pill path

ClawSweeper finding: every shutdown broadcast armed the amber Restarting
state, so a deliberate stop hid the Offline/Retry action for the 15s
deadline floor. The amber state now arms only when the broadcast carries a
numeric restartExpectedMs; ordinary stops flow through the normal offline
pill. The server omits restartExpectedMs on non-restart shutdowns instead
of broadcasting null, aligning the wire with ShutdownEventSchema's
optional integer.

Also rewires build-info-unicode.e2e to the identity aria-label (the
visible subtitle span it asserted was deleted as dead markup) and splits
the restart-state store tests into gateway-store.restart.test.ts with a
shared test-support harness to respect the max-lines cap.

* chore(ui): tighten startup gzip baseline after composer-queue rebase

The combined tree measures 340754-340770 B across builds, below the
341489 B baseline main recorded for the composer stack; pin 340810 B
(max observed + jitter headroom) so the ratchet reflects reality.

* fix(ui): unexport the test-support fake gateway client (knip dead export)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
…ounce restarts (openclaw#130025)

* fix(ui): restore visible gateway offline status and announce restarts in the sidebar footer

The sidebar footer has been the canonical offline indicator since openclaw#112600
(which deleted the top connection banner in its favor), but openclaw#125070's footer
compaction made it sr-only + aria-hidden - invisible to everyone. Restore the
visible red offline pill (click-to-retry, queued count, redacted error
tooltip) and add a restart-aware amber state: the gateway already broadcasts
shutdown { restartExpectedMs } before restarting and refuses drain-phase work
with reason "gateway-restarting", so the Control UI now shows "Restarting..."
immediately - before the socket drops - and degrades to the offline pill when
a restart overruns max(3x restartExpectedMs, 15s).

One shared renderSidebarConnectionStatus serves the main and settings
sidebars; the dead sr-only spans and clipped live region are deleted. The
drain reason strings become shared gateway-protocol constants. The e2e mock
now passes Vite's vite-hmr client socket through to the native WebSocket so
going offline in source-served suites no longer triggers a dev-client page
reload mid-test.

* refactor(ui): delete dead sr-only footer subtitle spans and fit the startup budget

The connected-state identity subtitle spans (gateway health dot, name,
build subtitle) were the same sr-only + aria-hidden dead-markup class the
previous commit fixed for offline: invisible to sighted users and screen
readers, with the identity button's aria-label already carrying the same
information. Delete them plus their orphaned CSS; tests now assert the
aria-label contract.

The e2e mock's Vite dev-client socket passthrough keys on the vite-hmr
subprotocol. The gateway store drops validation the shared timer clamp
already owns and re-arms the restart deadline on every fresh drain
rejection (server still says restarting, so amber stays honest). The
startup-budget baseline refresh (340901 -> 341446, jitter-safe max of
three builds) records the ~530 B this feature legitimately adds over the
512 B per-change tolerance; reason stored in the baseline file.

* fix(ui): keep ordinary gateway stops on the offline pill path

ClawSweeper finding: every shutdown broadcast armed the amber Restarting
state, so a deliberate stop hid the Offline/Retry action for the 15s
deadline floor. The amber state now arms only when the broadcast carries a
numeric restartExpectedMs; ordinary stops flow through the normal offline
pill. The server omits restartExpectedMs on non-restart shutdowns instead
of broadcasting null, aligning the wire with ShutdownEventSchema's
optional integer.

Also rewires build-info-unicode.e2e to the identity aria-label (the
visible subtitle span it asserted was deleted as dead markup) and splits
the restart-state store tests into gateway-store.restart.test.ts with a
shared test-support harness to respect the max-lines cap.

* chore(ui): tighten startup gzip baseline after composer-queue rebase

The combined tree measures 340754-340770 B across builds, below the
341489 B baseline main recorded for the composer stack; pin 340810 B
(max observed + jitter headroom) so the ratchet reflects reality.

* fix(ui): unexport the test-support fake gateway client (knip dead export)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant