Skip to content

fix(dashboard): name the offline cause beside the desktop connection dot and in the composer - #34372

Merged
bolichen97 merged 1 commit into
mainfrom
fix/connection-notice-every-width
Nov 10, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/connection-notice-every-width

Conversation

@tim-finnigan

@tim-finnigan tim-finnigan commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: When the dashboard loses its connection, a desktop-width window says why in words, and the composer placeholder agrees with it.

At desktop width a dropped connection showed no text at all. The readout capsule's red dot carried the cause (offline, relay session ended, refused) only in its tooltip and screen-reader text, and the strip that says it in words renders only below 768px. Over the relay, the composer then read "Gateway offline — message will not send" under a top bar that, on hover, said the session had ended.

Why it matters

A relay user whose session ended cannot tell from the screen that reopening the Crew is the fix, and the one message that says so is the hardest to find.

Not a goal

What changed (motivation → approach → change)

At desktop width the top bar now shows the cause as text right after the connection dot, worded by the same gatewayStatusMsg the dot announces. It renders through the shared inline ErrorNotice, like MetricsErrorNotice beside it, with announce off because the dot's role="status" span already speaks the same text, and with noHandoffReason because a hand-off to the agent cannot be delivered while the gateway is offline. It sits in flow in the actions group, so the collapse ladder makes room for it, and its last rung (tbr-6) hides its text visually and drops its icon, leaving the capsule's red dot as the one mark. It stays hidden while the session-expired banner is up.

Reusing the phone strip at desktop width was tried first and does not work: the header is its own stacking layer (z 45), so the rail and the chat panes paint over anything hanging below it, and an overlay there would also cover the session title.

The composer's offline placeholder (useOfflinePlaceholder in the new components/chat-input/offlinePlaceholder.ts, called from components/ChatInput.tsx so the composer stays under the 2,000-line cap) reads the relay's cause from the store while the gateway is down and words it with the notice's own offlineReason, which moves from shell/appShell.tsx to utils/offlineReason.ts because only the shell may import from shell/. A plain drop keeps "Gateway offline — message will not send", so the direct dashboard reads as before and keeps reconnecting. The cause is ignored while the gateway itself is up, because a crew window passes its own tunnel's connected to the composer.

styles/shell-chrome.css gains the two tbr-6 rules, and the rung list in lib/useTopbarCollapse.ts names it.

Backwards compatibility

Compatible: the notice and placeholder only add or reword text while disconnected; no prop, key or setting changes.

Removes nothing: the phone strip, the dot, its live region and every existing string stay.

Tests

  • App.offlinePill.test.tsx: at desktop width, for no cause, session_ended and refused, the notice is an inline ErrorNotice in the actions group with the cause's text, its icon and no hand-off button, is not a live region, and goes away on reconnect; it stays hidden behind the session-expired banner.
  • ChatInput.offlineCausePlaceholder.test.tsx: the placeholder per cause, plain offline unchanged, and a stale cause ignored while the gateway is up.
  • useTopbarCollapse.test.ts: the notice's text and icon fold only at tbr-6.
  • agentSwitchNotice.surfacePairing.test.ts: a second kind of announce={false} pairing, a notice whose twin is a role="status" span rendering the same value in the same file. The top-bar notice is its one entry, and removing the dot's live region or adding any other unpaired silence fails it.

Reverting the desktop notice to the hand-written span turns the three notice cases red; dropping the icon rule turns the ladder pin red; reverting the composer change turns the two cause cases red.

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

Manual verification

Captured at 1440×520 (2x) with a Playwright harness over the built SPA and a stubbed API, staging only the socket: "offline" closes every /api/ws socket; "session ended" opens one, closes it with the relay's 4401, then closes the reconnect. The short viewport is the crop: one frame holds the top bar, the notice and the composer.

Screenshots / video

Offline, before (main): the red dot only, no text.

before main offline

Offline, after: the alert icon and "Gateway offline — reconnecting" beside the dot; the composer wording is unchanged.

after offline

