Showing the changes to apps/web/src/diffPanelStore.ts (1 of 3 files). Show all
Unified · Split
| @@ -10,12 +10,16 @@ export type DiffPanelSelection = · 9 unmodified lines | ||
| 10 | 10 | | { kind: "unstaged" } |
| 11 | 11 | | { kind: "turn"; turnId: TurnId; filePath: string | null; revealRequestId: number }; |
| 12 | 12 | |
| 13 | +export type DiffRenderMode = "stacked" | "split"; | |
| 14 | + | |
| 13 | 15 | const DEFAULT_SELECTION: DiffPanelSelection = { kind: "branch", baseRef: null }; |
| 14 | 16 | const DEFAULT_WORKING_TREE_SELECTION: DiffPanelSelection = { kind: "unstaged" }; |
| 15 | 17 | |
| 16 | 18 | interface DiffPanelStoreState { |
| 17 | 19 | byThreadKey: Record<string, DiffPanelSelection>; |
| 18 | 20 | branchBaseRefByThreadKey: Record<string, string | null>; |
| 21 | + diffRenderMode: DiffRenderMode; | |
| 22 | + setDiffRenderMode: (mode: DiffRenderMode) => void; | |
| 19 | 23 | selectGitScope: (ref: ScopedThreadRef, scope: "branch" | "unstaged") => void; |
| 20 | 24 | selectBranchBaseRef: (ref: ScopedThreadRef, baseRef: string | null) => void; |
| 21 | 25 | selectTurn: (ref: ScopedThreadRef, turnId: TurnId, filePath?: string) => void; |
| @@ -33,6 +37,8 @@ export const useDiffPanelStore = create<DiffPanelStoreState>()( · 11 unmodified lines | ||
| 33 | 37 | (set) => ({ |
| 34 | 38 | byThreadKey: {}, |
| 35 | 39 | branchBaseRefByThreadKey: {}, |
| 40 | + diffRenderMode: "stacked", | |
| 41 | + setDiffRenderMode: (diffRenderMode) => set({ diffRenderMode }), | |
| 36 | 42 | selectGitScope: (ref, scope) => |
| 37 | 43 | set((state) => { |
| 38 | 44 | const threadKey = scopedThreadKey(ref); |
| @@ -126,6 +132,7 @@ export const useDiffPanelStore = create<DiffPanelStoreState>()( · 87 unmodified lines | ||
| 126 | 132 | partialize: (state) => ({ |
| 127 | 133 | byThreadKey: state.byThreadKey, |
| 128 | 134 | branchBaseRefByThreadKey: state.branchBaseRefByThreadKey, |
| 135 | + diffRenderMode: state.diffRenderMode, | |
| 129 | 136 | }), |
| 130 | 137 | }, |
| 131 | 138 | ), |