Skip to content

Commit 6cfe4bc

Browse files
authored
fix(app): route new session shortcut through tabs (anomalyco#35849)
1 parent 95013d2 commit 6cfe4bc

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

packages/app/src/pages/session/use-session-commands.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import { createSessionTabs } from "@/pages/session/helpers"
1818
import { extractPromptFromParts } from "@/utils/prompt"
1919
import { UserMessage } from "@opencode-ai/sdk/v2"
2020
import { useSessionLayout } from "@/pages/session/session-layout"
21-
import { useTabs } from "@/context/tabs"
22-
import { requireServerKey } from "@/utils/session-route"
2321
import { createSessionOwnership } from "./session-ownership"
2422

2523
export type SessionCommandContext = {
@@ -48,7 +46,6 @@ export const useSessionCommands = (actions: SessionCommandContext) => {
4846
const settings = useSettings()
4947
const sync = useSync()
5048
const terminal = useTerminal()
51-
const sessionTabs = useTabs()
5249
const layout = useLayout()
5350
const navigate = useNavigate()
5451
const { params, sessionKey, tabs, view } = useSessionLayout()
@@ -419,9 +416,9 @@ export const useSessionCommands = (actions: SessionCommandContext) => {
419416
title: language.t("command.session.new"),
420417
keybind: "mod+shift+s",
421418
slash: "new",
422-
onSelect: () => {
423-
if (params.serverKey) {
424-
sessionTabs.newDraft({ server: requireServerKey(params.serverKey), directory: sdk().directory })
419+
onSelect: (source) => {
420+
if (settings.general.newLayoutDesigns()) {
421+
command.trigger("tab.new", source)
425422
return
426423
}
427424
navigate(`/${params.dir}/session`)

0 commit comments

Comments
 (0)