Skip to content

fix(widget): keep the closed popup out of the tab order and close it with escape - #173

Merged
anurag629 merged 2 commits into
codercops:devfrom
prakashNalla:fix/popup-panel-a11y
Oct 19, 2026
Merged

anurag629 merged 2 commits into
codercops:devfrom
prakashNalla:fix/popup-panel-a11y

Conversation

@prakashNalla

Copy link
Copy Markdown
Contributor

What does this change?

In popup mode the closed panel and the hidden welcome bubble now have inert and aria-hidden="true", removed when they show, so they're out of the tab order and the accessibility tree. The popup panel is a role="dialog" with the branding name as aria-label, Escape inside it closes it, and if focus was inside the panel when it closes it goes back to the FAB. The FAB has aria-expanded and aria-controls="cc-panel". Inline mode gets none of this and works as before.

Closes #59

How I tested this

  • pnpm -r build, pnpm -r typecheck and pnpm test (30 files / 309 tests pass), on Node v22.23.3 with pnpm 9.15.0
  • Added 6 tests in panel.test.ts, fab.test.ts and widget.test.ts for the panel and bubble attributes, the FAB's aria-expanded/aria-controls, Escape closing the popup with focus back on the FAB, and the inline panel staying as it was. The 5 popup ones fail without the change.
  • Ran dev.html in headless Chrome and pressed Tab through the page. With the popup closed, Tab goes from the page buttons to the FAB and the bubble's dismiss button, and skips the panel. After opening it, Tab reaches the panel's close button and the form. Escape closed it and focus was back on the FAB. The panel still fades in and out (opacity read 0.59 mid-close). In ?mode=inline Tab goes through the inline form as before.

AI assistance

Claude helped me understand the core issue.

Checklist

  • This PR targets dev
  • I was assigned the linked issue
  • pnpm -r build, pnpm test and pnpm -r typecheck pass locally
  • Tests added or updated where it makes sense
  • For a bug fix: the new test fails without my change
  • Changeset added (pnpm changeset) if this changes core, widget or server
  • Docs updated if behavior or options changed

@anurag629 anurag629 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.

Thanks @prakashNalla, this does everything #59 asks. On top of current dev, build, typecheck and all 321 tests pass, and your five popup tests fail without the change. In Chrome the closed panel is inert and hidden, Tab goes from the page to the launcher and skips the panel, opening it puts focus in the input with aria-expanded="true", and Escape closes it and puts focus back on the launcher. The fade still works, and inline mode is unchanged. Merging.

@anurag629 anurag629 added the hacktoberfest-accepted PR counts for Hacktoberfest label Oct 19, 2026
@anurag629
anurag629 merged commit 58a4511 into codercops:dev Oct 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted PR counts for Hacktoberfest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the closed popup panel from the tab order and close it with Escape

2 participants