Skip to content

Fix workspace dialog accessibility and keyboard focus - #192

Merged
harshsaver merged 4 commits into
october-dev:mainfrom
SabyaXSachi:fix/dialog-accessibility
Nov 13, 2026
Merged

harshsaver merged 4 commits into
october-dev:mainfrom
SabyaXSachi:fix/dialog-accessibility

Conversation

@SabyaXSachi

Copy link
Copy Markdown
Contributor

Summary

Fixes #186 by improving accessibility and keyboard focus behavior for workspace dialogs.

Changes made

  • Added unique heading IDs to dialogs created through the shared modal() helper.
  • Associated each dialog with its visible heading using aria-labelledby.
  • Improved dialog closing and focus restoration behavior.
  • Added Playwright tests for accessible dialog names, keyboard navigation, Escape handling, Close button behavior, and destructive-action confirmation.
  • Regenerated the tracked browser bundle.

Additional change

Updated web/build.mjs to use fileURLToPath() for cross-platform output path handling. This fixes a Windows build issue without changing Linux build output.

Testing

  • npm run build passed.
  • npm test passed.
  • All 16 tests passed.

No new dependencies were introduced.

@harshsaver harshsaver left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 Agentbox PR audit: changes requested

What needs to change

Please apply the fix plan above.
n/a

What this PR changes

  • What it does: Gives workspace dialogs names that screen readers can identify, using their visible titles. Adds two browser tests and corrects a Windows build-path problem.
  • What changes in the product: Nothing visible in ordinary mouse use. Assistive technology can identify dialogs such as “New workspace” and “Revoke connection?”. The browser continues handling keyboard focus and Escape.
  • Why it exists: Harsh reported that dialogs had visible titles but could not be found by those names through accessibility tools. Issue #186.
  • Why merge (or why not yet): The naming fix is appropriate. Remove the unnecessary second attempt to restore focus, then verify the generated bundle and tests. CI has not executed for this PR: its run is waiting for a maintainer to approve it.
  • What to expect after merging: Dialog names become accessible. Merging closes #186 automatically, because the PR body says “Fixes #186”. The focus and announcement gaps described below remain and need their own issues if you want them tracked. This audit does not establish that every keyboard flow in #186 is complete.
Full audit (Claude (fable, xhigh) × Codex (gpt-6-astra, xhigh), 3 turns, commit ddb58e6)

PR audit: #192 — Fix workspace dialog accessibility and keyboard focus

Head: ddb58e6

Sign-off

  • Claude (fable, xhigh): ✅ satisfied — I re-verified Codex's corrections against source and accept them; decision, blocker and fix plan are unchanged, and this turn only adds evidence (Firefox and Safari also return focus natively; CI is confirmed waiting for approval).
  • Codex (gpt-6-astra, xhigh): ❌ not satisfied — retain the small focus-handling fix, but narrow the blocker’s claims and investigate unexpected test failures instead of automatically merging.

Decision

fix — remove the duplicate focus restoration, regenerate the browser bundle, and require passing checks; the naming and build-path changes are sound.

What changes (plain language)

  • What it does: Gives workspace dialogs names that screen readers can identify, using their visible titles. Adds two browser tests and corrects a Windows build-path problem.
  • What changes in the product: Nothing visible in ordinary mouse use. Assistive technology can identify dialogs such as “New workspace” and “Revoke connection?”. The browser continues handling keyboard focus and Escape.
  • Why it exists: Harsh reported that dialogs had visible titles but could not be found by those names through accessibility tools. Issue #186.
  • Why merge (or why not yet): The naming fix is appropriate. Remove the unnecessary second attempt to restore focus, then verify the generated bundle and tests. CI has not executed for this PR: its run is waiting for a maintainer to approve it.
  • What to expect after merging: Dialog names become accessible. Merging closes #186 automatically, because the PR body says “Fixes #186”. The focus and announcement gaps described below remain and need their own issues if you want them tracked. This audit does not establish that every keyboard flow in #186 is complete.

Findings

Blocking

  • web/src/app.js:129 and web/src/app.js:133 — remove the duplicate focus restoration.
    • The PR captures document.activeElement and calls opener.focus() in the dialog’s close listener.
    • Native modal dialogs already record the previously focused element and attempt to restore it without scrolling when they close. Restoration precedes delivery of the close event, including closure through Escape. HTML dialog algorithms.
    • Chromium independently confirms this in SetFocusForDialog(), close() and CloseWatcherFiredClose(). Its ScheduleCloseEvent() schedules the later event through the animation-frame event queue. Chromium dialog implementation.
    • Added in turn 3 — Firefox and Safari do the same. Both store the focused element unconditionally on showModal() and refocus it with prevent-scroll in close() when the dialog was modal, before queuing the close event. Removing the PR's copy therefore loses nothing in any engine. Gecko HTMLDialogElement.cpp, WebKit HTMLDialogElement.cpp.
    • In the existing synchronous opening paths, including New workspace (app.js:236) and Revoke (app.js:297), both captures occur after action() disables the trigger (app.js:41). None of the current dialog-building callbacks intentionally moves focus between the captures; the only other .focus() call in the app is at app.js:423. The PR does not recover a trigger already blurred before modal() runs.
    • This is a small, ruleset-based blocker: the additional restoration duplicates existing platform functionality without an established requirement. Keeping the native behavior meets the simplest-implementation rule and avoids maintaining a second focus policy.
    • Correction to turn 1 (verified in turn 3): a routine scroll regression is not established. Chromium's Element::Focus returns early, unconditionally, when the element is already focused. The HTML focus() steps do not make scrolling conditional on focus changing, so other engines may differ, but no regression was demonstrated. Chromium Element::Focus.
    • Correction to turn 1: the cited close(); await signedIn() paths at app.js:285, :547 and :569 do not explicitly direct focus elsewhere. A delayed callback could override an intervening focus change while its opener remains focusable, but those call sites do not demonstrate that regression. Nor does “queued for an animation frame” guarantee an exact one-frame delay.
    • Nuance added in turn 3: the delayed callback can run while a newer dialog is already open, in close(); secretDialog(...) (app.js:294-295) and in the new test's close-then-reopen sequence (spec.js:358-362). It is harmless there only because the opener is inert behind the new modal. This is no regression, but it is a second reason the extra call is better gone.
    • Remove the capture and the explicit .focus() call; retain dialog removal in the close listener. The proposed change still requires the browser checks below.

Non-blocking

  • web/src/app.js:126, :128, :130 — the accessible-name implementation is correct. Each helper invocation creates a distinct heading ID and connects the dialog to that heading. All dialog flows use the shared helper, directly or through secretDialog(). This follows the existing naming pattern at app.js:159 and the issue’s explicit collision requirement. Referencing the visible title through aria-labelledby is the documented dialog pattern. WAI-ARIA dialog guidance.

    • Checked in turn 3: the only other dynamic id in the page is the message card at app.js:356. Message IDs are server-generated with a msg_ prefix (bus/store.go:855), so they cannot collide with modal-title-N.
  • web/src/app.js:131 and :133 — centralizing removal in the close listener is reasonable. The replacement-key flow closes one dialog and immediately opens another (app.js:294 and :295), so the closed dialog can briefly coexist in the DOM with its replacement. Unique IDs handle that case. The stylesheet does not override the browser’s hidden state for closed dialogs (web/src/style.css:2). No caller depends on synchronous removal after close() returns.

  • web/build.mjs:3 and :6 — the path conversion is correct; keep it. fileURLToPath() handles Windows drive paths and decodes spaces and non-ASCII characters correctly. Using .pathname does not. This is a justified, small adjacent fix with no new dependency. Windows execution remains unverified; the workspace UI job runs on Ubuntu. Node URL documentation.

  • bus/hostedweb/app.js — the committed bundle matches the intended change on static inspection. The complete token-level diff contains the modified modal() and the consistent minifier rename chain Jr→Hr→Yr→Xr→Qr→Zr→es→ts→rs→ss→ns→is. No unrelated executable change or new network destination was found. It grows by 96 bytes, retains its file mode, and contains no CRLFs. The embedded HTML and stylesheet match their source files. Byte-exact build reproducibility still requires the build check.

  • .github/workflows/ci.yml:158 — CI exists but has not executed; its run is waiting for maintainer approval (verified in turn 3).

    • The GitHub Actions API lists one run for this head SHA: run 42286695093, workflow CI, event pull_request, head repository SabyaXSachi/agentintercom, status: completed, conclusion: action_required. The commit has zero check runs.
    • action_required on a fork pull request means no job started. This replaces turn 2's “unverified” note and confirms turn 1's explanation.
    • Approving the run looks safe. The workflow token is read-only (ci.yml:9-10), and the PR's only executable changes are the one-import edit in web/build.mjs and Playwright tests against mocked routes. The lockfile is untouched.
    • The configured workspace job installs dependencies, rebuilds, checks generated assets and runs Playwright (ci.yml:171 through :176). The author reports a successful build and 16 passing tests; there are indeed 14 existing tests and two additions. PR description.
  • web/tests/workspace.spec.js:346 and :369 — useful representative coverage, with limits. The additions check named dialogs, keyboard activation, initial focus, one Tab transition, Escape, Close, focus return and destructive-action confirmation.

    • locator.press() focuses its target before sending the key. Thus spec.js:363 and :384 verify activation but do not prove that sequential keyboard navigation reaches those controls. Playwright locator.press.
    • The role-based zero-count assertions at spec.js:359, :364 and :380 exclude hidden dialogs by default. They establish that the dialog is no longer exposed through that role lookup, not necessarily that its delayed removal listener has run. A DOM locator would be needed to assert actual removal. Playwright role selectors.
    • The tests cannot distinguish native restoration from the PR’s additional restoration. They remain useful unchanged after its removal.
    • Optional follow-ups: navigate to Close using Tab, assert focus after actual dialog removal, and check the names and heading IDs through the replacement-key transition at spec.js:205.
  • Existing focus gap: dialogs opened after asynchronous form submissions can lose their return target. form() and action() disable the submit button during the request (app.js:39 through :49). If that button had focus and the browser clears it before the response, modal() cannot recover the original target. Relevant paths are app.js:267, :271, :305 and :557. Submitting from the text field follows a different focus path. The platform test explicitly waits for rendering before checking that a disabled button has lost focus; this supports a timing-dependent gap, not a claim that every request reproduces it. Disabled-control focus test.

    • Successful actions that call render() also replace the page’s controls (app.js:236), discarding an opener to which focus may just have returned, without selecting a successor.
    • These behaviors predate the PR and were not reproduced here. They warrant targeted follow-up and prevent claiming that this change solves all focus-return cases.
  • Existing initial-focus concern: destructive confirmations initially focus their action button. Close is appended last (app.js:132), while confirmations put the destructive control first (app.js:115, :285, :297, :557). Initial focus therefore favors the destructive action; repeated Enter activation deserves a browser check. Guidance recommends considering the least destructive action for irreversible operations. Workspace deletion already requires typing its name (app.js:563). This is unchanged by the PR. WAI-ARIA initial-focus guidance.

  • Existing announcement gap: dialog feedback is placed outside the modal. #notice is outside every dialog (web/src/index.html:14), while Copy and error handling write there (app.js:66, :42, :567). Modal background content is inert and excluded from the accessibility tree, so these messages cannot be relied on for announcements while the dialog remains open. The backdrop also dims them visually. Screen-reader behavior was not tested. Inert content and accessibility.

  • Merge housekeeping (added in turn 3).

    • The PR allows maintainer edits (maintainerCanModify: true), so the fix commit can go on the contributor's branch.
    • After the fix, the PR body's line “Improved dialog closing and focus restoration behavior” no longer describes the change. Word the squash message around accessible names, the keyboard tests and the build-path fix.
  • Ruleset review: The change remains localized to the existing helper and build script, introduces no package or framework, adds no compatibility layer or migration, and preserves the existing architecture and confirmation flows. The unique counter directly serves an explicit requirement. The only identified implementation simplification required before merge is the duplicate focus restoration.

Fix plan

These steps are for Harsh or trusted CI. No contributor code was executed or modified during this audit.

  1. Establish the untouched-head baseline. In web/, using Node 24 and the locked Playwright browser without a CHROMIUM_PATH override, run:

    npm ci --ignore-scripts
    npm run build
    git diff --exit-code -- ../bus/hostedweb
    npx --no-install playwright install --with-deps chromium
    npm test

    Require a clean generated-asset diff and all 16 tests passing. Record the browser version and any failure.

  2. Change only the duplicate focus handling in web/src/app.js.

    • Delete const opener = document.activeElement; at line 129.
    • Replace the line 133 listener with:
      dialog.addEventListener('close', () => dialog.remove());
    • Keep the counter, heading ID, aria-labelledby and deferred removal. The resulting helper is:
      let modalCount = 0;
      function modal(title, build) {
        const headingId = `modal-title-${++modalCount}`;
        const dialog = el('dialog', { 'aria-labelledby': headingId }, el('h2', { id: headingId }, title));
        const close = () => dialog.close();
        dialog.append(build(close), el('div', { class: 'actions end' }, button('Close', close)));
        dialog.addEventListener('close', () => dialog.remove());
        document.body.append(dialog); dialog.showModal(); return dialog;
      }
  3. Regenerate bus/hostedweb/app.js. With the baseline dependencies installed, run npm run build in web/. Review and commit the source change and generated output together. Do not hand-edit the bundle. The repository documents the full regeneration command at docs/dependencies.md:38.

  4. Leave web/build.mjs and the existing tests unchanged. The optional test improvements above are follow-up work, not prerequisites for this two-line simplification.

  5. Verify the fixed version. Run npm test in web/; require all 16 tests to pass, including the focus assertions at spec.js:360, :365 and :381. Require the configured CI checks, including generated-asset verification, to pass against the fixed commit.

  6. Investigate contradictory results before deciding.

    • If the original passes but removing the manual restoration causes a focus assertion to fail, stop the handoff and reopen this finding with the browser version and failure trace. Establish what the manual call repairs before deciding whether to retain it or change the implementation.
    • If the untouched head fails, investigate the failure before recommending merge.
    • Supersedes turn 1’s gate: a failing experiment does not automatically authorize merging the original PR or establish the correct alternative implementation.

Message to the developer

Please apply the fix plan above.
n/a

Questions for Harsh

n/a

Verification

  • Independently read the full source and test changes, the surrounding application code and all dialog call sites, the complete browser test file, build script, package configuration, relevant lockfile entries, Playwright configuration, fixture server, HTML/CSS, embedded-asset serving code, workspace CI job, CODEOWNERS and dependency documentation.
  • The requested gh pr view 192 -R october-dev/october-bus --comments failed because this installed CLI queried deprecated Projects Classic fields. An explicit-field gh pr view --json succeeded: the head matches, the PR is mergeable but blocked, comments and reviews are empty, and no check results are listed.
  • gh issue view could not connect. Read issue #186 and its discussion through the GitHub web page, including the complete four-item acceptance checklist.
  • Read the full diff against 496d0d85b5febec72837971e55867d5aea7fcef2, including every changed token in the generated bundle. Used an inspection-only Python snippet to extract changed spans and compare byte sizes; it did not import or execute repository code.
  • git diff --check passed. File modes are unchanged. HTML/CSS comparisons passed. The bundle grew from 149,642 to 149,738 bytes and has no CRLFs.
  • Independently checked the HTML dialog algorithms, Chromium dialog and focus implementations, disabled-control handling and feature status, relevant web-platform tests, WAI-ARIA dialog guidance, Playwright selector/keyboard documentation and Node path conversion documentation.
  • Chromium’s current source marks AvoidSynchronousBlurOnDisabledAttributeChange stable. This supports the synchronous-opening analysis but does not identify the exact Chromium shipped with the pinned Playwright 1.64.1. The baseline check must establish that behavior. Chromium feature definitions.
  • Turn 3 re-checks (Claude):
    • Re-ran gh pr view --json: head is still ddb58e6, with no new comments, reviews or checks.
    • Read Element::Focus in Chromium's element.cc verbatim: the already-focused early return exists and is unconditional. CloseWatcherFiredClose() exists and calls the same close() that restores focus.
    • Read Gecko's and WebKit's HTMLDialogElement.cpp verbatim: both store and restore the previously focused element as described in the blocker. Their Escape-key dispatch sites and focus() internals were not read.
    • Queried the GitHub Actions API for the head SHA: one run, action_required, zero check runs.
    • Confirmed message IDs are server-generated (bus/store.go:855), that app.js:423 is the only other .focus() call, and that no dialog CSS overrides display.
    • Confirmed against the Playwright behaviour Codex cited that the reopened dialog in the new test cannot collide with the just-closed, not-yet-removed one, because role lookups skip hidden dialogs.
  • No installs, builds, tests, repository scripts, browser sessions or screen-reader tests were run, as required for this outside-contributor audit. Static reasoning and upstream tests are not a substitute for executing the project’s checks.
  • Checkout remains clean. No files were written and no GitHub mutation was performed. The revised audit is returned here.

