Skip to content

Commit 2f82661

Browse files
committed
Rename branch parameters -> stack
1 parent b2817ab commit 2f82661

File tree

11 files changed

+51
-51
lines changed

11 files changed

+51
-51
lines changed

apps/desktop/src/lib/branch/BranchLane.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import { writable } from 'svelte/store';
2121
import { slide } from 'svelte/transition';
2222
23-
const { branch }: { branch: BranchStack } = $props();
23+
const { stack: branch }: { stack: BranchStack } = $props();
2424
2525
// BRANCH
2626
const branchStore = createContextStore(BranchStack, branch);

apps/desktop/src/lib/branches/dragActions.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@ import type { BranchController } from '$lib/vbranches/branchController';
66
class BranchDragActions {
77
constructor(
88
private branchController: BranchController,
9-
private branch: BranchStack
9+
private stack: BranchStack
1010
) {}
1111

1212
acceptMoveCommit(data: any) {
1313
return (
14-
data instanceof CommitDropData && data.branchId !== this.branch.id && !data.commit.conflicted
14+
data instanceof CommitDropData && data.branchId !== this.stack.id && !data.commit.conflicted
1515
);
1616
}
1717

1818
onMoveCommit(data: CommitDropData) {
19-
this.branchController.moveCommit(this.branch.id, data.commit.id, data.commit.branchId);
19+
this.branchController.moveCommit(this.stack.id, data.commit.id, data.commit.branchId);
2020
}
2121

2222
acceptBranchDrop(data: any) {
23-
if (data instanceof HunkDropData && !data.commitId && data.branchId !== this.branch.id) {
23+
if (data instanceof HunkDropData && !data.commitId && data.branchId !== this.stack.id) {
2424
return !data.hunk.locked;
2525
} else if (
2626
data instanceof FileDropData &&
2727
data.file instanceof LocalFile &&
28-
this.branch.id !== data.branchId
28+
this.stack.id !== data.branchId
2929
) {
3030
return !data.files.some((f) => f.locked);
3131
} else {
@@ -37,14 +37,14 @@ class BranchDragActions {
3737
if (data instanceof HunkDropData) {
3838
const newOwnership = `${data.hunk.filePath}:${data.hunk.id}`;
3939
this.branchController.updateBranchOwnership(
40-
this.branch.id,
41-
(newOwnership + '\n' + this.branch.ownership).trim()
40+
this.stack.id,
41+
(newOwnership + '\n' + this.stack.ownership).trim()
4242
);
4343
} else if (data instanceof FileDropData) {
4444
const newOwnership = filesToOwnership(data.files);
4545
this.branchController.updateBranchOwnership(
46-
this.branch.id,
47-
(newOwnership + '\n' + this.branch.ownership).trim()
46+
this.stack.id,
47+
(newOwnership + '\n' + this.stack.ownership).trim()
4848
);
4949
}
5050
}
@@ -53,7 +53,7 @@ class BranchDragActions {
5353
export class BranchDragActionsFactory {
5454
constructor(private branchController: BranchController) {}
5555

56-
build(branch: BranchStack) {
57-
return new BranchDragActions(this.branchController, branch);
56+
build(stack: BranchStack) {
57+
return new BranchDragActions(this.branchController, stack);
5858
}
5959
}

apps/desktop/src/lib/commit/CommitCard.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
}}
226226
bind:menu={contextMenu}
227227
baseBranch={$baseBranch}
228-
{branch}
228+
stack={branch}
229229
{commit}
230230
isRemote={type === 'remote'}
231231
commitUrl={showOpenInBrowser ? commitUrl : undefined}

apps/desktop/src/lib/commit/CommitContextMenu.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
leftClickTrigger: HTMLElement | undefined;
1515
rightClickTrigger: HTMLElement | undefined;
1616
baseBranch: BaseBranch;
17-
branch: BranchStack | undefined;
17+
stack: BranchStack | undefined;
1818
commit: DetailedCommit | Commit;
1919
commitUrl: string | undefined;
2020
isRemote: boolean;
@@ -30,7 +30,7 @@
3030
leftClickTrigger,
3131
rightClickTrigger,
3232
baseBranch,
33-
branch,
33+
stack: branch,
3434
commit,
3535
commitUrl,
3636
isRemote,

apps/desktop/src/lib/commits/dragActions.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class CommitDragActions {
1414
constructor(
1515
private branchController: BranchController,
1616
private project: Project,
17-
private branch: BranchStack,
17+
private stack: BranchStack,
1818
private commit: DetailedCommit | Commit
1919
) {}
2020

@@ -33,14 +33,14 @@ export class CommitDragActions {
3333

3434
if (
3535
dropData instanceof HunkDropData &&
36-
dropData.branchId === this.branch.id &&
36+
dropData.branchId === this.stack.id &&
3737
dropData.commitId !== this.commit.id &&
3838
!this.commit.conflicted
3939
) {
4040
return true;
4141
} else if (
4242
dropData instanceof FileDropData &&
43-
dropData.branchId === this.branch.id &&
43+
dropData.branchId === this.stack.id &&
4444
dropData.commit?.id !== this.commit.id &&
4545
!this.commit.conflicted
4646
) {
@@ -53,18 +53,18 @@ export class CommitDragActions {
5353
onAmend(dropData: unknown): void {
5454
if (dropData instanceof HunkDropData) {
5555
const newOwnership = `${dropData.hunk.filePath}:${dropData.hunk.id}`;
56-
this.branchController.amendBranch(this.branch.id, this.commit.id, newOwnership);
56+
this.branchController.amendBranch(this.stack.id, this.commit.id, newOwnership);
5757
} else if (dropData instanceof FileDropData) {
5858
if (dropData.file instanceof LocalFile) {
5959
// this is an uncommitted file change being amended to a previous commit
6060
const newOwnership = filesToOwnership(dropData.files);
61-
this.branchController.amendBranch(this.branch.id, this.commit.id, newOwnership);
61+
this.branchController.amendBranch(this.stack.id, this.commit.id, newOwnership);
6262
} else if (dropData.file instanceof RemoteFile) {
6363
// this is a file from a commit, rather than an uncommitted file
6464
const newOwnership = filesToSimpleOwnership(dropData.files);
6565
if (dropData.commit) {
6666
this.branchController.moveCommitFile(
67-
this.branch.id,
67+
this.stack.id,
6868
dropData.commit.id,
6969
this.commit.id,
7070
newOwnership
@@ -79,7 +79,7 @@ export class CommitDragActions {
7979
return false;
8080
}
8181
if (!(dropData instanceof CommitDropData)) return false;
82-
if (dropData.branchId !== this.branch.id) return false;
82+
if (dropData.branchId !== this.stack.id) return false;
8383

8484
if (this.commit.conflicted || dropData.commit.conflicted) return false;
8585

@@ -116,7 +116,7 @@ export class CommitDragActionsFactory {
116116
private project: Project
117117
) {}
118118

119-
build(branch: BranchStack, commit: DetailedCommit | Commit) {
120-
return new CommitDragActions(this.branchController, this.project, branch, commit);
119+
build(stack: BranchStack, commit: DetailedCommit | Commit) {
120+
return new CommitDragActions(this.branchController, this.project, stack, commit);
121121
}
122122
}

apps/desktop/src/lib/components/Board.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
clone?.remove();
140140
}}
141141
>
142-
<BranchLane {branch} />
142+
<BranchLane stack={branch} />
143143
</div>
144144
{/each}
145145
</div>

apps/desktop/src/lib/dragging/stackingReorderDropzoneManager.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ export class StackingReorderDropzoneManager {
4848

4949
constructor(
5050
private branchController: BranchController,
51-
private branch: BranchStack
51+
private stack: BranchStack
5252
) {
5353
const seriesMap = new Map();
54-
this.branch.validSeries.forEach((series) => {
54+
this.stack.validSeries.forEach((series) => {
5555
seriesMap.set(series.name, series);
5656
});
5757
this.series = seriesMap;
@@ -64,10 +64,10 @@ export class StackingReorderDropzoneManager {
6464
}
6565

6666
return new StackingReorderDropzone(
67-
this.branch.id,
67+
this.stack.id,
6868
this.branchController,
6969
currentSeries,
70-
this.branch.validSeries,
70+
this.stack.validSeries,
7171
'top'
7272
);
7373
}
@@ -79,10 +79,10 @@ export class StackingReorderDropzoneManager {
7979
}
8080

8181
return new StackingReorderDropzone(
82-
this.branch.id,
82+
this.stack.id,
8383
this.branchController,
8484
currentSeries,
85-
this.branch.validSeries,
85+
this.stack.validSeries,
8686
commitId
8787
);
8888
}
@@ -91,8 +91,8 @@ export class StackingReorderDropzoneManager {
9191
export class StackingReorderDropzoneManagerFactory {
9292
constructor(private branchController: BranchController) {}
9393

94-
build(branch: BranchStack) {
95-
return new StackingReorderDropzoneManager(this.branchController, branch);
94+
build(stack: BranchStack) {
95+
return new StackingReorderDropzoneManager(this.branchController, stack);
9696
}
9797
}
9898

apps/desktop/src/lib/stack/SeriesList.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
import { isError } from '@gitbutler/ui/utils/typeguards';
1919
2020
interface Props {
21-
branch: BranchStack;
21+
stack: BranchStack;
2222
lastPush: Date | undefined;
2323
}
2424
25-
const { branch, lastPush }: Props = $props();
25+
const { stack: branch, lastPush }: Props = $props();
2626
2727
const branchController = getContext(BranchController);
2828

apps/desktop/src/lib/stack/Stack.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
class="branch-card__contents"
182182
>
183183
<StackHeader
184-
{branch}
184+
stack={branch}
185185
onCollapseButtonClick={() => {
186186
$isLaneCollapsed = true;
187187
}}
@@ -216,7 +216,7 @@
216216
<Spacer dotted />
217217
<div style:position="relative">
218218
<div class="lane-branches">
219-
<SeriesList {branch} {lastPush} />
219+
<SeriesList stack={branch} {lastPush} />
220220
</div>
221221
{#if canPush}
222222
<div

apps/desktop/src/lib/stack/header/StackHeader.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
import { isError } from '@gitbutler/ui/utils/typeguards';
88
99
interface Props {
10-
branch: BranchStack;
10+
stack: BranchStack;
1111
onCollapseButtonClick: () => void;
1212
}
1313
1414
const branchController = getContext(BranchController);
1515
16-
const { onCollapseButtonClick, branch }: Props = $props();
16+
const { onCollapseButtonClick, stack: branch }: Props = $props();
1717
1818
const nonArchivedSeries = $derived(
1919
branch.series.filter((s) => {

0 commit comments

Comments
 (0)