Skip to content

fix(system): keep focus on the sessions stale-rows Retry while it runs - #32879

Merged
RohanK6 merged 1 commit into
mainfrom
crew/conductor/sessions-stale-retry-focus
Nov 8, 2026
Merged

RohanK6 merged 1 commit into
mainfrom
crew/conductor/sessions-stale-retry-focus

Conversation

@RohanK6

@RohanK6 RohanK6 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: On System > Sessions, the "can't refresh" banner's Retry keeps keyboard focus while it runs, and the failure reads through ErrorNotice.

In website/src/pages/system/SessionsTab.tsx, when a background read fails after rows loaded, the sessions-stale banner shows over the old rows with a Retry button that sets native disabled while isFetching. The banner stays mounted during the retry (react-query keeps isError with the old data), so the focused button leaves the tab order and focus drops to the page. The banner text was a hand-written warning span, so this failed read had no agent hand-off.

Why it matters

A keyboard or screen-reader user watching the sessions table loses their place each time they retry a failed refresh, and the failure offers no way to hand it to the agent.

Not a goal

  • The full-panel "could not read sessions" Retry (no rows yet): that panel unmounts while the retry runs, so there is no focus to keep there.
  • The Retry / Retrying… labels and the 5s poll are unchanged.

What changed (motivation → approach → change)

Backwards compatibility

Compatible: same banner text, same Retry; a press while busy is still ignored.

Removes nothing: no route or key is taken away; the sessions-stale test id stays on the banner.

Tests

website/src/test/SessionsTab.staleRetry.test.tsx (new): seeds the cache with rows, lets the mounted read fail so the banner shows (no timers, no sleeps), then checks the failure text sits in the banner, Retry keeps focus while busy, a second press sends no second read, and focus is still there after it settles. It fails on main (run in a separate worktree) and passes here.

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

vitest run src/test/SessionsTab src/test/System: 65 passed. tsc -p tsconfig.app.json and eslint: clean. Local GPT 5.6 Sol: one finding (this banner bypassed ErrorNotice), fixed here. Local Opus 5.5: no findings.

Manual verification

Captured in Chromium against the real SessionsTab with a stubbed /api/sessions/memory (read 1 rows, read 2 fails, read 3 held), Retry focused and pressed with Enter. Focus while retrying: main BODY; this branch BUTTON "Retrying…".

Screenshots / video

Before (main), dark: the banner, then after a keyboard Retry (focus has left the button):

before banner
before retrying

After, dark: the banner through ErrorNotice with its hand-off, then Retrying… still holding focus (focus ring on the button):

after banner dark
after retrying dark

After, light

after banner light
after retrying light

Images were committed once at 9d274d3 and are not in the final commit.

Related Issues

Fixes #32878

Sibling sweep

Swept: git grep -nE "disabled={[^}]*(isFetching|refreshing)" -- website/src/pages/system website/src/pages/SystemPage.tsx (run on origin/main)
Sibling: website/src/pages/system/SessionsTab.tsx -- changed here
Siblings: none other -- the second hit in SessionsTab.tsx is the no-rows panel Retry, which unmounts during the retry

Pattern harvest

Rule candidate: none
Pattern: a busy button that sets native disabled on itself while it stays mounted and focused.

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

@RohanK6
RohanK6 requested review from a team and KiroCrewCaptain as code owners November 8, 2026 03:14
@RohanK6
RohanK6 requested a review from tim-finnigan November 8, 2026 03:14
@RohanK6
RohanK6 enabled auto-merge (squash) November 8, 2026 03:14
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of fa7668d392def1c580d24a811fcafa1ae66a65d2 — 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 blocks. The fix is at the mechanism level and has a regression test that fails on main. The ErrorNotice switch is required by the website/AGENTS.md errors-use-error-notice rule.

What this change ships

Inventory (3 items) — 3 justified

