Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,993 changes: 4,700 additions & 1,293 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/opencode-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"license": "MIT",
"dependencies": {
"@opencode-ai/plugin": "1.1.53"
"@opencode-ai/plugin": "1.1.59"
}
}
24 changes: 0 additions & 24 deletions packages/ui/src/components/instance-welcome-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,6 @@ const InstanceWelcomeView: Component<InstanceWelcomeViewProps> = (props) => {
const deleting = loading().deletingSession.get(props.instance.id)
return deleting ? deleting.has(sessionId) : false
}
const newSessionShortcut = createMemo<KeyboardShortcut>(() => {
const registered = keyboardRegistry.get("session-new")
if (registered) return registered
return {
id: "session-new-display",
key: "n",
modifiers: {
shift: true,
meta: isMac(),
ctrl: !isMac(),
},
handler: () => {},
description: t("instanceWelcome.shortcuts.newSession"),
context: "global",
}
})
const newSessionShortcutString = createMemo(() => (isMac() ? "cmd+shift+n" : "ctrl+shift+n"))

createEffect(() => {
const sessions = parentSessions()
Expand Down Expand Up @@ -109,12 +92,6 @@ const InstanceWelcomeView: Component<InstanceWelcomeViewProps> = (props) => {

const sessions = parentSessions()

if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key.toLowerCase() === "n") {
e.preventDefault()
handleNewSession()
return
}

if (sessions.length === 0) return

const listFocused = focusMode() === "sessions"
Expand Down Expand Up @@ -502,7 +479,6 @@ const InstanceWelcomeView: Component<InstanceWelcomeViewProps> = (props) => {
)}
<span>{t("instanceWelcome.new.createButton")}</span>
</div>
<Kbd shortcut={newSessionShortcutString()} class="ml-2" />
</button>
</div>
</div>
Expand Down
68 changes: 30 additions & 38 deletions packages/ui/src/components/instance/instance-shell2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,7 @@ const InstanceShell2: Component<InstanceShellProps> = (props) => {
const instancePaletteCommands = createMemo(() => props.paletteCommands())
const paletteOpen = createMemo(() => isCommandPaletteOpen(props.instance.id))

const keyboardShortcuts = createMemo(() =>
[keyboardRegistry.get("session-prev"), keyboardRegistry.get("session-next")].filter(
(shortcut): shortcut is KeyboardShortcut => Boolean(shortcut),
),
)

useSessionSidebarRequests({
useSessionSidebarRequests({
instanceId: () => props.instance.id,
sidebarContentEl: leftDrawerContentEl,
leftPinned,
Expand Down Expand Up @@ -382,16 +376,15 @@ const InstanceShell2: Component<InstanceShellProps> = (props) => {
role="presentation"
aria-hidden="true"
/>
<SessionSidebar
t={t}
instanceId={props.instance.id}
threads={sessionThreads}
activeSessionId={activeSessionIdForInstance}
activeSession={activeSessionForInstance}
showSearch={showSessionSearch}
onToggleSearch={() => setShowSessionSearch((current) => !current)}
keyboardShortcuts={keyboardShortcuts}
isPhoneLayout={isPhoneLayout}
<SessionSidebar
t={t}
instanceId={props.instance.id}
threads={sessionThreads}
activeSessionId={activeSessionIdForInstance}
activeSession={activeSessionForInstance}
showSearch={showSessionSearch}
onToggleSearch={() => setShowSessionSearch((current) => !current)}
isPhoneLayout={isPhoneLayout}
drawerState={leftDrawerState}
leftPinned={leftPinned}
onSelectSession={handleSessionSelect}
Expand Down Expand Up @@ -443,27 +436,26 @@ const InstanceShell2: Component<InstanceShellProps> = (props) => {
aria-hidden="true"
/>
</Show>
<SessionSidebar
t={t}
instanceId={props.instance.id}
threads={sessionThreads}
activeSessionId={activeSessionIdForInstance}
activeSession={activeSessionForInstance}
showSearch={showSessionSearch}
onToggleSearch={() => setShowSessionSearch((current) => !current)}
keyboardShortcuts={keyboardShortcuts}
isPhoneLayout={isPhoneLayout}
drawerState={leftDrawerState}
leftPinned={leftPinned}
onSelectSession={handleSessionSelect}
onNewSession={props.onNewSession}
onSidebarAgentChange={props.handleSidebarAgentChange}
onSidebarModelChange={props.handleSidebarModelChange}
onPinLeftDrawer={pinLeftDrawer}
onUnpinLeftDrawer={unpinLeftDrawer}
onCloseLeftDrawer={closeLeftDrawer}
setContentEl={setLeftDrawerContentEl}
/>
<SessionSidebar
t={t}
instanceId={props.instance.id}
threads={sessionThreads}
activeSessionId={activeSessionIdForInstance}
activeSession={activeSessionForInstance}
showSearch={showSessionSearch}
onToggleSearch={() => setShowSessionSearch((current) => !current)}
isPhoneLayout={isPhoneLayout}
drawerState={leftDrawerState}
leftPinned={leftPinned}
onSelectSession={handleSessionSelect}
onNewSession={props.onNewSession}
onSidebarAgentChange={props.handleSidebarAgentChange}
onSidebarModelChange={props.handleSidebarModelChange}
onPinLeftDrawer={pinLeftDrawer}
onUnpinLeftDrawer={unpinLeftDrawer}
onCloseLeftDrawer={closeLeftDrawer}
setContentEl={setLeftDrawerContentEl}
/>
</Drawer>
)
}
Expand Down
13 changes: 0 additions & 13 deletions packages/ui/src/components/instance/shell/SessionSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ interface SessionSidebarProps {

showSearch: Accessor<boolean>
onToggleSearch: () => void

keyboardShortcuts: Accessor<KeyboardShortcut[]>
isPhoneLayout: Accessor<boolean>
drawerState: Accessor<DrawerViewState>
leftPinned: Accessor<boolean>
Expand Down Expand Up @@ -119,11 +117,6 @@ const SessionSidebar: Component<SessionSidebarProps> = (props) => (
</Show>
</div>
</div>
<div class="session-sidebar-shortcuts">
<Show when={props.keyboardShortcuts().length}>
<KeyboardHint shortcuts={props.keyboardShortcuts()} separator=" " showDescription={false} />
</Show>
</div>
</div>

<div class="session-sidebar flex flex-col flex-1 min-h-0">
Expand Down Expand Up @@ -165,12 +158,6 @@ const SessionSidebar: Component<SessionSidebarProps> = (props) => (
/>

<ThinkingSelector instanceId={props.instanceId} currentModel={activeSession().model} />

<div class="session-sidebar-selector-hints" aria-hidden="true">
<Kbd shortcut="cmd+shift+a" />
<Kbd shortcut="cmd+shift+m" />
<Kbd shortcut="cmd+shift+t" />
</div>
</div>
</>
)}
Expand Down
19 changes: 0 additions & 19 deletions packages/ui/src/lib/hooks/use-app-lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { onMount, onCleanup, type Accessor } from "solid-js"
import { setupTabKeyboardShortcuts } from "../keyboard"
import { registerNavigationShortcuts } from "../shortcuts/navigation"
import { registerInputShortcuts } from "../shortcuts/input"
import { registerAgentShortcuts } from "../shortcuts/agent"
import { registerEscapeShortcut, setEscapeStateChangeHandler } from "../shortcuts/escape"
import { keyboardRegistry } from "../keyboard-registry"
import { abortSession, getSessions, isSessionBusy } from "../../stores/sessions"
Expand Down Expand Up @@ -58,24 +57,6 @@ export function useAppLifecycle(options: UseAppLifecycleOptions) {
},
)

registerAgentShortcuts(
() => {
const instance = options.getActiveInstance()
if (!instance) return
emitSessionSidebarRequest({ instanceId: instance.id, action: "focus-model-selector" })
},
() => {
const instance = options.getActiveInstance()
if (!instance) return
emitSessionSidebarRequest({ instanceId: instance.id, action: "focus-agent-selector" })
},
() => {
const instance = options.getActiveInstance()
if (!instance) return
emitSessionSidebarRequest({ instanceId: instance.id, action: "focus-variant-selector" })
},
)

registerEscapeShortcut(
() => {
if (options.showFolderSelection()) return true
Expand Down
95 changes: 0 additions & 95 deletions packages/ui/src/lib/hooks/use-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ export function useCommands(options: UseCommandsOptions) {
description: () => tGlobal("commands.newSession.description"),
category: "Session",
keywords: () => splitKeywords("commands.newSession.keywords"),
shortcut: { key: "N", meta: true, shift: true },
action: async () => {
const instance = activeInstance()
if (!instance) return
Expand Down Expand Up @@ -179,57 +178,6 @@ export function useCommands(options: UseCommandsOptions) {
},
})

commandRegistry.register({
id: "session-next",
label: () => tGlobal("commands.nextSession.label"),
description: () => tGlobal("commands.nextSession.description"),
category: "Session",
keywords: () => splitKeywords("commands.nextSession.keywords"),
shortcut: { key: "]", meta: true, shift: true },
action: () => {
const instanceId = activeInstanceId()
if (!instanceId) return
const ids = getVisibleSessionIds(instanceId)
if (ids.length <= 1) return

const currentActiveId = activeSessionIdForInstance() ?? ""
const currentIndex = ids.indexOf(currentActiveId)
const targetIndex = (currentIndex + 1 + ids.length) % ids.length

const targetSessionId = ids[targetIndex]
if (targetSessionId) {
setActiveSessionFromList(instanceId, targetSessionId)
emitSessionSidebarRequest({ instanceId, action: "show-session-list" })
}
},
})

commandRegistry.register({
id: "session-prev",
label: () => tGlobal("commands.previousSession.label"),
description: () => tGlobal("commands.previousSession.description"),
category: "Session",
keywords: () => splitKeywords("commands.previousSession.keywords"),
shortcut: { key: "[", meta: true, shift: true },
action: () => {
const instanceId = activeInstanceId()
if (!instanceId) return
const ids = getVisibleSessionIds(instanceId)
if (ids.length <= 1) return

const currentActiveId = activeSessionIdForInstance() ?? ""
const currentIndex = ids.indexOf(currentActiveId)
const targetIndex =
currentIndex === -1 ? ids.length - 1 : currentIndex <= 0 ? ids.length - 1 : currentIndex - 1

const targetSessionId = ids[targetIndex]
if (targetSessionId) {
setActiveSessionFromList(instanceId, targetSessionId)
emitSessionSidebarRequest({ instanceId, action: "show-session-list" })
}
},
})

commandRegistry.register({
id: "compact",
label: () => tGlobal("commands.compactSession.label"),
Expand Down Expand Up @@ -365,49 +313,6 @@ export function useCommands(options: UseCommandsOptions) {
variant: "error",
})
}

},
})

commandRegistry.register({
id: "open-model-selector",
label: () => tGlobal("commands.openModelSelector.label"),
description: () => tGlobal("commands.openModelSelector.description"),
category: "Agent & Model",
keywords: () => splitKeywords("commands.openModelSelector.keywords"),
shortcut: { key: "M", meta: true, shift: true },
action: () => {
const instance = activeInstance()
if (!instance) return
emitSessionSidebarRequest({ instanceId: instance.id, action: "focus-model-selector" })
},
})

commandRegistry.register({
id: "open-variant-selector",
label: () => tGlobal("commands.selectModelVariant.label"),
description: () => tGlobal("commands.selectModelVariant.description"),
category: "Agent & Model",
keywords: () => splitKeywords("commands.selectModelVariant.keywords"),
shortcut: { key: "T", meta: true, shift: true },
action: () => {
const instance = activeInstance()
if (!instance) return
emitSessionSidebarRequest({ instanceId: instance.id, action: "focus-variant-selector" })
},
})

commandRegistry.register({
id: "open-agent-selector",
label: () => tGlobal("commands.openAgentSelector.label"),
description: () => tGlobal("commands.openAgentSelector.description"),
category: "Agent & Model",
keywords: () => splitKeywords("commands.openAgentSelector.keywords"),
shortcut: { key: "A", meta: true, shift: true },
action: () => {
const instance = activeInstance()
if (!instance) return
emitSessionSidebarRequest({ instanceId: instance.id, action: "focus-agent-selector" })
},
})

Expand Down
16 changes: 0 additions & 16 deletions packages/ui/src/lib/keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,6 @@ 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()
Expand Down
36 changes: 2 additions & 34 deletions packages/ui/src/lib/shortcuts/agent.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
import { keyboardRegistry } from "../keyboard-registry"

export function registerAgentShortcuts(
focusModelSelector: () => void,
openAgentSelector: () => void,
focusVariantSelector: () => void,
) {
const isMac = () => navigator.platform.toLowerCase().includes("mac")

keyboardRegistry.register({
id: "focus-model",
key: "M",
modifiers: { ctrl: !isMac(), meta: isMac(), shift: true },
handler: focusModelSelector,
description: "focus model",
context: "global",
})

keyboardRegistry.register({
id: "open-agent-selector",
key: "A",
modifiers: { ctrl: !isMac(), meta: isMac(), shift: true },
handler: openAgentSelector,
description: "open agent",
context: "global",
})

keyboardRegistry.register({
id: "focus-variant",
key: "T",
modifiers: { ctrl: !isMac(), meta: isMac(), shift: true },
handler: focusVariantSelector,
description: "focus thinking",
context: "global",
})
}
// Shortcuts removed as per user request
export {}
Loading