Skip to content

fix(a11y): fix invalid ARIA, unnamed buttons, list markup, and touch targets on flow page - #14210

Open
olayinkaadelakun wants to merge 2 commits into
release-1.12.0from
LE-1968
Open

fix(a11y): fix invalid ARIA, unnamed buttons, list markup, and touch targets on flow page#14210
olayinkaadelakun wants to merge 2 commits into
release-1.12.0from
LE-1968

Conversation

@olayinkaadelakun

@olayinkaadelakun olayinkaadelakun commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • aria-allowed-attr: textAreaComponent/queryComponent's expand-to-editor icon rendered Radix's cloned aria-haspopup/aria-expanded on a bare <div> with no role. Fixed by making the icon's own tightly-sized wrapper a real <Button unstyled>, with renderIcon()/renderGradient() split apart so only the icon sits inside the interactive element.
  • button-name: NodeStatus's run/connect buttons, NodeOutputfield's InspectButton, and the sidebar's "add to canvas" hover button (sidebarDraggableComponent) had no accessible name. Added aria-labels using each button's already-computed tooltip text (or a new i18n key where none existed).
  • list/listitem: categoryDisclouse.tsx/bundleItems.tsx nested <Disclosure><SidebarMenuItem> — putting Disclosure's wrapper <div> between the sidebar's <ul> and each <li>. Swapped to <SidebarMenuItem><Disclosure> — same content, valid list structure.
  • target-size: the new expand-editor button was 16×16px (below the 24×24 WCAG 2.5.8 minimum). Padded the hit area with a before: pseudo-element rather than resizing the visible icon.

Also renamed the misleading input.editTextTitle ("Edit Text") to a new input.expandTextEditor ("Expand text editor") key — the control expands into a larger editor, it doesn't perform the edit itself — and fixed two stray debug console.logs.

Why

These are shared-component bugs — every node's run/inspect buttons, every text/query field, every sidebar row and add-button inherited the same failure. Fixing the shared components resolves the audits app-wide

Test coverage added

New jest-axe suites for NodeStatus, InspectButton (newly exported from NodeOutputfield), textAreaComponent, queryComponent, and real-DOM (unmocked SidebarMenu/Disclosure) list-structure tests for categoryDisclouse/bundleItems — 27 suites, 503 tests passing.

Translations

New keys (input.expandTextEditor, sidebar.addComponentToCanvas) pushed through the GP pipeline; all 6 locales updated with real translations as isolated, single-purpose diffs.

Test plan

Automated:

  • tsc/biome clean on all touched files (pre-existing, unrelated warnings elsewhere untouched)
  • 27 test suites / 503 tests passing, zero regressions
    Manual QA:
  • Run/connect button (NodeStatus) — Tab to each, confirm VoiceOver/NVDA announces "Run component"/"Stop build" and "Connect" (or custom auth_tooltip); click still builds/connects as before
  • Inspect button (NodeOutputfield) — Tab to it in all 3 states (not built / has output / can't display), confirm the announced name matches the visible tooltip in each; click still opens the inspection panel
  • Text/query field expand icon — Tab to it, confirm it announces "Expand text editor"; press Enter/click, confirm the editor modal opens; zoom in and confirm the clickable area feels slightly larger than the visible icon (touch-target fix), with no visual shift in the icon itself
  • Sidebar "add to canvas" button — hover a component in the sidebar, confirm the "+" button still adds it to canvas on click; check its accessible name via DevTools Accessibility pane (intentionally not Tab-reachable, tabIndex={-1})
  • Sidebar category/bundle lists — expand/collapse a category and a bundle, confirm no visual/behavioral change; in DevTools, confirm each <li> is a direct child of its <ul> (no <div> in between)
  • Locale check — switch language to any of the 6 translated locales and confirm the new strings render (no missing-key fallback to English, no raw key names)

Summary by CodeRabbit

  • Accessibility

    • Improved screen-reader labels for node actions, connection controls, run actions, and text-editor expansion buttons.
    • Added localized accessible names for adding components to the canvas.
    • Improved sidebar list semantics and keyboard-friendly button behavior.
  • Localization

    • Added translations for text-editor expansion and canvas component actions in supported languages.
  • Tests

    • Added accessibility coverage for node controls, text editors, query inputs, and sidebar components.

@olayinkaadelakun olayinkaadelakun self-assigned this Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e31f3a83-3669-4570-9631-2c301040c48a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Frontend controls now expose accessible names, use semantic buttons, and include localized labels. Generic node and sidebar structures receive accessibility-focused tests, while locale files add the required translations.

Changes

Frontend accessibility updates

Layer / File(s) Summary
Generic node control labels
src/frontend/src/CustomNodes/GenericNode/components/NodeOutputfield/*, src/frontend/src/CustomNodes/GenericNode/components/NodeStatus/*
Inspect, run, and connect buttons now expose state- or tooltip-derived aria-label values, with accessibility tests covering their names and disabled states.
Localized text-editor controls
src/frontend/src/components/core/parameterRenderComponent/components/{queryComponent,textAreaComponent}/*, src/frontend/src/locales/*
Text-editor modal triggers use unstyled buttons and localized labels, with updated rendering helpers and accessibility tests.
Sidebar list structure
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/*
Sidebar disclosure nesting and React key placement are corrected, the add-component button receives a localized label, and structural/Axe tests are added.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: bug

Suggested reviewers: erichare


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 2 warnings)

Check name Status Explanation Resolution
Test Coverage For New Implementations ❌ Error Most changes are covered, but sidebarDraggableComponent adds a new aria-label with no test asserting its accessible name or locale interpolation. Add a regression test that renders SidebarDraggableComponent and queries the add button by its localized accessible name, e.g. with a representative display_name.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Quality And Coverage ⚠️ Warning Most new a11y changes have tests, but sidebarDraggable’s new localized aria-label lacks a role/name assertion; existing tests only use testId/click. Add/extend a sidebarDraggable test to query the add button by role and localized name (e.g. Add X to canvas) for a representative display_name.
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the PR’s main accessibility fixes on the flow page, including ARIA, button names, list markup, and touch targets.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Test File Naming And Structure ✅ Passed New frontend tests follow repo conventions: colocated *.a11y.test.tsx, descriptive suites/cases, and logical setup plus positive/negative coverage.
Excessive Mock Usage Warning ✅ Passed Mocks are targeted to external effects/leaf UI; the tests still exercise real rendering and accessible-name behavior rather than over-mocking core logic.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch LE-1968

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bug Something isn't working label Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Test Coverage Advisor

No source changes detected without accompanying tests. Thanks for keeping coverage up! 🎉

Advisory check only — never blocks merge.

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jul 22, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarDraggableComponent.tsx`:
- Around line 210-212: Add regression coverage for the add-component button
rendered by the sidebarDraggableComponent, using a representative display_name
and the localized sidebar.addComponentToCanvas interpolation. Render the
component with the required test setup, then query the button by its localized
accessible name and assert it is present.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1fc1fb55-b1a7-4bbd-9680-4eb96e94955b

📥 Commits

Reviewing files that changed from the base of the PR and between 43e7ee6 and e4f0d5a.

📒 Files selected for processing (20)
  • src/frontend/src/CustomNodes/GenericNode/components/NodeOutputfield/__tests__/InspectButton.a11y.test.tsx
  • src/frontend/src/CustomNodes/GenericNode/components/NodeOutputfield/index.tsx
  • src/frontend/src/CustomNodes/GenericNode/components/NodeStatus/__tests__/NodeStatus.a11y.test.tsx
  • src/frontend/src/CustomNodes/GenericNode/components/NodeStatus/index.tsx
  • src/frontend/src/components/core/parameterRenderComponent/components/queryComponent/__tests__/queryComponent.a11y.test.tsx
  • src/frontend/src/components/core/parameterRenderComponent/components/queryComponent/index.tsx
  • src/frontend/src/components/core/parameterRenderComponent/components/textAreaComponent/__tests__/textAreaComponent.a11y.test.tsx
  • src/frontend/src/components/core/parameterRenderComponent/components/textAreaComponent/index.tsx
  • src/frontend/src/locales/de.json
  • src/frontend/src/locales/en.json
  • src/frontend/src/locales/es.json
  • src/frontend/src/locales/fr.json
  • src/frontend/src/locales/ja.json
  • src/frontend/src/locales/pt.json
  • src/frontend/src/locales/zh-Hans.json
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/__tests__/bundleItems.a11y.test.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/__tests__/categoryDisclouse.a11y.test.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/bundleItems.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/categoryDisclouse.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarDraggableComponent.tsx

Comment on lines +210 to +212
aria-label={t("sidebar.addComponentToCanvas", {
name: display_name,
})}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add regression coverage for the localized add-button name.

No supplied test renders this component and verifies sidebar.addComponentToCanvas interpolation. Add a test that queries the button by its localized accessible name using a representative display_name.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarDraggableComponent.tsx`
around lines 210 - 212, Add regression coverage for the add-component button
rendered by the sidebarDraggableComponent, using a representative display_name
and the localized sidebar.addComponentToCanvas interpolation. Render the
component with the required test setup, then query the button by its localized
accessible name and assert it is present.

Source: Coding guidelines

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 46%
46.78% (66862/142900) 70.12% (9386/13385) 45.28% (1538/3396)

Unit Test Results

Tests Skipped Failures Errors Time
5343 0 💤 0 ❌ 0 🔥 18m 4s ⏱️

olayinkaadelakun pushed a commit that referenced this pull request Jul 23, 2026
…ers, sidebar list nesting, beta/legacy switch labels)

Brings in e4f0d5a and e9342a6, which fix the same button-name/aria-allowed-attr/list-nesting issues that a fresh scan showed as still-open on this branch — those commits existed on a sibling branch that hadn't been merged here yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants