mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
Make Cmd+W close the active tab instead of the window (#64)
Intercepts the Cmd+W keydown event in the AppShell keyboard handler to close the current active tab via closeAndCleanupTab. When no tab is active, the shortcut is swallowed with no effect. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -383,10 +383,18 @@ export function AppShell({ children }: { children?: React.ReactNode }) {
|
||||
e.preventDefault();
|
||||
setSidebarCollapsed((prev) => !prev);
|
||||
}
|
||||
// Cmd+W closes the active tab instead of the window
|
||||
if (e.key === "w" && e.metaKey) {
|
||||
e.preventDefault();
|
||||
const { activeTabId } = useChatSessionStore.getState();
|
||||
if (activeTabId) {
|
||||
closeAndCleanupTab(activeTabId);
|
||||
}
|
||||
}
|
||||
};
|
||||
window.addEventListener("keydown", handler);
|
||||
return () => window.removeEventListener("keydown", handler);
|
||||
}, []);
|
||||
}, [closeAndCleanupTab]);
|
||||
|
||||
const activeSessionPersonaId = activeTab
|
||||
? sessionStore.getSession(activeTab.sessionId)?.personaId
|
||||
|
||||
Reference in New Issue
Block a user