-
Notifications
You must be signed in to change notification settings - Fork 9.8k
fix(a11y): name command palette, dialogs, and crash screen (LE-2043) #14313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
309dc8f
fix(a11y): name command palette, dialogs, and crash screen (LE-2043)
viktoravelino 03721ab
fix(a11y): name modals with a hidden title, label dropdown search
viktoravelino 83e0a54
Merge branch 'release-1.12.0' into LE-2043
viktoravelino a67459d
Merge branch 'release-1.12.0' into LE-2043
viktoravelino 156f529
Merge branch 'release-1.12.0' into LE-2043
viktoravelino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
...end/src/components/common/crashErrorComponent/__tests__/crashErrorComponent.a11y.test.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| import { render, screen } from "@testing-library/react"; | ||
| import userEvent from "@testing-library/user-event"; | ||
| import { axe } from "@/utils/a11y-test"; | ||
| import CrashErrorComponent from "../index"; | ||
|
|
||
| const renderCrashScreen = (resetErrorBoundary = jest.fn()) => | ||
| render( | ||
| <CrashErrorComponent | ||
| error={{ message: "boom", stack: "at boom" }} | ||
| resetErrorBoundary={resetErrorBoundary} | ||
| />, | ||
| ); | ||
|
|
||
| describe("CrashErrorComponent accessibility", () => { | ||
| it("should_have_no_axe_violations", async () => { | ||
| const { container } = renderCrashScreen(); | ||
|
|
||
| expect(await axe(container)).toHaveNoViolations(); | ||
| }); | ||
|
|
||
| // The crash screen replaces the whole app, so it owns the page's heading | ||
| // structure. Rendering the title as a <p> left the page with zero headings | ||
| // (WCAG 1.3.1 / 2.4.6). | ||
| it("should_expose_the_title_as_the_page_heading", () => { | ||
| renderCrashScreen(); | ||
|
|
||
| expect( | ||
| screen.getByRole("heading", { level: 1, name: /unexpected error/i }), | ||
| ).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| // Nothing announced the failure to a screen reader: the boundary swaps the | ||
| // tree without moving focus, so the region has to assert itself (WCAG 4.1.3). | ||
| it("should_announce_the_failure_through_an_alert_region", () => { | ||
| renderCrashScreen(); | ||
|
|
||
| expect(screen.getByRole("alert")).toContainElement( | ||
| screen.getByRole("heading", { level: 1 }), | ||
| ); | ||
| }); | ||
|
|
||
| // The report action used to be a <button> nested inside an <a href>, which | ||
| // is a nested-interactive violation and gives the anchor no reachable name | ||
| // of its own (WCAG 4.1.2). | ||
| it("should_render_the_report_action_as_a_single_link", () => { | ||
| renderCrashScreen(); | ||
|
|
||
| const report = screen.getByRole("link", { name: /report on github/i }); | ||
| expect(report).toHaveAttribute( | ||
| "href", | ||
| "https://github.com/langflow-ai/langflow/issues/new", | ||
| ); | ||
| expect(report.querySelector("button")).toBeNull(); | ||
| expect( | ||
| screen.queryByRole("button", { name: /report on github/i }), | ||
| ).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it("should_reset_the_error_boundary_from_the_restart_button", async () => { | ||
| const user = userEvent.setup(); | ||
| const resetErrorBoundary = jest.fn(); | ||
| renderCrashScreen(resetErrorBoundary); | ||
|
|
||
| await user.click(screen.getByRole("button", { name: /restart/i })); | ||
|
|
||
| expect(resetErrorBoundary).toHaveBeenCalled(); | ||
| }); | ||
| }); |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: langflow-ai/langflow
Length of output: 539
Add
input.searchOptionsto all shipped locale files.The locale files under
src/frontend/src/locales/do not define this key, so non-English users will get a raw key or blank label instead of the translated search-options label.🤖 Prompt for AI Agents