Repository navigation
fix(dashboard): name the offline cause beside the desktop connection dot and in the composer - #34372
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the notice and placeholder share one cause source, the moved Notes
[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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (6 items) — 6 justifiedIntent: 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.
[FIRST-PRINCIPLES-REVIEWED] f149941 Description read[DESCRIPTION-READ] 64e6e4d271b0c052df7b930a2b7ee133df4106caee9f48284cb067080b7b0d2b That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the "refused" cause and the collapsed ( Evidence gaps
Notes
[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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
8466094 to
ca88b0f
Compare
ca88b0f to
ccc59e6
Compare
|
ccc59e6 to
72d9ad9
Compare
…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
72d9ad9 to
f149941
Compare
bolichen97
left a comment
There was a problem hiding this comment.
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.
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
gatewayStatusMsgthe dot announces. It renders through the shared inlineErrorNotice, likeMetricsErrorNoticebeside it, withannounceoff because the dot'srole="status"span already speaks the same text, and withnoHandoffReasonbecause 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 (
useOfflinePlaceholderin the newcomponents/chat-input/offlinePlaceholder.ts, called fromcomponents/ChatInput.tsxso 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 ownofflineReason, which moves fromshell/appShell.tsxtoutils/offlineReason.tsbecause only the shell may import fromshell/. 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'sconnectedto the composer.styles/shell-chrome.cssgains the twotbr-6rules, and the rung list inlib/useTopbarCollapse.tsnames 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_endedandrefused, the notice is an inlineErrorNoticein 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 attbr-6.agentSwitchNotice.surfacePairing.test.ts: a second kind ofannounce={false}pairing, a notice whose twin is arole="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/wssocket; "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.Offline, after: the alert icon and "Gateway offline — reconnecting" beside the dot; the composer wording is unchanged.
Session ended, before (captured at #34119's head, before it merged): the dot only, and the composer says "Gateway offline".
Session ended, after: the notice and the composer both say "Relay session ended — reopen this Crew".
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
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)