Repository navigation
fix(core): wire aria-controls on ChatComposerDrawer toggle - #3996
Merged
Merged
Conversation
bhamodi
requested review from
cixzhang,
ejhammond and
imdreamrunner
as code owners
July 15, 2026 14:43
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis ReportModified ComponentsChat
Bundle Size Summary
Accessibility AuditStatus: 1 accessibility violation(s) found — 1 serious. Chat - 1 issue(s)
Generated by PR Enrichment workflow | View full report |
bhamodi
force-pushed
the
a11y/chatcomposerdrawer-controls
branch
from
July 23, 2026 13:29
7f10ebb to
c3502c7
Compare
bhamodi
force-pushed
the
a11y/chatcomposerdrawer-controls
branch
from
July 23, 2026 20:31
c3502c7 to
4c1d963
Compare
cixzhang
approved these changes
Jul 23, 2026
cixzhang
pushed a commit
that referenced
this pull request
Sep 3, 2026
…sted viz packages and hooks (#4295) (#4377) * test: cover the viz packages and five core hooks packages/charts and packages/vega had no functional tests at all, and packages/lab's chart primitives (Chart*, Radial*, ThreeD*, Sankey*, SVGIcon) rendered nothing under test. Add colocated tests for each, plus renderHook tests for the three useCalendar* hooks, useCollapsible and useTableFilterState. Harness: charts and vega were falling through to the `node` vitest project, which has no jsdom, no StyleX transform and no jest-dom, so their tests could never have run there. Move both into the `ui` project and give vega the test scripts the other packages already have. 53 test files, 307 tests. Verified: full suite 7943 pass / 430 files, still green with packages/core/dist absent (the cold-CI path, which charts needs because it imports core by bare name for values); 8 sampled mutations across all four packages, each killed by exactly the new test. Refs #4295 * test: cover remaining core hooks and components Finishes the functional-coverage sweep started in 64d9ea3. Adds renderHook tests for useScrollLock, useLightbox, useChatPasteAsToken, useImperativeAlertDialog, useTranslator and useTooltip, plus colocated tests for the components that had none: CommandPaletteEmpty, InputClearButton, TypeaheadItem, ChatSendButton, PowerSearchToken, PowerSearchFilterEditor and TableHeaderCell. Two of the issue's nine "zero-test" components already had tests (ChatComposerDrawer, MobileNavToggle, from #3996 and #3721), so the inventory is smaller than the issue states. Extracts the StyleX declaration read-back helper that three of these files each needed into __tests__/stylexDeclarations.ts rather than landing a third copy. Two branches are deliberately left uncovered, with the reason recorded next to them: the ignored-onOpenChange(true) guards in useLightbox and useImperativeAlertDialog are unreachable through the public surface, and reaching into element props to force them both breaks the repo's no-react-introspection lint rule and asserts a value that is already settled. useTooltip's focus paths are also omitted -- jsdom resolves :focus-visible as :focus, so those tests would pass with the gate deleted. Verified: 8101 tests / 443 files green, eslint and prettier clean, core typecheck clean; three sampled mutations (the send-button variant ternary, CommandPaletteEmpty's xstyle merge, useTooltip's touch suppression) each killed by exactly one new test. Refs #4295 * test: port the branch's remaining assertions onto main's test files The eight add/add conflicts resolved to main's files in the merge; this ports back only the assertions main does not cover and that still hold today (render gates and sizing, layer groups and masks, style restore, registry glyph, xstyle forwarding, context guards). Duplicates of main's coverage are dropped rather than kept twice. Four files went stale over the 815-commit gap and follow today's behavior: the hidden data-table fallback (#4382) means chart label and tooltip queries scope to the svg; useTooltip's touch guard is per pointer type (#5248) and a controlled tooltip reports Escape through onHide (#4881); TableHeaderCell dividers are logical inline-end properties (#4434). * test(calendar): assert month labels as English literals CI's lint job fails on the one raw Intl call left in these tests: main's no-raw-intl-locale rule keeps its test-oracle allowlist inside the rule, and this file is not on it. The oracle was also the wrong side: with no InternationalizationProvider mounted, useLocale() resolves to 'en', so the hook's labels never followed the machine locale that Intl.DateTimeFormat(undefined) reads. Literal 'April 2026' style assertions match Calendar.test.tsx and drop the Intl dependency.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ChatComposerDrawer's collapse toggle (role="button",packages/core/src/Chat/ChatComposerDrawer.tsx) exposedaria-expandedbut noaria-controls, and the drawer's content wrapper had noid, so assistive tech had no way to jump from the toggle to the region it shows/hides.This wires up the standard disclosure linking, matching the repo's existing precedents: Collapsible (36ecca5, #3707), Banner (64f07c9, #3719), and CodeBlock (d7bde21, #3723), plus the prior Chat disclosure work in ChatToolCalls (e45d9ae, #3720):
useId()-generated id is applied to the drawer's content wrapper.aria-controls={contentId}alongside its existingaria-expanded.Unlike Banner (whose region unmounts and therefore conditions
aria-controlson it being mounted), the drawer's content stays mounted while collapsed -- it is hidden via thegrid-template-rows: 0frcollapse -- soaria-controlsis unconditional here, mirroring the Collapsible precedent. Purely additive; no behavior or visual change.Changes
Chat/ChatComposerDrawer.tsx: generatecontentIdviauseId(), setaria-controls={contentId}on the toggle, applyid={contentId}to the content wrapper; note the disclosure wiring in the file header.Chat/ChatComposerDrawer.test.tsx(new, colocated -- the component previously had no tests): covers aria-controls resolution and aria-expanded toggling..changeset/chatcomposerdrawer-controls.md: patch changeset for@astryxdesign/core.Test plan
node_modules/.bin/vitest run --root . packages/core/src/Chat-- 140 pass across 14 files, including three new tests inChatComposerDrawer.test.tsx:links the toggle to the drawer content via aria-controls-- asserts the toggle'saria-controlsresolves viadocument.getElementByIdto the element containing the drawer content.keeps aria-controls resolvable while collapsed (content stays mounted)-- same resolution assertion withdefaultIsCollapsed.toggles aria-expanded when the toggle is activated-- true -> false -> true across clicks.main(aria-controlsis null); the aria-expanded test passes (regression guard).node_modules/.bin/vitest run --root . packages/core-- 4584 pass (204 files), no pre-existing failures.node_modules/.bin/tsc --project packages/core/tsconfig.json --noEmit-- clean.prettier --checkon changed files -- clean.Notes
Found during a broader a11y audit of core components; scoped to one fix per PR.