Skip to content

Commit e9b0597

Browse files
committed
Unselect all when closing uncommitted file preview
1 parent 54a3fcc commit e9b0597

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

apps/desktop/src/components/BranchesView.svelte

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,7 @@
403403
{#if !isNonLocalPr}
404404
<div class="preview-selection">
405405
<ConfigurableScrollableContainer zIndex="var(--z-lifted)">
406-
<SelectionView
407-
testId={TestId.BranchesSelectionView}
408-
{projectId}
409-
{selectionId}
410-
notClosable
411-
/>
406+
<SelectionView testId={TestId.BranchesSelectionView} {projectId} {selectionId} />
412407
</ConfigurableScrollableContainer>
413408
</div>
414409
{/if}

apps/desktop/src/components/SelectionView.svelte

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
draggableFiles?: boolean;
1919
diffOnly?: boolean;
2020
onclose?: () => void;
21-
notClosable?: boolean;
2221
testId?: string;
2322
bottomBorder?: boolean;
2423
};
@@ -29,7 +28,6 @@
2928
draggableFiles: draggable,
3029
diffOnly,
3130
onclose,
32-
notClosable,
3331
testId,
3432
bottomBorder
3533
}: Props = $props();
@@ -83,14 +81,7 @@
8381
isHeader
8482
executable={!!isExecutable}
8583
listMode="list"
86-
onCloseClick={notClosable
87-
? undefined
88-
: () => {
89-
if (idSelection) {
90-
idSelection.remove(selectedFile.path, selectedFile);
91-
}
92-
onclose?.();
93-
}}
84+
onCloseClick={onclose}
9485
/>
9586
{/if}
9687
<UnifiedDiffView

apps/desktop/src/components/WorkspaceView.svelte

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,15 @@
136136

137137
{#snippet leftPreview()}
138138
<ConfigurableScrollableContainer zIndex="var(--z-lifted)">
139-
<SelectionView bottomBorder {projectId} {selectionId} draggableFiles />
139+
<SelectionView
140+
bottomBorder
141+
{projectId}
142+
{selectionId}
143+
draggableFiles
144+
onclose={() => {
145+
idSelection.clear(selectionId);
146+
}}
147+
/>
140148
</ConfigurableScrollableContainer>
141149
{/snippet}
142150

0 commit comments

Comments
 (0)