Session ended, before (captured at #34119's head, before it merged): the dot only, and the composer says "Gateway offline".

before session ended

Session ended, after: the notice and the composer both say "Relay session ended — reopen this Crew".

after session ended

Related Issues

Refs #34355

Sibling sweep

Swept: git grep -n "gateway_offline_message_will_not_send|isMobile && !connected" -- website/src/
Sibling: website/src/utils/offline.ts -- not affected -- the Send/Optimize disabled labels name the action that is blocked, not the outage cause
Sibling: website/src/shell/topbar/shellHeader.tsx -- changed here

Pattern harvest

Not generalizable: a single indicator that only rendered below one breakpoint, not a repeated pattern.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • 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

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of f149941e6662a556e5647c67f8a0947f5a5dcef4 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the notice and placeholder share one cause source, the moved offlineReason has no reader left on the old path, and the screenshots show this revision.

Notes

  • The notice and the dot now each work out the offline wording themselves (gatewayStatusMsg and offlineReason). Have the composer read the store's gatewayStatusMsg derivation, or have both call one selector, so the two can't drift apart.

[DESIGN-REVIEWED] f149941

Description read

[DESCRIPTION-READ] 897bed77d2d78d535f26bd7f2ff75ce1b40a7c6486e9164bf9fe64c9241bc933

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of f149941e6662a556e5647c67f8a0947f5a5dcef4 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing to check.

What this change ships

Inventory (6 items) — 6 justified

Intent: when the connection drops, a desktop user can read why (and that reopening the Crew fixes an ended relay session), and the composer says the same thing. FIX.

  1. At desktop width, the top bar shows the offline cause as text with an alert icon beside the red dot — justified
  2. Over the relay, the composer placeholder shows "session ended" or "refused" instead of the generic offline text — justified
  3. At the narrowest top-bar width the notice's text and icon fold away, leaving only the dot — justified
  4. The desktop notice stays hidden while the session-expired banner is shown — justified
  5. offlineReason moves from shell/appShell.tsx to utils/offlineReason.ts so the composer can import it — justified
  6. The surface-pairing test accepts a silenced notice whose twin is a role="status" span in the same file — justified

[FIRST-PRINCIPLES-REVIEWED] f149941

Description read

[DESCRIPTION-READ] 64e6e4d271b0c052df7b930a2b7ee133df4106caee9f48284cb067080b7b0d2b

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

UX-level review of f149941e6662a556e5647c67f8a0947f5a5dcef4 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

cannot evaluate: missing the "refused" cause and the collapsed (tbr-6) state of the new top-bar notice. The diff adds both, but none of the four screenshots shows either one.

Evidence gaps

  • Refused cause. The top-bar notice and the composer placeholder now both show "Relay refused the connection — retrying". offlineReason adds this text and the tests cover it, but shots 01–04 only show the no-cause and session_ended cases. Fix: attach an "after" screenshot of the 4401-style refusal case.
  • Collapsed state at tbr-6. At this width the notice's text and icon are hidden from view, leaving only the red dot. The shell-chrome.css rules add this state, and no screenshot shows the top bar narrow enough to reach it. Fix: attach a screenshot of the narrowest desktop width where the notice has folded into the dot. That shot would show whether the text is lost or still readable at that width.

Notes

  • No visible way to reopen. About shot-04, the blind reader said "no idea how to 'reopen a Crew' … no button says 'reopen'". The notice now names a fix the user can't find on screen. A follow-up could add a "Reopen" action next to the notice.
  • The two offline messages differ. In shot-02 the top bar says "Gateway offline — reconnecting" while the composer still says "Gateway offline — message will not send", and the blind reader noticed they "don't quite match". The PR's own goal is that the composer "agrees with" the top bar, so the plain-offline case could reuse the same offlineReason text.
  • "Relay session ended" can sound like the chat ended. The reader said "I'd worry my chat 'Draft the release notes' had ended", because the sidebar also calls chats "Sessions". This is a follow-up for the wording, which this PR deliberately leaves unchanged.

[UX-REVIEWED] f149941

Description read

[DESCRIPTION-READ] 7721f4b6a186380b8609bdd83c1965d46d6acd8f604ac98953e75e9d21798800

That sha256 names everything this verdict read: the PR description, plus the 7 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed f149941e6662a556e5647c67f8a0947f5a5dcef4 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] f149941

Verdict parsed from the review's SHA-scoped output markers for commit f149941e6662a556e5647c67f8a0947f5a5dcef4.

False positive or not applicable? A repository writer can comment:
/ai-review override fable f149941e6662a556e5647c67f8a0947f5a5dcef4 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of f149941e6662a556e5647c67f8a0947f5a5dcef4 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f149941

False positive or not applicable? A repository writer can comment:
/ai-review override gpt f149941e6662a556e5647c67f8a0947f5a5dcef4 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 10, 2026
@tim-finnigan
tim-finnigan force-pushed the fix/connection-notice-every-width branch from 8466094 to ca88b0f Compare November 10, 2026 08:12
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 10, 2026
@tim-finnigan
tim-finnigan force-pushed the fix/connection-notice-every-width branch from ca88b0f to ccc59e6 Compare November 10, 2026 15:09
@tim-finnigan

Copy link
Copy Markdown
Contributor Author
  • website/src/shell/topbar/shellHeader.tsx:632 errors-use-error-notice: fixed in ccc59e6. The desktop offline notice now renders through ErrorNotice variant="inline", the same form as MetricsErrorNotice beside it, keeping messageClassName="tb-offline-notice-msg" and testId="topbar-offline-notice". announce={false} because the connection dot's role="status" span already announces gatewayStatusMsg, and noHandoffReason instead of askAgent because the gateway is offline, so a hand-off to the agent cannot be delivered. App.offlinePill.test.tsx pins the ErrorNotice form, and reverting to the hand-written span turns its three notice cases red.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 10, 2026
@tim-finnigan
tim-finnigan force-pushed the fix/connection-notice-every-width branch from ccc59e6 to 72d9ad9 Compare November 10, 2026 17:31
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 10, 2026
…dot and in the composer

At desktop width a dropped connection showed no words at all: the readout
capsule's red dot carried the cause (offline, relay session ended, refused)
only in its tooltip and sr-only text, and the phone's strip renders only
below 768px. The top bar's actions group now shows the cause as text right
after the capsule, in flow, so the collapse ladder makes room for it; its
last rung (tbr-6) hides the text visually and keeps the dot. It is not a
live region, since the dot's role="status" span already announces it, and
it stays quiet while the session-expired banner speaks. The phone strip is
unchanged.

The composer's offline placeholder reads the relay's cause while the
gateway is down and reuses the same strings for session ended and refused;
a plain drop keeps "Gateway offline — message will not send".

Refs #34355
@tim-finnigan
tim-finnigan force-pushed the fix/connection-notice-every-width branch from 72d9ad9 to f149941 Compare November 10, 2026 21:21
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 10, 2026
@tim-finnigan
tim-finnigan marked this pull request as ready for review November 10, 2026 22:13
@tim-finnigan
tim-finnigan requested review from a team and KiroCrewCaptain as code owners November 10, 2026 22:13
@tim-finnigan
tim-finnigan requested a review from Zedmor November 10, 2026 22:13
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 10, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I read the whole diff, tests included. Moving offlineReason into utils/offlineReason.ts and adding the shared useOfflinePlaceholder hook keeps the offline copy in one place. The desktop offline ErrorNotice in shellHeader.tsx and the tbr-6 CSS are scoped to the offline state. This is a frontend-only change and I saw no behavior change outside the offline path. CI is green.

@bolichen97
bolichen97 enabled auto-merge (squash) November 10, 2026 23:06
@bolichen97
bolichen97 merged commit 9347582 into main Nov 10, 2026
100 of 102 checks passed
@bolichen97
bolichen97 deleted the fix/connection-notice-every-width branch November 10, 2026 23:06
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants