Repository navigation
fix(web): the sidebar shortcut honors terminal and preview focus conditions #29612
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
juliusmarminge
merged 4 commits into
pingdotgg:main
from
saphid:fix/sidebar-toggle-terminal-focus
Nov 14, 2026
+52
−6
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f576efd
fix(web): the sidebar shortcut honors terminal and preview focus cond…
saphid b4c74b2
Merge remote-tracking branch 'github/main' into maria-local-29612
maria-rcks 15e2f27
merge: resolve sidebar shortcut conflict with main
github-actions[bot] 0596b37
Merge remote-tracking branch 'origin/main' into fix/sidebar-toggle-te…
juliusmarminge 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { page, userEvent } from "vite-plus/test/browser"; | ||
| import { describe, expect, it, vi } from "vite-plus/test"; | ||
|
|
||
| import { render } from "../../test/render"; | ||
|
|
||
| vi.mock(import("../state/server"), async (original) => { | ||
| const actual = await original(); | ||
| const { Atom } = await import("effect/reactivity"); | ||
| const { compileResolvedKeybindingsConfig } = await import("@t3tools/shared/keybindings"); | ||
| const keybindings = compileResolvedKeybindingsConfig([ | ||
| { key: "mod+b", command: "sidebar.toggle", when: "!terminalFocus" }, | ||
| ]); | ||
| return { ...actual, primaryServerKeybindingsAtom: Atom.make(keybindings) }; | ||
| }); | ||
| // The thread list needs live environments; the shortcut lives in the shell around it. | ||
| vi.mock(import("./Sidebar"), () => ({ default: (() => null) as never })); | ||
|
|
||
| import { AppSidebarLayout } from "./AppSidebarLayout"; | ||
|
|
||
| describe("sidebar toggle shortcut", () => { | ||
| it("leaves the key to a focused terminal when its rule excludes terminalFocus", async () => { | ||
| await page.viewport(1280, 800); | ||
| using _platform = vi.spyOn(navigator, "platform", "get").mockReturnValue("Linux x86_64"); | ||
| await using screen = await render( | ||
| <AppSidebarLayout> | ||
| <div data-terminal-owner="drawer"> | ||
| <textarea aria-label="Terminal input" /> | ||
| </div> | ||
| <button type="button">Outside</button> | ||
| </AppSidebarLayout>, | ||
| ); | ||
| const wrapper = screen.container.querySelector('[data-slot="sidebar-wrapper"]')!; | ||
|
|
||
| await userEvent.click(screen.getByRole("textbox", { name: "Terminal input" })); | ||
| await userEvent.keyboard("{Control>}b{/Control}"); | ||
| expect(wrapper.getAttribute("data-sidebar-state")).toBe("expanded"); | ||
|
|
||
| await userEvent.click(screen.getByRole("button", { name: "Outside" })); | ||
| await userEvent.keyboard("{Control>}b{/Control}"); | ||
| await vi.waitFor(() => expect(wrapper.getAttribute("data-sidebar-state")).toBe("collapsed")); | ||
| }); | ||
| }); |
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.
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.