Skip to content

fix(a11y): keep focus on the knowledge Generate now while it runs - #32539

Merged
RohanK6 merged 1 commit into
mainfrom
crew/conductor/r630-embedding-generate-focus
Nov 7, 2026
Merged

RohanK6 merged 1 commit into
mainfrom
crew/conductor/r630-embedding-generate-focus

Conversation

@RohanK6

@RohanK6 RohanK6 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: pressing Generate now on the Knowledge page's smart-search banner from the keyboard keeps focus on the button while the embedding run is in flight, instead of dropping it to the page.

The button took a native disabled while the run was pending. A disabled button leaves the tab order, so focus fell to the page until the run settled.

Why it matters

A keyboard or screen-reader user who starts the run loses their place and cannot tell where focus went.

Not a goal

What changed (motivation → approach → change)

Symptom: focus drops on Generate now. Cause: native disabled while pending. Change: website/src/pages/knowledge/EmbeddingStatus.tsx marks the busy button aria-disabled with a dimmed style and guards the click, so a second press does nothing, the way the Ops Mission Control refresh does (#32049). Its "Generating…" label is unchanged.

Backwards compatibility

Compatible: the button reads and is named as before; a second press while the run is in flight still starts nothing.

Removes nothing.

Tests

  • website/src/test/EmbeddingStatusCov80.test.tsx: a new case focuses Generate now, presses it while the run is held open, checks it is aria-disabled and not disabled, keeps focus, starts no second run, then keeps focus once the run settles. It fails on main (the busy button was disabled), and it also fails with the click guard removed. All 227 tests in the Knowledge and banner suites pass.

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

Local review: GPT (on gpt-5.6-sol, CI pins gpt-6.1-sol) and Opus (on the session's Auto model): no findings. Opus's one discovery note, that the second-press assertion could pass without the guard, was hardened anyway with a microtask flush.

Manual verification

N/A — unit coverage sufficient: the change is focus and ARIA state, covered by the test above.

Why no screenshot: the busy button keeps its "Generating…" label; only its focusability, ARIA state and a light dim change.

Related Issues

Fixes #32531

Deferred: #32532 (item save, Restore/Archive, Delete and ignore-pattern Save on the Knowledge page)

Sibling sweep

Swept: git grep -n "disabled={" -- website/src/pages/knowledge
Sibling: website/src/pages/knowledge/EmbeddingStatus.tsx -- fixed -- Generate now
Sibling: website/src/pages/knowledge/DetailView.tsx -- deferred -- save, Restore/Archive, Delete, Deferred: #32532
Sibling: website/src/pages/knowledge/IgnorePatternsEditor.tsx -- deferred -- Save, Deferred: #32532
Sibling: website/src/pages/knowledge/KnowledgeGraph.tsx -- deferred -- Retry unmounts during its retry, noted in #32532

Pattern harvest

Not generalizable: the remaining sites are listed in #32532.

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

Contribution License Agreement

Contributed under the Apache-2.0 license of this project.

The smart-search banner's Generate now button took a native disabled
while its embedding run was in flight. A disabled button leaves the
tab order, so a keyboard press dropped focus to the page until the
run settled. Mark the busy button aria-disabled and ignore a second
press instead, the way the Ops Mission Control refresh does.
@RohanK6
RohanK6 requested review from a team and KiroCrewCaptain as code owners November 7, 2026 19:11
@RohanK6
RohanK6 requested a review from tim-finnigan November 7, 2026 19:11
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] b73620e

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

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of b73620eac396c9f8741108071f752fb12add6c82 — 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. This is a one-button fix that uses the inline aria-disabled idiom already found at 30+ sites. The siblings it leaves unfixed are named and deferred to #32532.

What this change ships

Inventory (3 items) — 3 justified

Intent: a keyboard user who presses Generate now keeps focus on the button while the embedding run is in flight. FIX.

  1. While the run is pending, the busy Generate now button stays in the tab order and keeps focus instead of losing it to the page — justified
  2. A second press during the run still starts nothing, now enforced by a click guard instead of native disabled — justified
  3. The busy button dims and its cursor changes to the default pointer while the run is in flight — justified

[FIRST-PRINCIPLES-REVIEWED] b73620e

Description read

[DESCRIPTION-READ] 51487adcc632ec5bcfa793a854437bafa7b873d659879e8c105d07da9519fe79

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

UX-Verdict: PASS

cannot evaluate: missing a screenshot of Generate now in its busy "Generating…" state. The diff adds a visible dim to that state, and the PR supplies no image, so the blind read was not performed.

Evidence gaps

  • Busy "Generating…" state of Generate now (EmbeddingStatus.tsx, new aria-disabled:opacity-50 aria-disabled:cursor-default): the description says "only its focusability, ARIA state and a light dim change". The dim is a pixel change to a control the user presses, and no image shows it. The blind-read report says: "BLIND READ NOT PERFORMED: the PR description carries no image attachment". Nobody has judged whether the 50%-opacity accent underline still reads as a busy link or as broken, faded text in the banner. To close the gap, attach two stills of the smart-search banner, one idle ("Generate now") and one mid-run ("Generating…", dimmed), in either theme.

Notes

  • The <!-- no-visual-delta --> marker contradicts the PR's own "a light dim change". Drop the marker, or drop the dim so the busy state looks the same as before.

[UX-REVIEWED] b73620e

Description read

[DESCRIPTION-READ] 965195ffd6d6cbee8c10547c496792405f76da8f2cd489df5799e1537ca7de7f

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

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the fix removes the actual cause (native disabled taking the button out of the tab order) and copies the existing Mission Control refresh fix (#32049), with the remaining sites deferred to #32532.

Notes

[DESIGN-REVIEWED] b73620e

Description read

[DESCRIPTION-READ] 1fef12b9e0d6f8baad6f3eb5ab344b17080c7013e464b8b6d33e93905fd29778

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] b73620e

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

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

@github-actions github-actions Bot added the readiness: passed Eligible automated validation passed for the current revision label Nov 7, 2026
@RohanK6
RohanK6 enabled auto-merge (squash) November 7, 2026 19:52

@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 at b73620e. All checks pass and there are no change requests. The author already holds auto-merge, so I am not setting it.

What I checked:

  • The knowledge "Generate now" link-button uses aria-disabled plus an if (!isPending) guard instead of native disabled. It keeps keyboard focus while the run is in flight, and a second press starts nothing.
  • It now sets type="button", so it cannot submit an enclosing form. The busy look comes from aria-disabled: classes.
  • Frontend only. No regex.

@RohanK6
RohanK6 merged commit e492bc0 into main Nov 7, 2026
97 of 106 checks passed
@RohanK6
RohanK6 deleted the crew/conductor/r630-embedding-generate-focus branch November 7, 2026 20:03
buluoray added a commit that referenced this pull request Nov 8, 2026
…2539)

The smart-search banner's Generate now button took a native disabled
while its embedding run was in flight. A disabled button leaves the
tab order, so a keyboard press dropped focus to the page until the
run settled. Mark the busy button aria-disabled and ignore a second
press instead, the way the Ops Mission Control refresh does.

(cherry picked from commit e492bc0)

Original author: Rohan Khanderia (#32539).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Knowledge: the smart-search Generate now button drops keyboard focus while it runs

2 participants