mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-09 20:58:29 +00:00
fix(app): route new session shortcut through tabs (#35849)
This commit is contained in:
parent
95013d2936
commit
6cfe4bc34f
1 changed files with 3 additions and 6 deletions
|
|
@ -18,8 +18,6 @@ import { createSessionTabs } from "@/pages/session/helpers"
|
|||
import { extractPromptFromParts } from "@/utils/prompt"
|
||||
import { UserMessage } from "@opencode-ai/sdk/v2"
|
||||
import { useSessionLayout } from "@/pages/session/session-layout"
|
||||
import { useTabs } from "@/context/tabs"
|
||||
import { requireServerKey } from "@/utils/session-route"
|
||||
import { createSessionOwnership } from "./session-ownership"
|
||||
|
||||
export type SessionCommandContext = {
|
||||
|
|
@ -48,7 +46,6 @@ export const useSessionCommands = (actions: SessionCommandContext) => {
|
|||
const settings = useSettings()
|
||||
const sync = useSync()
|
||||
const terminal = useTerminal()
|
||||
const sessionTabs = useTabs()
|
||||
const layout = useLayout()
|
||||
const navigate = useNavigate()
|
||||
const { params, sessionKey, tabs, view } = useSessionLayout()
|
||||
|
|
@ -419,9 +416,9 @@ export const useSessionCommands = (actions: SessionCommandContext) => {
|
|||
title: language.t("command.session.new"),
|
||||
keybind: "mod+shift+s",
|
||||
slash: "new",
|
||||
onSelect: () => {
|
||||
if (params.serverKey) {
|
||||
sessionTabs.newDraft({ server: requireServerKey(params.serverKey), directory: sdk().directory })
|
||||
onSelect: (source) => {
|
||||
if (settings.general.newLayoutDesigns()) {
|
||||
command.trigger("tab.new", source)
|
||||
return
|
||||
}
|
||||
navigate(`/${params.dir}/session`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue