Repository navigation
feat: name failed bulk switch sessions and label their retry - #31333
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. This is client-side copy and state that the backend's existing Notes
[DESIGN-REVIEWED] 81a8b5f Description read[DESCRIPTION-READ] cd50ec5e39d5ec1b88fa7520ae24c65f2f7ca2e26c0395b90a0e92245717c127 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 Every item comes from #11231 tasks 3–4. The code reuses Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: let a user see which sessions a bulk model switch missed, and know that the button retries exactly those. ADDITION (copy and client state).
[FIRST-PRINCIPLES-REVIEWED] 81a8b5f Description read[DESCRIPTION-READ] 623cabae85e7c7d927b40418c5bc6f2995e4720a6f8485d54b6e444d3c267ec5 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The blind reader read the named failure notice and "Retry 2 failed sessions" correctly and said they would click it. Every changed state is shown in a screenshot. Notes
[UX-REVIEWED] 81a8b5f Description read[DESCRIPTION-READ] ff5a2a295cf62fa9a3bbbd7c2ebb06aaec7edb847ad8865d2e43c871b5e565ed 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: |
e004ca7 to
7cb2adf
Compare
|
self-added: no
|
7cb2adf to
6908a07
Compare
|
self-added: yes
|
6908a07 to
eb9febd
Compare
After Switch All Sessions fails on some sessions, the error notice now
names them the way their sidebar rows do, instead of giving only a
count. When those sessions are all the Switch button would act on, the
button reads "Retry N failed sessions", so the reader can tell a retry
of the failed set from a switch of some other session.
The notice key gains a {{names}} list in every catalog, a plural retry
key is added, en-XA is regenerated and both keys get translator context.
eb9febd to
81a8b5f
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved for the on-call. Review lanes pass on 81a8b5f, no conflict, no open change request.
A disabled primary button faded its accent fill to 30% opacity, which on a light canvas reads as a pastel accent rather than a control that is off. Btn's primary variant and SendBtn now take the muted surface and label when disabled, and drop their hover glow and sheen; the outline Btn variants keep the fade. Three call sites that painted the accent onto a plain Btn use primary, and the embedded chat's send no longer fades on top of the muted state. Closes #23978 Backport note: release's Switch All Sessions button has no failed-retry state (bulkRetriesFailed is from #31333, not on release), so only its accent classes are swapped for the primary prop on release's line. Backport note: release's Switch All Sessions button has no failed-retry state (bulkRetriesFailed is from #31333, not on release), so only its accent classes are swapped for the primary prop on release's line. (cherry picked from commit 5658952)
…33387) The Switch All Sessions panel's Switch button, and the roster Retry button, took a native disabled while their request ran. The keyboard press that started it blurred focus to the page, and both requests can fail with the panel still open, so the reader lost their place before they could try again. Both now stay focusable with aria-disabled and aria-busy, look as the disabled state did, and ignore a second press. Switch with nothing to switch keeps its native disabled. Backport note: release's Switch button has no failed-retry state (bulkRetriesFailed is from #31333, not on release), so the busy swap to aria-disabled, aria-busy and the click guard is applied to release's disabled condition and label. The Retry hunk applies as on main. In the test, the first Switching assertion waits for react-query's notify tick, as the Retry case already does: on main the click's notice reset (a #31333 object state) re-renders at once, while release's string state bails out on an unchanged empty value. (cherry picked from commit 757df49)
…33387) The Switch All Sessions panel's Switch button, and the roster Retry button, took a native disabled while their request ran. The keyboard press that started it blurred focus to the page, and both requests can fail with the panel still open, so the reader lost their place before they could try again. Both now stay focusable with aria-disabled and aria-busy, look as the disabled state did, and ignore a second press. Switch with nothing to switch keeps its native disabled. Backport note: release's Switch button has no failed-retry state (bulkRetriesFailed is from #31333, not on release), so the busy swap to aria-disabled, aria-busy and the click guard is applied to release's disabled condition and label. The Retry hunk applies as on main. In the test, the first Switching assertion waits for react-query's notify tick, as the Retry case already does: on main the click's notice reset (a #31333 object state) re-renders at once, while release's string state bails out on an unchanged empty value. (cherry picked from commit 757df49)
Problem / Motivation
Goal: After Switch All Sessions fails on some sessions, the panel names those sessions and says when its button would retry exactly them.
When a bulk model switch fails on some sessions, the panel says only "2 sessions failed to switch". Nothing tells the user which sessions kept their old model. The button then reads "Switch 2 sessions", so nothing says that pressing it retries those same sessions rather than switching some other one (#11231, tasks 3 and 4).
Why it matters
A failure the user cannot locate is one they cannot act on: today they have to open each session to find the ones still on the old model. A button that looks like a fresh switch also hides that it is a retry of the request that just failed.
Not a goal
What changed (motivation → approach → change)
Symptom: the failure notice was only a count, and the button after a failure looked like any other switch.
Root cause: the endpoint returns
failedas a list of slot keys, butwebsite/src/pages/chat-sidebar/bulkModelSwitch.tsxkept only its length, and the button label never knew that a failure had happened.Change:
2 sessions failed to switch2 sessions failed to switch: Refactor the auth middleware and Weekly report draftSwitch 2 sessionsRetry 2 failed sessionsSwitch N sessionsThe hook keeps the failed keys and the model they failed on, and builds the notice at render time, so a rename or a language switch while the panel is open shows up. Names and the retry check read every local live slot (
ChatSidebar.tsxpassesdashboard.slotsminus peer slots), because the backend also switches sessions the list hides, such as Crew Mode workers and member DMs. So the button reads as a retry only when the full request would touch exactly the failed sessions, its count is the failed set, and it stays enabled when every failure is a hidden worker. The notice is capped in height and scrolls (ErrorNotice'sscrollMessage), so a long list of names never pushes Cancel or Retry out of reach. Each name is whatsessionDisplayTitlereturns, so an untitled session reads "Untitled session", as it does on its row.i18n:
pages.chatSidebar.session_failed_to_switchgains a{{names}}list inen.manual.jsonand all 12 translated catalogs.pages.chatSidebar.retry_failed_sessionis a new plural key in the same catalogs and inpluralKeys.json. Both keys have translator context inen.context.json, anden-XAis regenerated. TheuseBulkModelSwitchrow of the owner table indocs/system-specs/modules/history.mdnames the new responsibility.Backwards compatibility
Compatible: copy and client state only. No API, setting or stored data changes.
Removes nothing: the notice key keeps its name and plural forms and only gains a placeholder. Every other label is unchanged.
Tests
website/src/test/ChatSidebarCoverage.test.tsx:names the sessions a partial failure missed and offers to retry them on the model that failed: the notice reads1 session failed to switch: Idle Aand the button readsRetry 1 failed session. Picking another model turns the button back intoSwitch 1 session, and picking the failed model again turns it back into the retry. Unticking Skip adds a session that did not fail, and the button readsSwitch 2 sessions. The test fails on main, and it fails with the model check removed.names a failed session the list hides, a Crew Mode worker, by its title: it fails when names are read from the visible list only, because the notice then says "Untitled session".Retry 2 failed sessions; a failure on a hidden worker alone keepsRetry 1 failed sessionenabled and resends the same model. Each of these fails with its production line reverted.On the final head the file ran green in 6 shuffled orders (
--sequence.shuffle, seeds 7 to 57).Determinism: the whole file ran ten times in shuffled order (
--sequence.shuffle, ten seeds) and was green every time.Also green: the i18n catalog suites (parity, QA, changed-value QA and the per-locale style tests with
I18N_BASE_REF, context sidecar, pseudolocale, plurals),npm run i18n:check,tsc -p tsconfig.app.json, eslint, the related sidebar and i18n test sets, and semgrep on the diff.Manual verification
I built the SPA and drove the panel in Chromium against stubbed APIs: three sessions, one of them running, with a model picked and the switch failing on the two idle ones. In English, German, Portuguese, Russian, Hindi and French the notice names both sessions, the button reads as the retry, and unticking Skip turns it into
Switch 3 sessions. At sidebar width the labels wrap without overflowing. The German and Russian retry labels take two lines.Screenshots / video
A partial failure (English): the notice names both sessions, and the button is the retry.
With Skip unticked, a session that did not fail is added, so the button is a plain switch again:
German, the longest retry label, at sidebar width:
Before the switch (English)
Related Issues
Closes #11231
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)