feat(session): add Ctrl+N new-session shortcut

This commit is contained in:
2026-08-31 17:41:33 +02:00
parent a4ee3eb7a8
commit e181b2ab12
2 changed files with 43 additions and 4 deletions
+23
View File
@@ -135,6 +135,29 @@ describe("App command progress and errors", () => {
expect(status).toHaveTextContent("Ready for your next prompt");
});
it("starts a session in selected directory with Ctrl+N", async () => {
mocks.invoke.mockImplementation((command: string) => {
if (command === "create_session_runtime")
return Promise.resolve({ runtime: { runtimeId: "runtime-new" } });
return Promise.resolve(uiState);
});
render(<App />);
const event = new KeyboardEvent("keydown", {
bubbles: true,
cancelable: true,
ctrlKey: true,
key: "n",
});
window.dispatchEvent(event);
expect(event.defaultPrevented).toBe(true);
await waitFor(() =>
expect(mocks.invoke).toHaveBeenCalledWith("create_session_runtime", {
worktreePath: "/repo",
}),
);
});
it("loads categorized snapshot selectors and derives providers from choices", async () => {
const user = userEvent.setup();
const loaded: UiState = {