Repository navigation
fix(components): popovers are disclosures or dialogs, and a closed Accordion panel is hidden - #302
sydevs-bot wants to merge 14 commits into
Conversation
The atom defaulted to `role="menu"`, and both production callers took the default: the footer's language picker (a list of links) and EmbedButton (a snippet, a textarea and a button). A `menu` promises arrow-key navigation between `menuitem`s that the atom never implemented, and axe reports an open one holding links as `aria-required-children`. The default is now `disclosure`, the APG pattern for a list of links: the trigger carries `aria-expanded` and, while open, `aria-controls`; it names no popup and the panel takes no role. `useRole` has no disclosure, so it is disabled for it and the atom writes those two attributes itself. In focus mode the caller's own control states its expansion, so the wrapper adds nothing. `menu` leaves the union. EmbedButton passes `role="dialog"`, named by the heading it already shows. LanguageDropdown renders its options as a list of `DropdownItem`s, the atom's first production consumer, at the `sm` size, which brings each row to 44px (it was 40). The option for the page being read carries `aria-current="page"`, which the check mark only told a sighted reader. Open-state tests run axe over each panel through a new fragment helper, `tests/_helpers/axe.ts`. The gate's own check that its home target still walks a Dropdown now looks for the disclosure trigger. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
Four defects from #289's Accordion section, each now failing the axe gate or the new spec when reverted. - The panel's `aria-labelledby` pointed at `accordion-header-<id>`, which nothing rendered. The header's `<button>` now carries that id, so every open panel's region is named by its header. - The outer wrapper carried an unnamed `role="region"`. Two accordions on one page were two identical landmarks (axe `landmark-unique`). The role is dropped rather than given an invented name. - A closed panel was only `max-h-0 opacity-0`, so its text stayed in the accessibility tree and a link inside it kept a tab stop. It is `hidden` now, which also removes the `max-h-[1000px]` clip on a long open panel. - Every item title was an `h3`. The accordion takes `headingLevel`, and LayoutBlock passes the level it already computes for its other styles, so an accordion with no section title starts at `h2`. `onToggle` ran inside the state updater, which React may call twice; it now runs once per click. The Enter/Space handler is gone: the header is a native `<button>`, and a real browser toggles it once per key without it (checked in Ladle). The gate's article fixture gains two `layout` accordions, one untitled before any `h2` and one titled. Against the old component it reports `heading-order`, `landmark-unique` and the dangling `aria-labelledby`; with the old LayoutBlock alone it reports `heading-order`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
`useRole({ role: 'tooltip' })` writes `aria-describedby` on the reference,
and the reference is the inline wrapper the atom draws for positioning
and for hover and focus. A screen reader announces the control inside it,
so the description was never read with the button it describes.
The wrapper keeps the ref and the handlers; the attribute moves to the
child, merged with any description the control already names, the way
FormField puts its own. A child that is not a single element keeps no
description, recorded as a `shortcut:`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
…itch `useSiteNav` picked the two featured articles in a `useState` initializer. Vike keeps the layout mounted through a client-side navigation and hands it fresh `settings`, so after a switch to French the mega-menu kept showing the English titles until a full reload. The picks are now keyed on what the two source lists hold. A locale switch retitles the pages and re-rolls them; a same-locale navigation brings equal lists in new objects and keeps them. The change stays in the `useState` region (the adjust-state-during-render pattern), because #283 rewrites the import block and the lines around `useT()` in this file. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
In single mode the toggle started from an empty set whenever it ran, so closing one item also closed every other item `defaultOpenItems` had opened. Only opening an item should close the rest; closing now starts from the current set and removes the one clicked, as main already did before this branch moved the toggle out of the state updater. Review follow-ups on the same branch: the Dropdown story's Ladle description no longer calls the atom a keyboard menu, the gate's `TAGS` gains the ⚠ pointer back to the fragment helper that mirrors it, the gate's Dropdown check calls the footer control a language picker, and the useSiteNav spec's mock comment reads true with or without #283. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-design | fb8a744 | Commit Preview URL Branch Preview URL |
Nov 24 2026, 01:29 AM |
Ardnived
left a comment
There was a problem hiding this comment.
We are adding a lot of complication with the introduction of all these aria properties. Look for ways to streamline and simplify the code. Is there any library we could rely on to simplify the aria handling?
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
…les-and-accordion
The tag list and the options builder stood in both the page gate and the fragment helper, kept together by a comment in each. The helper now exports both, and the gate imports them, so there is nothing left to keep in sync. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXKeBJhaJUExZiCSDL
Three specs each clicked a trigger, read its `aria-controls` and resolved the id by hand. The dance is the assertion that the reference is real, so it is worth stating once. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXKeBJhaJUExZiCSDL
The header and panel ids were spelled four times between the `id`, `aria-controls` and `aria-labelledby` that wire them, so the pairing had to be read off the template strings. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXKeBJhaJUExZiCSDL
sydevs-bot
left a comment
There was a problem hiding this comment.
1 question for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Streamlined, in three commits. The library is already here.
Generated by Claude Code |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | fb8a744 | Commit Preview URL Branch Preview URL |
Nov 24 2026, 01:29 AM |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
This PR is the size of its own title: five named defects, each with a spec that fails without it, and nothing unrelated. On the aggregate you raised — the hand-held ARIA is five lines in Dropdown and four attributes in Accordion. 567 of the 708 added lines are specs, helpers and fixtures, so what reads as a lot of complication is test volume. Dropping role="menu" removes ARIA, and LanguageDropdown trades hand-rolled rows for DropdownItem. No cross-repo contract is touched.
Findings — both from reading Accordion.tsx whole, not from the diff.
consider—Accordion.tsx:84: the open set is built from the render closure, not from the updater'sprev.consider—Accordion.tsx:97: the molecule caps its own page width, where its one caller owns layout for every other block style.
Second opinion — the Dropdown.tsx:248 question is settled as B, and that thread is resolved.
What was checked
- Read whole on the branch:
Dropdown,Accordion,Tooltip,LanguageDropdown,EmbedButton,useSiteNav,LayoutBlock, both new helpers, the gate and its fixtures. LocationSearch.tsx:254is the onlyopenOnFocuscaller and writes its ownaria-autocomplete,aria-expandedandrole="listbox", so the!openOnFocusguard holds and main'smenupanel was wrapping that listbox.MeditationPlayer.tsx:276is the onlyTooltipcaller and passes<Button>, which spreadsComponentProps<'button'>atButton.tsx:287. The clonedaria-describedbyreaches the real button, so the spec's bare<button>is not the only shape that works.- Ladder: 6 new pieces, 6 kept —
DropdownRole,openPanel, andaxe.ts's four, now the one owner of the tag list the gate and the fragment specs both read. The streamliner subagent did not return inside the lease, so this walk is mine.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
…les-and-accordion
Two header clicks landing in one task shared a render, so each built the next open set from the same closure and the second overwrote the first. The set now reduces from the updater's `prev`. `isOpening` stays on the render closure, and `onToggle` stays outside the updater, so one click is still one callback under StrictMode. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVgdgz1Tvf1V1gLzrA
`mx-auto max-w-full sm:max-w-3xl` had the molecule centre itself and decide how wide an FAQ reads, while its one caller owns layout for every other layout-block style. The cap moves to that `<section>`, where the block's heading now shares the column instead of spanning the wider one above it. `max-w-full` is dropped with the move: a block `<section>` in the rich-text column already fills it below `sm`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVgdgz1Tvf1V1gLzrA
|
Both critic findings adopted, in
The merge is pushed with the work, so the gate ran on the merged result: lint clean under #313's 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Four conflicts, all import blocks against #327's folder reorganisation. Each keeps this branch's symbols, spelled the `@/` way main now uses: - Accordion.tsx: `Heading` arrives with the `headingLevel` prop, beside main's `Icon`. - LanguageDropdown.tsx: `DropdownItem` replaces the hand-rolled rows, so the direct `Link` import main added goes with them. - LanguageDropdown.test.tsx: the `importOriginal` mock stays, because `DropdownItem` has to stay real to render the links under test. - page-types.test.tsx: `RunOptions` stays dropped, since `axeOptions` now lives in tests/_helpers/axe.ts. The six files #327 never saw — the five new specs and this branch's edit to the a11y gate — move to `@/` too. `no-restricted-imports` bars `../*` in every aliased folder, so a relative path across folders is now a lint error. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXDjyKLtEiZJVmnxBT
|
Merged Four conflicts, every one an import block against #327's folder reorganisation. Each keeps this branch's symbols, spelled the
Six files the reorganisation never saw move to #293 was not the conflict the body predicted. #327 merged first, and #293 still has to reconcile with this head. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Conflict in tests/a11y/page-types.test.tsx, in the import block only. Kept both sides: main's `enT` and `pageSeo`, which its new `seoFor` helper calls, and this branch's drop of `RunOptions`, which moved to tests/_helpers/axe.ts with the options builder. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXnjr915DFGr4WuV2W
|
Merged Kept both sides. Nothing was weighed up: Lean gate on the merge: lint and One thing for later, not for this PR: #293 still conflicts, but the hunk has moved to 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
DropdownItematom. The current language carriesaria-current="page".h3under a block title,h2when there is none.Dropdownnow defaults torole="disclosure", and'menu'is gone fromDropdownRole. The atom has no arrow-key navigation, so the menu role promised something it could not do.Accordiontakes a newheadingLevelprop. Two new test helpers:tests/_helpers/axe.tsowns the axe rule set that both the page gate and a component fragment run, andtests/_helpers/popover.tsopens a popover through its trigger'saria-controls.Preview
aria-expandedand noaria-haspopup. Each row is 44px tall, and the current language carriesaria-current="page".h2buttons. A closed panel ishidden, so its links take no tab stop, and an open panel is a region named by its question.allowMultiple, two items open by default); closing one leaves the others open.<ul>ofDropdownItemrows, with every language listed and with the current language set toen,esandfr, which the preview site does not offer yet.Findings addressed
components/atoms/Dropdown/Dropdown.tsx:35,180gave every panelrole="menu". That covered the link list inLanguageDropdownand the text, textarea and button inEmbedButton, and neither one is a menu. axe reportsaria-required-childrenon main's open panel. Now the default is the APG disclosure pattern: the trigger getsaria-expanded, plusaria-controlswhile open, and noaria-haspopup. The panel gets no role.EmbedButtonpassesrole="dialog"and names the dialog with its visible heading.LanguageDropdownrenders a<ul>ofDropdownItem(sizesm), replacing the hand-rolled rows atLanguageDropdown.tsx:75-90on main. The trigger contract from feat(components): skip link, nav names, page titles and an axe gate #278 indocs/rules/design-system.mdis unchanged, and the Dropdown section there is updated.aria-haspopup, Tab reaches the first link, and the embed dialog is namedEmbed “Morning Meditation”.components/atoms/Dropdown/Dropdown.interaction.test.tsx,components/molecules/LanguageDropdown/LanguageDropdown.interaction.test.tsxandcomponents/molecules/EmbedButton/EmbedButton.interaction.test.tsxcover roles,aria-controlsresolution, the dialog name andaria-current, plus an axe run over the open panel. They fail against main's sources.Dropdown.test.tsx(SSR) asserts the default trigger has noaria-haspopup. The gate's "keeps the Dropdown atom on the path" check intests/a11y/page-types.test.tsxnow asserts the footer trigger is a disclosure.components/molecules/Accordion/Accordion.tsx:135labelled each panel byaccordion-header-<id>, an id no element carried.:99wrapped the list in an unnamedrole="region".:137hid a closed panel withmax-h-0 opacity-0only, which left it in the tab order and clipped long content at 1000px.:85calledonToggleinside the state updater. The button now carries the id. The wrapper's role is dropped. A closed panel ishidden, and the max-height clip and its transition are gone.onToggleruns once per click, outside the updater. The Enter/Space keydown handler at:113is gone, because native button activation toggles once per key; in a browser, Enter opened, Space closed, andscrollYstayed 0.LayoutBlock.tsxchanges on two lines: it passes its computeditemHeadingLeveltoAccordion, and its accordion<section>now carries the FAQ column width the molecule used to set on itself.defaultOpenItemshad opened.components/molecules/Accordion/Accordion.test.tsx(jsdom, 9 tests) covers the named region, one region for two accordions with a clean axe run, the hidden closed panel and its unreachable link, nomax-h-class, single and multiple open, closing only the clicked item, two toggles batched into one task, oneonToggleper click under StrictMode, and the heading level. 8 of them fail on main or on an earlier head of this branch.tests/a11y/fixtures.tsadds an untitled and a titled accordion to the article fixture. With the old Accordion, the gate reportsheading-order,landmark-uniqueandaria-valid-attr-value.components/atoms/Tooltip/Tooltip.tsx:82spreaduseRole'saria-describedbyonto the wrapper<span>. That is the opposite of the ruleFormField.tsx:106-107states. The description is now cloned onto the single element child and merged with anyaria-describedbyit already has. A child that is not a single element gets no description, and ashortcut:comment marks that limit.MeditationPlayeris untouched.components/atoms/Tooltip/Tooltip.interaction.test.tsx. After focus, the button is described by the tooltip, no other element carries the attribute, and an existing description is kept. Both tests fail on main.layouts/useSiteNav.ts:40drew the featured-article picks once with auseStateinitializer. Vike keeps the layout mounted through a client-side navigation, so a locale switch kept the first locale's titles. The picks are now keyed on the source lists' contents, using React's adjust-state-during-render pattern. A locale switch re-rolls them, and a same-locale navigation (equal lists in new objects) keeps them.layouts/useSiteNav.test.ts(jsdom,renderHook). The retitled-lists case fails on main, and the equal-lists case pins that the picks stay put, withMath.randommocked.Review follow-ups also applied:
tests/_helpers/axe.ts, and the page gate imports them. The ⚠ pointer each file carried is gone with the duplication it guarded.openPanelintests/_helpers/popover.tsreplaces the click-then-resolve-aria-controlsdance that three specs each spelled out.Accordionnames each item's header and panel id once, rather than spelling each of the two twice across theid,aria-controlsandaria-labelledbythat wire them.useSiteNavspec's mock comment now reads true both before and after feat(components): add a mobile menu, and make the compact bar the phone's header #283.Accordion's open set reduces from the updater'sprev. Two header clicks landing in one task each built it from the same render closure, and the second overwrote the first, so one of the two opens was lost.isOpeningstays on the render closure, which is what keepsonToggleto one call per click.mx-auto sm:max-w-3xl) moves fromAccordiontoLayoutBlock's accordion<section>. The molecule no longer centres itself or decides how wide an FAQ reads, and the block'sh2now shares that column instead of spanning the wider rich-text one.max-w-fullis dropped with the move: that<section>already fills the column belowsm.Not in this PR
Dropdownportals its panel to the end of<body>, so the open footer language panel sits outside thecontentinfolandmark. axe's best-practiceregionrule flags it, and it flagged the oldrole="menu"panel the same way. A dialog panel is exempt. Fixing this means changing the portal or positioning strategy for every Dropdown consumer. The fragment helper turnsregionoff and says why. The page gate still runsregionover every page, where panels are closed.navigator.vendorsends Floating UI down its Safari branch, which gives each focus guard an unnamedrole="button". The helper excludes[data-floating-ui-focus-guard]because this is library markup. I have not checked what axe says about these guards in real Chrome.TARGETSuntouched..claude/changes.Reconciled with open PRs
git merge-treeof this head against each branch below is conflict-free, except #293 as noted. Re-checked against the merge below.layouts/useSiteNav.tsandtests/a11y/fixtures.tsedits combined with this PR's cleanly, with no conflict to resolve.HeaderNavDropdownstays on its own wiring, as decided there.EmbedButton's imports andbuildEmbedSnippet. This PR touches only the component body. A trial merge passed the EmbedButton, Dropdown, a11y and templates tests.tests/a11y/fixtures.tsrather than the gate's import block. Both PRs append a block toarticlePage's list: this one an accordion, feat(components): a MeditationLibrary for the meditations index block #293 acontent-index. Both are wanted, so whichever merges second keeps both blocks. Nothing else collides, andmainand feat(components): a MeditationLibrary for the meditations index block #293 merge cleanly with each other.tests/a11y/fixtures.tsoutsidearticlePage.MeditationPlayer's upsell region. This PR does not editMeditationPlayer.Test results
origin/mainis merged in at fb8a744, resolving one conflict hunk intests/a11y/page-types.test.tsxleft by #311, so the gate below ran on the merged result.Lean gate (
.claude/skills/pr-prep/check.sh) on the final head:eslint . --max-warnings 0plusprettier --check .the gate, so this is 0 errors and 0 warnings, not a count held level against main.tsc --noEmit): clean.pnpm build: not run, because this bundle is not marked BUILD.🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw