Repository navigation
@remotion/studio: give the icon-only menu trigger a discernible name - #12960
Conversation
The top-left Studio menu is triggered by the Remotion icon alone, so the button had no accessible name and `Accessibility Insights for Web` reported a `button-name` (WCAG 4.1.2) failure for it. `Menu` now carries an optional `ariaLabel` that the menu initiator renders on its button. Only the icon-only Remotion menu sets it; text menus keep being named by their visible label, where `aria-label` stays absent. Fixes remotion-dev#12947
There was a problem hiding this comment.
ℹ️ Minor suggestion inline. The fix is correct and the regression test is solid.
Reviewed changes
- Icon-only trigger name: Adds
ariaLabelto the internalMenutype and forwards it to the trigger'saria-label, so the Remotion logo button has an accessible name (WCAG 4.1.2). - Scoped wiring: Only the
remotionmenu setsariaLabel: 'Remotion'; text menus keep their visible label and noaria-labelattribute. - Regression test: Queries the trigger by accessible name and asserts text menus stay label-named, with a control case.
Verified locally: the new test passes (2/2), the related menu tests pass (13/13), and tsc --noEmit, oxlint/eslint, and oxfmt --check are clean for the touched files.
deepseek-v4.1-flash-1017 | 𝕏
| leaveLeftPadding: boolean; | ||
| // Declared when the label is only an icon, so the trigger keeps a | ||
| // discernible name for assistive technology. | ||
| ariaLabel?: string; |
There was a problem hiding this comment.
Per AGENTS.md and the nullable-new-params skill, new internal type members should be required nullable rather than optional. Menu is internal (not exported from the package entrypoint), so this should be ariaLabel: string | null, with the other Menu literals passing null explicitly.
Technical details
# Make `ariaLabel` required nullable
## Affected sites
- `packages/studio/src/components/Menu/MenuItem.tsx:59` — new optional member
- `packages/studio/src/helpers/use-menu-structure.tsx` — the other `Menu` literals (`getFileMenu` and the view/tools/help entries) need `ariaLabel: null`
- `packages/studio/src/components/ToolbarMenuItems.tsx:77` — composition menu literal
- `packages/studio/src/test/composition-menu-items.test.ts`, `packages/studio/src/test/quick-switcher-menu-results.test.ts`, and this PR's test — fixtures need the explicit `null`
## Required outcome
- Internal `Menu.ariaLabel` is `string | null`, and every construction site passes either the label or `null`.There was a problem hiding this comment.
Applied in 5fec286. Menu['ariaLabel'] is now string | null, and every construction site states it explicitly: use-menu-structure.tsx (file/view/composition/tools/help → null, remotion → 'Remotion'), ToolbarMenuItems.tsx, plus the three test fixtures.
The DOM attribute needed the repo's existing nullable convention, so the button now reads aria-label={menu.ariaLabel ?? undefined} (same shape as CaptionInspector.tsx:180 and RenderModalOutputName.tsx:91).
Verification:
- Dropping
ariaLabelfrom justToolbarMenuItems.tsxfails the typecheck withTS2741: Property 'ariaLabel' is missing ... but required in type 'Menu', so the rule now enforces completeness at every site instead of only at the one I touched. bun x turbo run make --filter=@remotion/studio: 29/29 tasks, no TS errors.bun testonmenu-initiator-accessible-name,composition-menu-items,quick-switcher-menu-results: 11 pass / 0 fail.oxfmt --checkclean on all six files.
Per AGENTS.md, new internal type members are required nullable rather than optional, so every Menu literal now states whether it has an icon-only label instead of silently inheriting undefined.
@remotion/studio: give the icon-only menu trigger a discernible name
JonnyBurger
left a comment
There was a problem hiding this comment.
Will merge after current release is done

Fixes #12947.
Problem
The top-left Studio menu trigger is icon-only (the Remotion mark), so the
buttonhad no accessible name and Accessibility Insights reported abutton-namefailure (WCAG 4.1.2) for.__remotion-studio-menu-initiator:nth-child(1). Without a name, assistive technology cannot announce what the control opens.Change
Menugains an optionalariaLabel, rendered by the menu initiator on itsbutton.remotionmenu sets it (ariaLabel: 'Remotion').aria-labelstays absent, so the visible label still names the control and no markup changes for them.Semantics and keyboard operation are unchanged: the trigger keeps
role="button"and its existingtabIndex.Tests
packages/studio/src/test/menu-initiator-accessible-name.test.tsxariaLabel: the button is queried by accessible name (getByRole('button', {name: 'Remotion'})) and keepstabindex="0".aria-labelabsent and is named by its visible label.Verification on Windows 11 x64, Node/bun 1.4.3 (
bun test src/test/menu-initiator-accessible-name.test.tsx):bun test src/test/composition-menu-items.test.ts: 8 pass, unchanged menu structure.oxfmt --checkclean;tsc -dfor@remotion/studiopassed as part ofturbo run make --filter=@remotion/studio...(29 tasks).Not done locally:
eslintcould not run on this checkout (ESLint couldn't find the plugin "eslint-plugin-react-hooks", resolved frompackages/eslint-config-internal/dist), and the rendered Studio UI was not opened in a browser, so this does not claim a fresh Accessibility Insights scan. The rule it checks — a non-empty accessible name on the button — is what the new test asserts.