Audit log

  • Turn 1 (Claude (fable, xhigh)): Audited from scratch. Confirmed the aria-labelledby and unique-ID fix against issue #186, verified the committed bundle token by token, and traced all dialog flows and existing tests. Found the PR's manual focus return redundant with native <dialog> (spec, Chromium source, WPT). Decision: fix (remove two lines, rebuild bundle, run suite with a gate). Logged three older accessibility gaps as follow-ups.
  • Turn 2 (Codex (gpt-6-astra, xhigh)): Independently verified the diff, call sites, tests, bundle and platform behavior. Retained fix, narrowed the blocking finding’s unsupported scroll/focus-regression claims, corrected CI and test-coverage overstatements, expanded the existing focus-gap notes, and replaced automatic merge-on-test-failure with investigation and re-review.
  • Turn 3 (Claude (fable, xhigh)): Verified Codex's two new Chromium claims from source and accepted all its corrections, including the investigate-first gate. Disputed only the “unverified” CI note: the Actions API shows the run for this head is action_required, so turn 1's explanation stands. Added Gecko and WebKit source confirmation of native focus return, the inert-opener nuance, the message-ID collision check and merge housekeeping. Decision, blocker substance and fix plan are unchanged.

Automated review by Harsh's agentbox: two AI reviewers audited this PR against the project ruleset and agreed on it.

Per maintainer review: remove the manual opener.focus() restoration, which
duplicates the platform behavior of modal dialogs, and regenerate the
committed bundle. Accessible names and keyboard tests are unchanged.
@harshsaver

Copy link
Copy Markdown
Member

Applied the review fix on this branch: removed the manual opener.focus() restoration so dialogs rely on the platform's native focus return, and regenerated the committed bundle with npm run build. Verified the untouched head first (bundle clean, 16/16 Playwright tests pass), then re-ran the suite after the fix (16/16 pass, including the focus assertions), merged current main, and pushed. Ready for re-review.

@harshsaver harshsaver added the agentbox: ready to merge Audited by Claude and Codex; Harsh can merge label Nov 13, 2026
@harshsaver
harshsaver dismissed their stale review November 13, 2026 04:26

Resolved: the audit of 6cef94e found the requested changes in place.

@harshsaver

Copy link
Copy Markdown
Member

🤖 Agentbox PR audit: ready to merge

What this PR changes

  • What it does: Gives workspace dialogs accessible names taken from their visible titles. Adds two tests exercising keyboard interaction and fixes a Windows build-path problem.
  • What changes in the product: Nothing visible in ordinary mouse use. Assistive technology can identify dialogs such as “New workspace” and “Revoke connection?”. The tested keyboard flows retain the browser’s focus and Escape behavior.
  • Why it exists: Harsh reported that dialogs displayed titles but accessibility tools could not find dialogs by those names. Issue #186.
  • Why merge (or why not yet): Harsh applied the previous audit’s requested simplification, rebuilt the bundle, and reports all 16 browser tests passing before and after. The code and bundle contain the expected fix. GitHub CI still awaits approval, and the old changes-requested review remains outstanding.
  • What to expect after merging: The naming problem is fixed, and “Fixes Workspace UI: give dialogs accessible names and predictable keyboard focus #186” in the PR description will close that issue on merge to main. Three older accessibility concerns remain below; this change does not resolve every focus-return scenario. The squash message should describe accessible names, keyboard tests and the build-path fix without claiming a new focus-restoration mechanism.
Full audit (Claude (fable, xhigh) × Codex (gpt-6-astra, xhigh), 2 turns, commit 6cef94e)

PR audit: #192 — Fix workspace dialog accessibility and keyboard focus

Head: 6cef94e

Sign-off

  • Claude (fable, xhigh): ✅ satisfied — the one blocker from the last round is fixed exactly as planned, the regenerated bundle checks out token by token, and nothing new blocks; GitHub CI has still not run on this head.
  • Codex (gpt-6-astra, xhigh): ✅ satisfied — independently verified the fix, bundle and merge; no new blocker, with only non-blocking wording and evidence clarifications needed.

Decision

merge — the duplicate focus handling is gone, the remaining change is small and correct, and no blocking finding is left; merge once the waiting CI run is approved and passes.

What changes (plain language)

  • What it does: Gives workspace dialogs accessible names taken from their visible titles. Adds two tests exercising keyboard interaction and fixes a Windows build-path problem.
  • What changes in the product: Nothing visible in ordinary mouse use. Assistive technology can identify dialogs such as “New workspace” and “Revoke connection?”. The tested keyboard flows retain the browser’s focus and Escape behavior.
  • Why it exists: Harsh reported that dialogs displayed titles but accessibility tools could not find dialogs by those names. Issue #186.
  • Why merge (or why not yet): Harsh applied the previous audit’s requested simplification, rebuilt the bundle, and reports all 16 browser tests passing before and after. The code and bundle contain the expected fix. GitHub CI still awaits approval, and the old changes-requested review remains outstanding.
  • What to expect after merging: The naming problem is fixed, and “Fixes Workspace UI: give dialogs accessible names and predictable keyboard focus #186” in the PR description will close that issue on merge to main. Three older accessibility concerns remain below; this change does not resolve every focus-return scenario. The squash message should describe accessible names, keyboard tests and the build-path fix without claiming a new focus-restoration mechanism.

Findings

Blocking

None.

The previous blocker is resolved. Commit 6f3dbaf removes the opener capture and explicit opener.focus() call, changing only web/src/app.js and its generated bundle. The helper at web/src/app.js:126 matches the previous fix plan.

Chromium’s current implementation records the focused element, attempts to restore it without scrolling when the modal closes, and uses the same close operation for Escape. The application now relies on that behavior. Gecko and WebKit were also inspected in the previous audit. Chromium dialog implementation.

Non-blocking

  • GitHub CI remains a merge precondition.

    • The current CI run, 43327606457, explicitly says it awaits maintainer approval and reports “Action required”. Codex independently verified that page; gh pr view --json also reports an empty statusCheckRollup.
    • Claude’s turn-1 Actions API query reported one run for this head, with conclusion: action_required, and zero check runs. Codex’s REST API request could not connect; the run page independently confirms the approval requirement.
    • .github/workflows/ci.yml:158 configures the workspace job. It installs locked dependencies, rebuilds, checks generated assets and runs Playwright (ci.yml:171 through :176). The workflow token is read-only (ci.yml:9); neither the workflow nor dependency manifests changed in this PR.
    • Require the configured checks to pass on the final head before merging. No new CI configuration is needed.
  • Harsh reports the expected before-and-after test results; these are reported results, not reviewer-observed runs.

    • His November 12 comment states that the untouched head rebuilt without an asset diff and passed all 16 tests, followed by another 16/16 after removing manual restoration, including the focus assertions. Maintainer verification report.
    • That supports the previous fix plan’s expected empirical outcome. The comment does not identify the browser version or whether CHROMIUM_PATH was set; the configured CI run supplies the remaining reproducible check.
    • “No machine check has run” would be too broad: local machine runs are reported, while GitHub CI has not executed.
  • GitHub still reports CHANGES_REQUESTED. The November 6 review targets ddb58e6, before the fix. The current PR remains MERGEABLE but BLOCKED. The stale review needs resolving through the repository’s review process; it is not evidence of an unresolved code defect on this head.

  • The merge of main introduces no additional PR changes.

    • 6cef94e has parents 6f3dbaf and 2604d00.
    • git diff 6f3dbaf HEAD -- web bus/hostedweb is empty.
    • Relative to current base 2604d00, only the four intended PR files differ.
    • Between old base 496d0d8 and current base 2604d00, there are no changes in web/, bus/hostedweb/, .github/, docs/dependencies.md, bus/hosted_web.go or bus/hosted_web_test.go.
    • Harsh’s browser-test results therefore remain relevant to identical web files after the merge. They do not replace final CI for the merged tree.
    • The existing browser-asset Go test checks successful responses and security headers (bus/hosted_web_test.go:14), not dialog names or focus.
  • bus/hostedweb/app.js — the generated change is consistent with source on static inspection.

    • The complete token-level comparison against 2604d00 contains the modified helper and the consistent minifier rename chain Jr→Hr→Yr→Xr→Qr→Zr→es→ts→rs→ss→ns→is.
    • Against previously audited ddb58e6, the changes are the removed focus capture/restoration and corresponding local-variable renames.
    • No unrelated executable change or new network destination was found.
    • The file is 149,685 bytes, versus 149,642 at base: a 43-byte increase. File modes are unchanged, no CRLFs were found, and git diff --check passes.
    • Embedded HTML and CSS are byte-identical to their source files. CI’s rebuild-and-diff step remains the check for byte-exact bundle reproducibility.
  • web/src/app.js:126, :128, :129 — accessible naming is correct.

    • Each helper invocation creates a distinct heading ID and references it through aria-labelledby.
    • All dialog openings use modal(), directly or through secretDialog() at app.js:135.
    • This follows the existing pattern at app.js:158 and the issue’s explicit requirement to avoid collisions.
    • The message-card IDs at app.js:355 use server-generated msg_ identifiers (bus/store.go:855), distinct from modal-title-N.
    • Referencing the visible title is the documented dialog naming pattern. WAI-ARIA dialog guidance.
  • web/src/app.js:130 and :132 — centralizing removal in the close listener is sound.

    • Base removed the dialog both synchronously and in its close listener. The revised helper removes it through the listener.
    • Closed dialogs remain hidden until removal; the application’s dialog CSS does not override display (web/src/style.css:2).
    • The replacement-key flow closes one dialog and immediately opens another (app.js:293 and :294). Unique heading IDs accommodate their temporary coexistence, and no caller relies on immediate DOM removal.
    • The existing secret-key test asserts that its text disappears from the DOM after Close (web/tests/workspace.spec.js:201 and :202), covering removal rather than merely hidden state.
    • Chromium queues the close event through its animation-frame event machinery. Removal can consequently be delayed, especially when rendering is suspended. No functional regression was found; exact background-tab timing was not tested. Chromium close-event scheduling.
  • web/build.mjs:3 and :6 — the path fix is appropriate. fileURLToPath() handles Windows drive paths and decodes spaces and non-ASCII characters correctly, unlike .pathname. It adds no dependency. Windows execution remains unverified because the workspace job runs on Ubuntu. Node URL documentation.

  • web/tests/workspace.spec.js:346 and :369 — representative coverage is useful, with established limits.

    • The additions verify dialog names, keyboard activation, initial focus, one Tab transition, Escape, Close, focus return and destructive confirmation.
    • They are unchanged from the previous round. With manual restoration removed, assertions at :360, :365 and :381 check the native return behavior in these flows.
    • locator.press() focuses its target first. Thus :363 and :384 verify activation without proving that Tab reaches those controls. The confirmation test also uses a mouse click to navigate to Members & devices during setup. Playwright keyboard API.
    • Role-based zero-count assertions at :359, :364 and :380 skip hidden elements, so they do not establish DOM removal. Playwright role selectors.
    • Optional follow-ups remain: navigate to Close with Tab and assert the names and distinct heading IDs through the replacement-key flow at :205.
  • Older focus gap, unchanged: asynchronous submission and page replacement can lose the useful return target.

    • action() disables the submit control during a request (app.js:39 through :49). If that control had focus and the browser clears it before the dialog opens, the helper cannot recover the original target. Relevant openings are at app.js:266, :270, :304 and :556.
    • Submitting while focus remains in a text field avoids that particular disabled-button path; it does not guarantee every subsequent focus transition.
    • Successful actions calling render() replace the opener through root.replaceChildren() at app.js:235, without explicitly choosing a successor.
    • These paths predate the PR and were not reproduced in this audit. They remain follow-up work rather than regressions introduced here.
  • Older initial-focus concern, unchanged: destructive confirmations focus their action first. Close is appended last (app.js:131), while the destructive buttons precede it at app.js:115, :284, :296 and :556. Workspace deletion already requires typing the name (app.js:562). Consider focusing the least destructive action in a separate change, consistent with the guidance for irreversible operations. WAI-ARIA initial-focus guidance.

  • Older announcement gap, unchanged: feedback is outside the modal. #notice sits outside every dialog (web/src/index.html:14), and Copy or validation errors write there (app.js:66, :42, :566). That content is inert and visually dimmed while a modal is open, so its announcements cannot be relied on. No screen-reader test was performed; exact spoken output should not be claimed. Inert content and accessibility.

  • Ruleset review: The implementation remains localized and modular, uses the existing native dialog helper, adds no dependency or compatibility layer, and preserves explicit confirmation flows. The counter directly serves the unique-ID requirement. Removing the duplicate focus policy resolves the previous simplicity concern without introducing a temporary architecture.

Fix plan

n/a

Message to the developer

n/a

Questions for Harsh

n/a

Verification

  • Current PR state: Explicit-field gh pr view --json succeeded. Head is 6cef94e; the PR is open, not a draft, MERGEABLE and BLOCKED, with an empty check rollup and CHANGES_REQUESTED. Read Harsh’s new comment and the existing review; no contributor reply is present.
  • CLI limitations: The requested gh pr view --comments failed on deprecated Projects Classic fields. REST Actions queries and gh issue view could not connect. Read the issue and current Actions run through their web pages instead.
  • Commit comparison: Reviewed the full current PR diff against 2604d00 and the incremental source/bundle change from ddb58e6. Verified the fix commit’s author, scope and merge parents. Confirmed the merge adds no changes to the web files and that relevant build, test and serving files are unchanged from the previously reviewed versions.
  • Code review: Re-read the current helper, all dialog-opening paths, asynchronous action/form handling, page replacement, confirmation and error paths, relevant tests, build/configuration files, HTML/CSS, message-ID generation and the embedded-asset Go test. Previously reviewed unchanged code was checked through Git comparisons.
  • Static checks: Complete token-level bundle comparisons against both bases; byte-size and CRLF inspection; file-mode comparison; git diff --check; and byte comparisons of embedded HTML/CSS. All matched expectations. The inspection-only Python snippet read repository text; it did not import or execute contributor code.
  • External checks this turn: Re-read Chromium’s focus storage, restoration, Escape handling and event scheduling; Node path conversion; Playwright keyboard/role-selector behavior; WAI-ARIA dialog guidance; inert-content documentation; and issue Workspace UI: give dialogs accessible names and predictable keyboard focus #186’s checklist.
  • Reported execution: Harsh reports a clean baseline bundle and 16/16 tests before and after the fix. The current web files are identical to the fixed files before merging main. Reviewers did not reproduce those results.
  • Required before merge: Run the waiting CI workflow on the final head, including dependency installation, build, generated-asset comparison and all 16 Playwright tests. Resolve any failures before merging, and resolve the stale changes-requested review.
  • Not executed: No installs, builds, tests, repository scripts, browser sessions or screen-reader sessions, in accordance with the outside-contributor restriction.
  • Checkout: git status --short remains clean. No files were written and no GitHub mutation was performed. The revised audit is returned here.

Audit log

  • Earlier rounds on ddb58e6 (three turns, Claude and Codex): decision was fix — remove the duplicate focus restoration at web/src/app.js:129,133, regenerate the bundle and run the suite with an investigate-first gate. Naming, deferred removal, build-path change and bundle were found sound; three older accessibility gaps were logged as follow-ups.
  • Turn 1 (Claude (fable, xhigh)), head 6cef94e: Re-audited from scratch. Confirmed Harsh's commit 6f3dbaf applies the fix plan exactly, the merge of main is clean and touches no web files, and the regenerated bundle matches source token by token with the expected 43-byte growth. Re-verified native focus return in Chromium source and found the CI run for this head still action_required. No blocking findings; decision changed from fix to merge. Carried the three older gaps forward as non-blocking and added the stale changes-requested review and squash-message notes.
  • Turn 2 (Codex (gpt-6-astra, xhigh)), head 6cef94e: Independently verified the incremental fix, complete current PR diff, generated bundle, unchanged web files across the main merge, maintainer test report and waiting CI run. Agreed with merge and found no new blocker. Refined only non-blocking evidence and wording concerning reported test execution, keyboard coverage, background-event timing and existing accessibility limitations.

Final checks

Not run here: this PR is from an outside contributor, so its code is never executed on this machine. Rely on CI before merging.

Automated review by Harsh's agentbox: two AI reviewers audited this PR against the project ruleset and agreed on it.

@harshsaver harshsaver left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved after the Claude x Codex audit agreed it is ready (audited head 6cef94e, current; CI green).

@harshsaver harshsaver left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved after the Claude×Codex audit agreed it is ready (audited head 6cef94e; this head only adds a merge of main).

@harshsaver harshsaver left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved after the Claude×Codex audit agreed it is ready (audited head 6cef94e; this head only adds a merge of main).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentbox: ready to merge Audited by Claude and Codex; Harsh can merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workspace UI: give dialogs accessible names and predictable keyboard focus

2 participants