diff options
| author | Adam <[email protected]> | 2026-02-04 06:22:55 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2026-02-04 06:22:55 -0600 |
| commit | a219615fe5aeb6a40898300b17f076072aed5bcc (patch) | |
| tree | 663a1571f1138ccf96ea85df08de27ed790be131 /packages/app/src/context | |
| parent | af06175b1f293ea13d4165cee56db65fbbd56c65 (diff) | |
| download | opencode-a219615fe5aeb6a40898300b17f076072aed5bcc.tar.gz opencode-a219615fe5aeb6a40898300b17f076072aed5bcc.zip | |
fix(app): opened tabs follow created session
Diffstat (limited to 'packages/app/src/context')
| -rw-r--r-- | packages/app/src/context/layout.tsx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/app/src/context/layout.tsx b/packages/app/src/context/layout.tsx index 28fe628a8..71f3f6cff 100644 --- a/packages/app/src/context/layout.tsx +++ b/packages/app/src/context/layout.tsx @@ -35,6 +35,12 @@ type SessionView = { reviewOpen?: string[] } +type TabHandoff = { + dir: string + id: string + at: number +} + export type LocalProject = Partial<Project> & { worktree: string; expanded: boolean } export type ReviewDiffStyle = "unified" | "split" @@ -115,6 +121,9 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext( }, sessionTabs: {} as Record<string, SessionTabs>, sessionView: {} as Record<string, SessionView>, + handoff: { + tabs: undefined as TabHandoff | undefined, + }, }), ) @@ -411,6 +420,16 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext( return { ready, + handoff: { + tabs: createMemo(() => store.handoff?.tabs), + setTabs(dir: string, id: string) { + setStore("handoff", "tabs", { dir, id, at: Date.now() }) + }, + clearTabs() { + if (!store.handoff?.tabs) return + setStore("handoff", "tabs", undefined) + }, + }, projects: { list, open(directory: string) { |
