Skip to content

feat(ui): surface queued-outbox counts in composer hint, session rows, and offline footer - #112649

Merged
steipete merged 4 commits into
mainfrom
claude/offline-queued-badges
Jul 22, 2026
Merged

steipete merged 4 commits into
mainfrom
claude/offline-queued-badges

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Follow-up to #112600: queued sends are mechanically safe (durable per-session outbox with idempotent reconnect replay) but were only visible inside the open session's transcript. Messages queued in a session you navigated away from, and the overall "how much is waiting" picture, had no indicator anywhere.

Why This Change Was Made

Queued-ness is ambient state, so it surfaces in the three places you already look, and nowhere new:

  • Composer hint (visible session): "Offline — {count} queued; messages send when the connection returns." Falls back to the existing copy at zero.
  • Session rows: a clock badge with the per-scope outbox count, joining the existing row-badge system. Shown independent of connection state — items also wait while a run is busy (waiting-idle) or after a failed send, and "this session has undelivered input" matters in all three cases. Alias-safe scope resolution keeps agent-main from double-counting.
  • Offline footer button: appends the aggregate ("Offline · Reconnecting… · 3 queued"), settings-sidebar mirror included. Connected state stays completely silent — no green, no drain chatter.

Plumbing is one narrow seam: subscribeStoredChatOutboxChanges in composer-persistence notifies on stored-outbox writes; app-host summarizes counts per scope key and passes them down. No send/queue/drain logic touched.

User Impact

You can flick airplane mode, keep typing, and see exactly what's parked where: count in the composer, per-session badges in the sidebar, total on the offline pill. On reconnect everything flushes and all indicators clear.

State Before After
Offline + 2 queued (dark) before queued dark after queued dark
Offline + 2 queued (light) before queued light after queued light
Online (light, unchanged silence) before online after online

Artifact manifest: https://artifacts.openclaw.ai/pr-offline-queued-badges-20260722/artifact-manifest.json

Evidence

  • Focused Vitest (composer, app-sidebar, settings-sidebar, composer-persistence, session-row-badges): 5 files, 263 tests pass; re-run after rebase onto latest origin/main (incl. resolving the fix(ui): move footer title tooltips onto the shared tooltip component #112639 tooltip-component conversion in the footer button).
  • pnpm ui:i18n:verify clean; new keys chat.composer.offlineQueuedHint, connection.queuedCount, sessionsView.queuedMessage{,s}.
  • Remote check-changed (Blacksmith Testbox): coreTests + ui lanes green, lint 0/0.
  • Codex autoreview (gpt-5.6-sol): clean, no accepted findings.
  • Screenshots from the mock-gateway e2e harness (offline via setOnline(false), two sends queued live) — no real gateway involved.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Jul 22, 2026
@steipete
steipete marked this pull request as ready for review July 22, 2026 11:57
@steipete steipete self-assigned this Jul 22, 2026
steipete added 4 commits July 22, 2026 08:15
…, and offline footer

Follow-up to the offline-state unification: queued sends were mechanically
safe (durable outbox with reconnect replay) but only visible inside the
open session's thread.

- Composer offline hint now includes the visible session's queued count.
- Session rows show a clock badge with the per-scope outbox count,
  independent of connection state (covers waiting-idle and failed too),
  with alias-safe scope resolution so agent-main never double-counts.
- The offline footer button appends the aggregate ("· N queued"); the
  connected state stays completely silent.
- One narrow subscription seam (subscribeStoredChatOutboxChanges) added
  in composer-persistence; no send/drain logic touched.
…d module

The queued-count feature statically imported composer-persistence from
startup modules, hoisting the chat page's persistence machinery into the
startup chunk and breaking the Control UI startup JS gzip budget
(319.6 KiB > 314.0 KiB limit).

Split ownership instead of gaming the budget: a lean read/subscribe
module (ui/src/lib/chat/outbox-store.ts + codec/draft-state) serves
startup consumers (app-host, sidebar), while writes, migrations, and
drain stay in the lazy chat chunk (composer-outbox-store/composer-storage);
composer-persistence keeps its export surface for chat callers. Startup
is back to 313.8 KiB gzip at 12 requests with no chunking-config changes.

Also fixes an autoreview finding in the new summary: legacy bare-main
outbox rows now resolve through session defaults (online) or the
persisted mainAlias (offline reload) instead of trusting the row's stale
embedded agent id, so badge counts key to the same scope the sidebar
resolves. The shared footer status renderer is deduplicated into
session-row-badges.
The lean outbox read module still cost ~2.8 KiB of startup gzip against
1.5 KiB of budget headroom. Follow the sidebar chrome pattern
(lobster-pet/facepile): app-host idle-loads outbox-store, subscribes on
arrival, and passes the sidebar a resolver callback instead of letting
startup modules import scope resolution. Badges and counts hydrate
moments after load; before that the summary is empty by design.

Failed chunk loads recover on browser online events and, because chunks
are usually served by the gateway itself, on gateway reconnect — the
exact moment the offline badges become relevant again.

Raise the initial-graph packing ceiling 448->512 KiB: the grown core
graph split at the old boundary into an extra chunk, costing ~1.9 KiB of
startup gzip to compression-context resets (same documented tradeoff as
the earlier 400->448 bump). Startup lands at 313.5 KiB gzip / 9 requests,
matching the origin/main baseline, limit 315.0.
@steipete
steipete force-pushed the claude/offline-queued-badges branch from e57b629 to b8ff17d Compare July 22, 2026 16:26
@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): surface queued-outbox counts in composer hint, session rows, and offline footer 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 85fda04 into main Jul 22, 2026
93 checks passed
@steipete
steipete deleted the claude/offline-queued-badges branch July 22, 2026 17:53
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Jul 23, 2026
…d baseline (#112880)

The startup JS gzip gate was a fixed ceiling that main drifted to within
1-3 KiB of, forcing repeated hand-bumps (315->317 KiB) and failing
feature PRs on drift they did not cause (#112649 burned two CI rounds).

check-control-ui-performance.mjs now also enforces a committed baseline
(config/control-ui-startup-budget-baseline.json) with a 512 B tolerance:
regressions beyond baseline+tolerance fail with an actionable message,
intentional increases become a reviewed one-line diff via
--update-baseline --reason, meaningfully lighter builds print a
lower-the-baseline hint, and a malformed/missing baseline fails closed.
The fixed ceiling stays as the cumulative-creep backstop.

Closes #112743.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 23, 2026
…, and offline footer (openclaw#112649)

* feat(ui): surface queued-outbox counts in composer hint, session rows, and offline footer

Follow-up to the offline-state unification: queued sends were mechanically
safe (durable outbox with reconnect replay) but only visible inside the
open session's thread.

- Composer offline hint now includes the visible session's queued count.
- Session rows show a clock badge with the per-scope outbox count,
  independent of connection state (covers waiting-idle and failed too),
  with alias-safe scope resolution so agent-main never double-counts.
- The offline footer button appends the aggregate ("· N queued"); the
  connected state stays completely silent.
- One narrow subscription seam (subscribeStoredChatOutboxChanges) added
  in composer-persistence; no send/drain logic touched.

* perf(ui): keep the startup bundle under budget with a lean outbox read module

The queued-count feature statically imported composer-persistence from
startup modules, hoisting the chat page's persistence machinery into the
startup chunk and breaking the Control UI startup JS gzip budget
(319.6 KiB > 314.0 KiB limit).

Split ownership instead of gaming the budget: a lean read/subscribe
module (ui/src/lib/chat/outbox-store.ts + codec/draft-state) serves
startup consumers (app-host, sidebar), while writes, migrations, and
drain stay in the lazy chat chunk (composer-outbox-store/composer-storage);
composer-persistence keeps its export surface for chat callers. Startup
is back to 313.8 KiB gzip at 12 requests with no chunking-config changes.

Also fixes an autoreview finding in the new summary: legacy bare-main
outbox rows now resolve through session defaults (online) or the
persisted mainAlias (offline reload) instead of trusting the row's stale
embedded agent id, so badge counts key to the same scope the sidebar
resolves. The shared footer status renderer is deduplicated into
session-row-badges.

* fix(ui): correct type-only import and const tuple in outbox split

* perf(ui): idle-load the outbox summary so startup carries no outbox code

The lean outbox read module still cost ~2.8 KiB of startup gzip against
1.5 KiB of budget headroom. Follow the sidebar chrome pattern
(lobster-pet/facepile): app-host idle-loads outbox-store, subscribes on
arrival, and passes the sidebar a resolver callback instead of letting
startup modules import scope resolution. Badges and counts hydrate
moments after load; before that the summary is empty by design.

Failed chunk loads recover on browser online events and, because chunks
are usually served by the gateway itself, on gateway reconnect — the
exact moment the offline badges become relevant again.

Raise the initial-graph packing ceiling 448->512 KiB: the grown core
graph split at the old boundary into an extra chunk, costing ~1.9 KiB of
startup gzip to compression-context resets (same documented tradeoff as
the earlier 400->448 bump). Startup lands at 313.5 KiB gzip / 9 requests,
matching the origin/main baseline, limit 315.0.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 23, 2026
…d baseline (openclaw#112880)

The startup JS gzip gate was a fixed ceiling that main drifted to within
1-3 KiB of, forcing repeated hand-bumps (315->317 KiB) and failing
feature PRs on drift they did not cause (openclaw#112649 burned two CI rounds).

check-control-ui-performance.mjs now also enforces a committed baseline
(config/control-ui-startup-budget-baseline.json) with a 512 B tolerance:
regressions beyond baseline+tolerance fail with an actionable message,
intentional increases become a reviewed one-line diff via
--update-baseline --reason, meaningfully lighter builds print a
lower-the-baseline hint, and a malformed/missing baseline fails closed.
The fixed ceiling stays as the cumulative-creep backstop.

Closes openclaw#112743.
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: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant