Repository navigation
🤖 fix: Ctrl+I on the new-workspace screen, collapse button focus ring, actions tooltip name, fast mode feedback #5744
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
+126
−5
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| // #5681, #5687, #5688, #5693: keyboard focus, labels and shortcut feedback. Each test fails on | ||
| // the old code. | ||
| import { test } from "@e2e-dev/web"; | ||
| import { expect } from "e2e"; | ||
| import { disableTutorials, openPlayground } from "./helpers"; | ||
|
|
||
| test( | ||
| "Ctrl+I focuses the composer on the new-workspace screen", | ||
| { tags: ["bugbash", "5687"] }, | ||
| async ({ app, screen, browser }) => { | ||
| await browser.setViewport({ width: 1440, height: 900 }); | ||
| await disableTutorials(browser); | ||
| await app.open(); | ||
| const composer = screen.getByRole("textbox", "Message"); | ||
| await expect(composer).toBeVisible({ timeout: 15_000 }); | ||
| // The screen opens with the composer focused, so move focus away first. | ||
| await browser.evaluate(() => { | ||
| if (document.activeElement instanceof HTMLElement) document.activeElement.blur(); | ||
| return null; | ||
| }); | ||
| await expect(composer).not.toBeFocused(); | ||
|
|
||
| await browser.keyboard.press("Control+i"); | ||
| await expect(composer).toBeFocused(); | ||
|
|
||
| // With the command palette open, Ctrl+I leaves focus in the palette. | ||
| await browser.keyboard.press("Control+Shift+P"); | ||
| const palette = screen.getByRole("combobox", "Command palette"); | ||
| await expect(palette).toBeFocused(); | ||
| await browser.keyboard.press("Control+i"); | ||
| await expect(palette).toBeFocused(); | ||
| } | ||
| ); | ||
|
|
||
| test( | ||
| "The right sidebar's collapse button shows a focus ring", | ||
| { tags: ["bugbash", "5688"] }, | ||
| async ({ app, screen, browser }) => { | ||
| await browser.setViewport({ width: 1440, height: 900 }); | ||
| await openPlayground(app, screen, browser); | ||
| const collapse = screen | ||
| .getByRole("complementary", "Workspace insights") | ||
| .getByRole("button", "Collapse sidebar"); | ||
| await expect(collapse).toBeVisible(); | ||
| // A key press first, so the browser treats the next focus as keyboard focus (:focus-visible). | ||
| await browser.keyboard.press("Shift"); | ||
| await collapse.focus(); | ||
|
|
||
| await expect | ||
| .poll(() => | ||
| browser.evaluate(() => { | ||
| const el = document.activeElement; | ||
| if (!(el instanceof HTMLElement) || !el.matches(":focus-visible")) | ||
| return "no focus-visible"; | ||
| return getComputedStyle(el).boxShadow; | ||
| }) | ||
| ) | ||
| .not.toMatch(/^(none|no focus-visible)$/); | ||
| } | ||
| ); | ||
|
|
||
| test( | ||
| "The workspace actions tooltip uses the button's accessible name", | ||
| { tags: ["bugbash", "5681"] }, | ||
| async ({ app, screen, browser }) => { | ||
| await browser.setViewport({ width: 1440, height: 900 }); | ||
| await openPlayground(app, screen, browser); | ||
| await screen.getByRole("button", "Workspace actions").hover(); | ||
|
|
||
| await expect(screen.getByRole("tooltip")).toHaveText("Workspace actions"); | ||
| } | ||
| ); | ||
|
|
||
| test( | ||
| "The fast mode shortcut explains why fast mode is unavailable", | ||
| { tags: ["bugbash", "5693"] }, | ||
| async ({ app, screen, browser }) => { | ||
| await browser.setViewport({ width: 1440, height: 900 }); | ||
| // The seeded Anthropic provider uses a loopback base URL, so fast mode is unavailable. | ||
| await openPlayground(app, screen, browser); | ||
| await screen.getByRole("textbox", "Message").tap(); | ||
|
|
||
| await browser.keyboard.press("Control+Shift+F"); | ||
| await expect(screen.getByText(/^Fast mode is not available/)).toBeVisible(); | ||
| } | ||
| ); |
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.
Uh oh!
There was an error while loading. Please reload this page.