- 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
Showing the changes to apps/web/src/diffPanelStore.ts (1 of 111 files). Show all
Unified · Split
| @@ -1,5 +1,5 @@ | |||
| 1 | import { scopedThreadKey } from "@t3tools/client-runtime/environment"; | 1 | import { scopedThreadKey } from "@t3tools/client-runtime/environment"; |
| 2 | import type { ScopedThreadRef, TurnId } from "@t3tools/contracts"; | 2 | import type { RunId, ScopedThreadRef } from "@t3tools/contracts"; |
| 3 | import { create } from "zustand"; | 3 | import { create } from "zustand"; |
| 4 | import { createJSONStorage, persist } from "zustand/middleware"; | 4 | import { createJSONStorage, persist } from "zustand/middleware"; |
| 5 | 5 | ||
| @@ -8,7 +8,7 @@ import { resolveStorage } from "./lib/storage"; · 2 unmodified lines | |||
| 8 | export type DiffPanelSelection = | 8 | export 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 | ||
| 13 | const DEFAULT_SELECTION: DiffPanelSelection = { kind: "branch", baseRef: null }; | 13 | const DEFAULT_SELECTION: DiffPanelSelection = { kind: "branch", baseRef: null }; |
| 14 | const DEFAULT_WORKING_TREE_SELECTION: DiffPanelSelection = { kind: "unstaged" }; | 14 | const 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 | ), |