Improve session defaults and onboarding UI

This commit is contained in:
Shantur Rathore
2025-11-07 21:22:46 +00:00
parent 7193103646
commit 5483932196
10 changed files with 254 additions and 119 deletions

View File

@@ -1,5 +1,7 @@
import { instances, activeInstanceId, setActiveInstanceId } from "../stores/instances"
import { activeSessionId, setActiveSession, getSessions, activeParentSessionId } from "../stores/sessions"
import { keyboardRegistry } from "./keyboard-registry"
import { isMac } from "./keyboard-utils"
export function setupTabKeyboardShortcuts(
handleNewInstance: () => void,
@@ -8,6 +10,22 @@ export function setupTabKeyboardShortcuts(
handleCloseSession: (instanceId: string, sessionId: string) => void,
handleCommandPalette: () => void,
) {
keyboardRegistry.register({
id: "session-new",
key: "n",
modifiers: {
shift: true,
meta: isMac(),
ctrl: !isMac(),
},
handler: () => {
const instanceId = activeInstanceId()
if (instanceId) void handleNewSession(instanceId)
},
description: "New Session",
context: "global",
})
window.addEventListener("keydown", (e) => {
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key.toLowerCase() === "p") {
e.preventDefault()
@@ -47,14 +65,6 @@ export function setupTabKeyboardShortcuts(
handleNewInstance()
}
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key.toLowerCase() === "n") {
e.preventDefault()
const instanceId = activeInstanceId()
if (instanceId) {
handleNewSession(instanceId)
}
}
if ((e.metaKey || e.ctrlKey) && !e.shiftKey && e.key.toLowerCase() === "w") {
e.preventDefault()
const instanceId = activeInstanceId()

View File

@@ -52,6 +52,8 @@ export class FileStorage {
preferences: {
showThinkingBlocks: false,
environmentVariables: {},
modelRecents: [],
agentModelSelections: {},
},
recentFolders: [],
opencodeBinaries: [],