Skip to content

Commit ea9e98c

Browse files
authored
Merge pull request #8321 from gitbutlerapp/refactor-commit-and-file-views
test: add and update mock backend and tests for commit changes and diff handling
2 parents 77a5753 + 3140c0b commit ea9e98c

File tree

4 files changed

+2
-20
lines changed

4 files changed

+2
-20
lines changed

apps/desktop/src/components/v3/CommitMessageEditor.svelte

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import { tick } from 'svelte';
1717
1818
type Props = {
19-
existingCommitId?: string;
2019
projectId: string;
2120
stackId?: string;
2221
actionLabel: string;
@@ -29,7 +28,6 @@
2928
};
3029
3130
const {
32-
existingCommitId,
3331
projectId,
3432
stackId,
3533
actionLabel,
@@ -142,14 +140,6 @@
142140
}
143141
</script>
144142

145-
<CommitSuggestionsPlugin
146-
bind:this={commitSuggestionsPlugin}
147-
{projectId}
148-
{canUseAI}
149-
{suggestionsHandler}
150-
{existingCommitId}
151-
/>
152-
153143
<div class="commit-message-wrap">
154144
<MessageEditorInput
155145
testId={TestId.CommitDrawerTitleInput}

apps/desktop/src/components/v3/CommitView.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@
152152
initialTitle={splitMessage(commit.message).title}
153153
initialMessage={splitMessage(commit.message).description}
154154
loading={messageUpdateResult.current.isLoading}
155-
existingCommitId={commit.id}
156155
/>
157156
</Drawer>
158157
{:else}

apps/desktop/src/components/v3/FileContextMenu.svelte

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
type Props = {
2525
isUncommitted: boolean;
2626
trigger?: HTMLElement;
27-
isBinary?: boolean;
2827
unSelectChanges: (changes: TreeChange[]) => void;
2928
};
3029
@@ -42,7 +41,7 @@
4241
);
4342
}
4443
45-
const { trigger, isBinary = false, unSelectChanges, isUncommitted }: Props = $props();
44+
const { trigger, unSelectChanges, isUncommitted }: Props = $props();
4645
const [stackService, project] = inject(StackService, Project);
4746
const userSettings = getContextStoreBySymbol<Settings, Writable<Settings>>(SETTINGS);
4847
@@ -110,7 +109,7 @@
110109
<ContextMenuSection>
111110
{#if item.changes.length > 0}
112111
{@const changes = item.changes}
113-
{#if !isBinary && isUncommitted}
112+
{#if isUncommitted}
114113
<ContextMenuItem
115114
label="Discard changes"
116115
onclick={() => {

apps/desktop/src/components/v3/FileListItemWrapper.svelte

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import { draggableChips } from '$lib/dragging/draggable';
55
import { ChangeDropData } from '$lib/dragging/draggables';
66
import { getFilename } from '$lib/files/utils';
7-
import { DiffService } from '$lib/hunks/diffService.svelte';
87
import { ChangeSelectionService } from '$lib/selection/changeSelection.svelte';
98
import { IdSelection } from '$lib/selection/idSelection.svelte';
109
import { key, type SelectionId } from '$lib/selection/key';
@@ -56,17 +55,13 @@
5655
5756
const idSelection = getContext(IdSelection);
5857
const changeSelection = getContext(ChangeSelectionService);
59-
const diffService = getContext(DiffService);
6058
6159
let contextMenu = $state<ReturnType<typeof FileContextMenu>>();
6260
let draggableEl: HTMLDivElement | undefined = $state();
6361
6462
const selection = $derived(changeSelection.getById(change.path));
6563
const indeterminate = $derived(selection.current && selection.current.type === 'partial');
6664
const selectedChanges = $derived(idSelection.treeChanges(projectId, selectionId));
67-
const diffResult = $derived(diffService.getDiff(projectId, change));
68-
69-
const isBinary = $derived(diffResult.current.data?.type === 'Binary');
7065
const isUncommitted = $derived(selectionId?.type === 'worktree');
7166
7267
const previousTooltipText = $derived(
@@ -138,7 +133,6 @@
138133
bind:this={contextMenu}
139134
trigger={draggableEl}
140135
{isUncommitted}
141-
{isBinary}
142136
{unSelectChanges}
143137
/>
144138

0 commit comments

Comments
 (0)