Intent: let a keyboard or screen-reader user retry a failed sessions refresh without losing focus — FIX (#32878).

  1. The stale-rows Retry keeps focus while it is retrying, and a second press does nothing — justified
  2. The "can't refresh" banner now shows as the standard inline error line, with "Ask the agent", instead of the warn-tinted band — justified
  3. A new regression test pins focus, the ignored second press and the kept rows — justified

[FIRST-PRINCIPLES-REVIEWED] fa7668d

Description read

[DESCRIPTION-READ] 43bd93cf046cf0b4d7c86c19bc18f955523edf305385fe7dcfc937a04cffc72f

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 8, 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 fa7668d392def1c580d24a811fcafa1ae66a65d2 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

cannot evaluate: missing screenshots of the changed stale-rows banner. The PR description's images show as "[image removed]", nothing is committed under temp-screenshots/ or .github/screenshots/, and so the blind read was not performed.

Evidence gaps

  • The sessions-stale banner, which now renders through ErrorNotice. The description says "the warn-tinted band becomes the standard inline error line". A screenshot of the banner over loaded rows, in dark and light, would close this gap.
  • The new "Ask the agent" button inside the banner. No supplied screenshot shows it, so nobody checked whether a first-time user can read it or tell it apart from Retry. Close it with the same banner screenshot, showing both buttons on one row.
  • Retry while busy: the "Retrying…" label, focus ring and aria-disabled:opacity-30 dimming. Close it with a screenshot of the focused Retry in that state.
  • The images from commit 9d274d3. The description says they were committed there, but they are not part of this revision, so they don't count as evidence here. Attach them to the PR description as github.com/user-attachments images.

[UX-REVIEWED] fa7668d

Description read

[DESCRIPTION-READ] a4d4c756bf35238e32867e373969047b3647c69e91d74fbba759348262cec5c9

That sha256 names everything this verdict read: the PR description, plus the 3 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 8, 2026 •

Copy link
Copy Markdown
Contributor

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

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

Design-Verdict: PASS

cannot evaluate: missing a screenshot of the restyled sessions-stale banner. The description says this is a visible change, and the evidence list for this revision has no images.

Blockers

Reshaped banner has no rendered evidence of this revision
Trigger: the diff swaps the warn-tinted band ("bg-warn-subtle ... text-warn-text" + TriangleAlert) for "<ErrorNotice variant="inline" askAgent className="flex-1 min-w-0" .../>" next to Retry; the description says "This is a visible change: the warn-tinted band becomes the standard inline error line with its 'Ask the agent' hand-off."
Outcome: the description's image links are removed, design-evidence.txt lists 0 downloaded attachments and 0 committed images, and the description says "Images were committed once at 9d274d385d and are not in the final commit" → nothing shows this head SHA → no one can judge how ErrorNotice, its Ask-the-agent control and the Retry button share one row in dark or light themes.
Fix: attach before and after screenshots (dark and light) as github.com/user-attachments assets, or commit them under temp-screenshots/ in this revision.
Clears when: the evidence list for this revision names a downloaded image, or a committed image, of the sessions-stale banner rendered through ErrorNotice with Retry beside it.

[DESIGN-REVIEWED] fa7668d

Description read

[DESCRIPTION-READ] de469ca428ad92fb066e346aa3ad82916134ed73bc9d5f6a8116224218068918

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 8, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

Notes:

  • The stale-banner ErrorNotice passes a reworded UI message and no report. findReport therefore finds no journal entry, and the hand-off sends the agent only that sentence. Destructuring error and passing report={reportForError(error)} would include the endpoint and status.

[OPUS-REVIEWED] fa7668d

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

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

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] fa7668d

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

@RohanK6
RohanK6 force-pushed the crew/conductor/sessions-stale-retry-focus branch from a287579 to 9d274d3 Compare November 8, 2026 03:29
@RohanK6
RohanK6 force-pushed the crew/conductor/sessions-stale-retry-focus branch from 9d274d3 to fa7668d Compare November 8, 2026 03:30
@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 8, 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.

Approving. The change is small and does what the title says: the stale-rows Retry in SessionsTab.tsx now uses aria-disabled plus a guard in onClick instead of the native disabled, so a keyboard user keeps focus on the button while the retry runs. A second press during the retry is ignored.

What I checked:

  • Gate: 101 ok, 0 pending. Six checks show red (GPT 6.1 Review, Inclusive Language, SAST (Semgrep), Automated Rule Check, PR Policy, PR Hygiene). Each is an older cancelled duplicate, and I listed the check runs on this head: every one has a newer run of the same name that passed.
  • The banner now goes through ErrorNotice with the agent hand-off, which is how the rest of the dashboard shows a failed read. The Retry text and the could_not_refresh string are unchanged.
  • The new test SessionsTab.staleRetry.test.tsx covers focus staying on the button, the aria-disabled state, the ignored second click, and the old rows staying visible. It uses no timers.
  • No regex in the added code.

Not checked: I did not run the tests or the page in a browser, and I did not read the ErrorNotice inline layout line by line.

I did not set auto-merge, because it is already set on this PR.

@RohanK6
RohanK6 merged commit cc68193 into main Nov 8, 2026
103 of 109 checks passed
@RohanK6
RohanK6 deleted the crew/conductor/sessions-stale-retry-focus branch November 8, 2026 04:14
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 8, 2026
buluoray added a commit that referenced this pull request Nov 8, 2026
buluoray added a commit that referenced this pull request Nov 8, 2026
buluoray added a commit that referenced this pull request Nov 8, 2026
buluoray added a commit that referenced this pull request Nov 8, 2026
buluoray added a commit that referenced this pull request Nov 8, 2026
buluoray added a commit that referenced this pull request Nov 8, 2026
buluoray added a commit that referenced this pull request Nov 8, 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.

System > Sessions: the stale-rows Retry drops keyboard focus while it runs

2 participants