Skip to content

fix(site): mark emoji picker category labels as headings - #32189

Closed
aqandrew wants to merge 3 commits into
mainfrom
a11y/semantic-heading-emoji-picker
Closed

aqandrew wants to merge 3 commits into
mainfrom
a11y/semantic-heading-emoji-picker

Conversation

@aqandrew

Copy link
Copy Markdown
Collaborator

The emoji picker's category labels ("Smileys & emotion", "Food & drink", ...) look like section headings but were plain text, so screen reader users could not list them or jump between them. Frimousse renders those labels inside its role="grid", and a grid may only own rows, so a bare h2 there fails axe aria-required-children. This PR extends the existing site/patches/[email protected] so that Frimousse treats category headers as real grid rows. It also changes EmojiPicker to wrap each label in an h2.

Patch changes (minified dist/index.js and dist/index.cjs):

  • Each category wrapper is a role="row", and its header is a role="gridcell". Header rows count toward aria-rowcount and aria-rowindex, and the keyboard scroll lookup uses the new numbering.
  • Each category renders right before its first emoji row. Before, all categories rendered after the rows, so headings came last in reading order.
  • zIndex: 1 on the category wrapper. The rows use contain: content, so they paint like positioned elements, and without it the sticky headers would now paint under them.
  • The keyboard scroll lookup returns early when the active row does not exist. Before, pressing an arrow key after a search with no results threw a TypeError.

Only the one-based index part of the patch has an upstream PR (liveblocks/frimousse#39). The patch header says to re-apply the header-row changes when Frimousse is upgraded.

Closes DEQ-130

Ticket UI surface Element Level
DEQ-130 Template builder, Customizations step, emoji picker (IconField) category labels h2

There is no visual change. In Storybook, screenshots of the open picker match main pixel for pixel at four scroll offsets, sticky headers included, so there are no before/after screenshots.

Decision log and verification
  • Why patch instead of the alternatives: row > gridcell > h2 from the app side (no patch) passes axe. But those rows sit outside Frimousse's row numbering, and they render after every emoji row, which trades one 1.3.1 problem for another. Rendering the headings outside the grid would break the sticky headers. Patching follows the existing patch (from feat: replace Emoji Mart with Frimousse in the emoji picker #30526) and keeps the bundle as it is. Vendoring Frimousse was rejected earlier because it would mean owning about 3,900 copied lines.
  • Keyboard model: arrow keys still move only between emojis. Header rows have no cells to land on, and the active-emoji model works on data rows, so moving from the last row of one category to the next skips the header row (row 20 goes to row 22). Screen reader users reach the headings with browse-mode heading navigation.
  • Verification, Storybook components/IconField OpenPicker, branch vs main:
    • axe-core 4.11 on the dialog: the only violation is aria-dialog-name on the shared PopoverContent, which main also has.
    • Playwright ARIA snapshot: every category shows up as row > heading [level=2] before its emoji rows, both at the top and when scrolled into the middle of the list.
    • Arrow-key navigation scrolls the active emoji into view across category boundaries. Category nav buttons scroll to the same offsets as on main. No page errors after a search with no results followed by ArrowDown or Tab.
  • Test: the existing "numbers grid rows" test now searches a term that matches two categories and checks both headings, each row's index, and aria-rowcount. It fails on main.
  • Dropped or deferred review findings:
    • FE1/TS5, "asserts attributes": the ARIA row indexes and the heading-in-row structure are invisible to Pixel, and CI runs no axe check, so this test is the only regression coverage. It extends the existing index test.
    • Nit, "header gridcell has no aria-colspan": axe does not flag it, and the patch's header props function does not know the column count. Left out to keep the patch small.
    • Nit, "Fragment import now unused in the ESM bundle": harmless in a minified dependency.

🤖 Generated by Coder Agents on behalf of @aqandrew.

Frimousse renders category headers inside its role=grid list, so a plain
heading there fails aria-required-children. Extend the [email protected]
patch to make each category header a grid row (counted in aria-rowcount
and aria-rowindex), and to render each category before its first emoji
row so headings follow reading order. The emoji picker then wraps each
label in an h2.
Also test header row numbering across two categories and note that the
header-row patch has no upstream fix.
@aqandrew
aqandrew temporarily deployed to main November 13, 2026 18:01 — with GitHub Actions Inactive
@aqandrew
aqandrew temporarily deployed to main November 13, 2026 18:01 — with GitHub Actions Inactive
@linear-code

linear-code Bot commented Nov 13, 2026

Copy link
Copy Markdown

DEQ-130

@aqandrew
aqandrew marked this pull request as ready for review November 13, 2026 18:11
@aqandrew
aqandrew temporarily deployed to main November 13, 2026 18:12 — with GitHub Actions Inactive
@aqandrew
aqandrew temporarily deployed to main November 13, 2026 18:25 — with GitHub Actions Inactive
@aqandrew
aqandrew temporarily deployed to main November 13, 2026 18:35 — with GitHub Actions Inactive
@aqandrew
aqandrew force-pushed the a11y/semantic-heading-emoji-picker branch from e518477 to 1a6a3cc Compare November 13, 2026 18:38
@aqandrew
aqandrew temporarily deployed to main November 13, 2026 18:38 — with GitHub Actions Inactive
aqandrew added a commit that referenced this pull request Nov 16, 2026
Replaces `site/patches/[email protected]` with
[`@coder/[email protected]`](https://www.npmjs.com/package/@coder/frimousse),
Coder's fork of Frimousse at
[coder/frimousse](https://github.com/coder/frimousse). 0.4.1 includes
the same fix the patch made: one-based `aria-rowindex` and
`aria-colindex` (upstream liveblocks/frimousse#39, applied in
coder/frimousse#4). It is published from the fork's release workflow
with npm trusted publishing.

- `frimousse` becomes `@coder/frimousse` in `package.json` and in the
two imports.
- The patch and the `patchedDependencies` entry are removed.
- `minimumReleaseAgeExclude` allows this exact version. pnpm holds back
versions published in the last day, and 0.4.1 was published on
2026-11-16, so `pnpm add` wrote this entry. It can be removed later, or
replaced on the next bump.
- The lockfile records the registry tarball URL, as the nix build
requires.

No behavior change: the existing "numbers grid rows and cells from 1"
test passes against the package, with no patch applied.

Kept: the `site/patches/**` exclusion in `.github/workflows/typos.toml`.
With this PR no patch remains, but the open #32020 adds a cmdk patch
that needs it.

This is step 3 of moving Frimousse changes to the fork. Next,
coder/frimousse gets the DEQ-130 category header rows, and a follow-up
coder/coder PR bumps to that release and replaces #32189.

🤖 Generated by Coder Agents on behalf of @aqandrew.
@aqandrew

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #32407, which gets the same fix from @coder/[email protected] instead of a pnpm patch.

🤖 Generated by Coder Agents on behalf of @aqandrew.

@aqandrew aqandrew closed this Nov 18, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 18, 2026

This branch had an error being deployed

1 failed and 1 inactive deployments
docs-preview — 1a6a3cce Deployed Nov 18, 2026 by aqandrew via cleanup #215
main — 1a6a3cce Deployed Nov 18, 2026 by aqandrew via cla #259738
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant