History

Merge origin/main into orchestrator v2

Port current mainline fixes onto the orchestrator v2 architecture.

Julius Marminge committed 4 months ago

Commit 309fcab2 parents dac514e c8a04bd880 files · +82524 −12175Browse files

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

Unified · Split

apps/web/src/diffPanelStore.ts+6−1
@@ -11,6 +11,7 @@ export type DiffPanelSelection = · 10 unmodified lines
1111 | { kind: "turn"; turnId: RunId; filePath: string | null; revealRequestId: number };
1212
1313 const DEFAULT_SELECTION: DiffPanelSelection = { kind: "branch", baseRef: null };
14+const DEFAULT_WORKING_TREE_SELECTION: DiffPanelSelection = { kind: "unstaged" };
1415
1516 interface DiffPanelStoreState {
1617 byThreadKey: Record<string, DiffPanelSelection>;
@@ -133,7 +134,11 @@ export const useDiffPanelStore = create<DiffPanelStoreState>()( · 116 unmodified lines
133134 export function selectThreadDiffPanelSelection(
134135 byThreadKey: Record<string, DiffPanelSelection>,
135136 ref: ScopedThreadRef | null | undefined,
137+ hasWorkingTreeChanges = false,
136138 ): DiffPanelSelection {
137139 if (!ref) return DEFAULT_SELECTION;
138− return byThreadKey[scopedThreadKey(ref)] ?? DEFAULT_SELECTION;
140+ return (
141+ byThreadKey[scopedThreadKey(ref)] ??
142+ (hasWorkingTreeChanges ? DEFAULT_WORKING_TREE_SELECTION : DEFAULT_SELECTION)
143+ );
139144 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t