History

Complete orchestration V2 frontend cutover

- Migrate web and mobile state, commands, and persistence to V2 projections - Render conversations from authoritative visible turn items - Harden runtime policy, launch handling, attachments, and cache invalidation

Julius Marminge committed 4 months ago

Commit 3991a001 parent 75e1269111 files · +6259 −9197Browse files

Showing the changes to apps/web/src/diffPanelStore.ts (1 of 111 files). Show all

Unified · Split

apps/web/src/diffPanelStore.ts+5−5
@@ -1,5 +1,5 @@
1import { scopedThreadKey } from "@t3tools/client-runtime/environment";1import { scopedThreadKey } from "@t3tools/client-runtime/environment";
2import type { ScopedThreadRef, TurnId } from "@t3tools/contracts";2import type { RunId, ScopedThreadRef } from "@t3tools/contracts";
3import { create } from "zustand";3import { create } from "zustand";
4import { createJSONStorage, persist } from "zustand/middleware";4import { createJSONStorage, persist } from "zustand/middleware";
5 5
@@ -8,7 +8,7 @@ import { resolveStorage } from "./lib/storage"; · 2 unmodified lines
8export type DiffPanelSelection =8export type DiffPanelSelection =
9 | { kind: "branch"; baseRef: string | null }9 | { kind: "branch"; baseRef: string | null }
10 | { kind: "unstaged" }10 | { kind: "unstaged" }
11 | { kind: "turn"; turnId: TurnId; filePath: string | null; revealRequestId: number };11 | { kind: "turn"; turnId: RunId; filePath: string | null; revealRequestId: number };
12 12
13const DEFAULT_SELECTION: DiffPanelSelection = { kind: "branch", baseRef: null };13const DEFAULT_SELECTION: DiffPanelSelection = { kind: "branch", baseRef: null };
14const DEFAULT_WORKING_TREE_SELECTION: DiffPanelSelection = { kind: "unstaged" };14const DEFAULT_WORKING_TREE_SELECTION: DiffPanelSelection = { kind: "unstaged" };
@@ -18,8 +18,8 @@ interface DiffPanelStoreState { · 3 unmodified lines
18 branchBaseRefByThreadKey: Record<string, string | null>;18 branchBaseRefByThreadKey: Record<string, string | null>;
19 selectGitScope: (ref: ScopedThreadRef, scope: "branch" | "unstaged") => void;19 selectGitScope: (ref: ScopedThreadRef, scope: "branch" | "unstaged") => void;
20 selectBranchBaseRef: (ref: ScopedThreadRef, baseRef: string | null) => void;20 selectBranchBaseRef: (ref: ScopedThreadRef, baseRef: string | null) => void;
21 selectTurn: (ref: ScopedThreadRef, turnId: TurnId, filePath?: string) => void;21 selectTurn: (ref: ScopedThreadRef, turnId: RunId, filePath?: string) => void;
22 reconcileTurnSelection: (ref: ScopedThreadRef, availableTurnIds: ReadonlyArray<TurnId>) => void;22 reconcileTurnSelection: (ref: ScopedThreadRef, availableTurnIds: ReadonlyArray<RunId>) => void;
23 removeThread: (ref: ScopedThreadRef) => void;23 removeThread: (ref: ScopedThreadRef) => void;
24}24}
25 25
@@ -119,7 +119,7 @@ export const useDiffPanelStore = create<DiffPanelStoreState>()( · 93 unmodified lines
119 }),119 }),
120 {120 {
121 name: "t3code:diff-panel-state:v1",121 name: "t3code:diff-panel-state:v1",
122 version: 1,122 version: 2,
123 storage: createJSONStorage(() =>123 storage: createJSONStorage(() =>
124 resolveStorage(typeof window !== "undefined" ? window.localStorage : undefined),124 resolveStorage(typeof window !== "undefined" ? window.localStorage : undefined),
125 ),125 ),