-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix(agent-manager): make terminal shortcuts focus-aware #13229
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 all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
76d6ce3
fix(agent-manager): make terminal shortcuts focus-aware
marius-kilocode 7151d40
fix(agent-manager): harden terminal focus restoration
marius-kilocode 31ecd72
fix(agent-manager): defer prompt focus until session exists
marius-kilocode b0475ed
merge: resolve Agent Manager shortcut conflicts
marius-kilocode 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,5 @@ | ||
| --- | ||
| "kilo-code": patch | ||
| --- | ||
|
|
||
| Make Agent Manager shortcuts follow the focused area. In the center, Cmd/Ctrl+T creates a new session tab and Cmd/Ctrl+Shift+T creates a central terminal tab, whether the prompt or a central terminal is focused. In the right sidebar terminal, Cmd/Ctrl+T creates another sidebar terminal tab and Cmd/Ctrl+Shift+T does nothing. Returning from a terminal with Cmd/Ctrl+Shift+M restores the previous session tab before focusing its prompt. Update the shortcut dialog and hints to show the distinct actions. |
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
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
77 changes: 77 additions & 0 deletions
77
packages/kilo-vscode/tests/unit/agent-manager-session-restore.test.ts
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,77 @@ | ||
| import { describe, expect, it } from "bun:test" | ||
| import { restoreSessionAfterTerminal } from "../../webview-ui/agent-manager/selection-actions" | ||
|
|
||
| describe("Agent Manager session restoration", () => { | ||
| it("restores the remembered session after a central terminal", () => { | ||
| const selected: Array<[string, boolean]> = [] | ||
| const created: string[] = [] | ||
|
|
||
| expect( | ||
| restoreSessionAfterTerminal({ | ||
| terminal: "terminal:one", | ||
| remembered: "session:two", | ||
| sessions: [{ id: "session:one" }, { id: "session:two" }], | ||
| isPending: () => false, | ||
| select: (id, pending) => selected.push([id, pending]), | ||
| create: () => { | ||
| created.push("created") | ||
| return "pending" | ||
| }, | ||
| }), | ||
| ).toBe("ready") | ||
| expect(selected).toEqual([["session:two", false]]) | ||
| expect(created).toEqual([]) | ||
| }) | ||
|
|
||
| it("falls back to the first session when the remembered tab is gone", () => { | ||
| const selected: Array<[string, boolean]> = [] | ||
|
|
||
| expect( | ||
| restoreSessionAfterTerminal({ | ||
| terminal: "terminal:one", | ||
| remembered: "session:gone", | ||
| sessions: [{ id: "pending:one" }, { id: "session:two" }], | ||
| isPending: (id) => id.startsWith("pending:"), | ||
| select: (id, pending) => selected.push([id, pending]), | ||
| create: () => "pending", | ||
| }), | ||
| ).toBe("ready") | ||
|
|
||
| expect(selected).toEqual([["pending:one", true]]) | ||
| }) | ||
|
|
||
| it("creates a real session tab only when no session can be restored", () => { | ||
| const created: string[] = [] | ||
|
|
||
| expect( | ||
| restoreSessionAfterTerminal({ | ||
| terminal: "terminal:one", | ||
| remembered: undefined, | ||
| sessions: [], | ||
| isPending: () => false, | ||
| select: () => undefined, | ||
| create: () => { | ||
| created.push("created") | ||
| return "pending" | ||
| }, | ||
| }), | ||
| ).toBe("pending") | ||
| expect(created).toEqual(["created"]) | ||
| }) | ||
|
|
||
| it("does nothing when no central terminal is selected", () => { | ||
| const selected: string[] = [] | ||
|
|
||
| expect( | ||
| restoreSessionAfterTerminal({ | ||
| terminal: undefined, | ||
| remembered: "session:one", | ||
| sessions: [{ id: "session:one" }], | ||
| isPending: () => false, | ||
| select: (id) => selected.push(id), | ||
| create: () => selected.push("created"), | ||
| }), | ||
| ).toBe("none") | ||
| expect(selected).toEqual([]) | ||
| }) | ||
| }) |
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.
Uh oh!
There was an error while loading. Please reload this page.