Skip to content

Commit cf03f37

Browse files
committed
This is an artifact from the fat-tabs day that is no longer used
1 parent c0a89b6 commit cf03f37

File tree

11 files changed

+7
-46
lines changed

11 files changed

+7
-46
lines changed

apps/desktop/src/components/BranchCommitList.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
} else {
108108
laneState.selection.set({ branchName, commitId, upstream, previewOpen: true });
109109
}
110-
projectState.stackId.set(stackId);
111110
onselect?.();
112111
}
113112

apps/desktop/src/components/CreateBranchModal.svelte

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import dependentBranchSvg from '$components/stackTabs/assets/dependent-branch.svg?raw';
33
import newStackSvg from '$components/stackTabs/assets/new-stack.svg?raw';
44
import { STACK_SERVICE } from '$lib/stacks/stackService.svelte';
5-
import { UI_STATE } from '$lib/state/uiState.svelte';
6-
import { sleep } from '$lib/utils/sleep';
75
import { inject } from '@gitbutler/core/context';
86
97
import {
@@ -28,7 +26,6 @@
2826
2927
let { projectId, stackId }: Props = $props();
3028
const stackService = inject(STACK_SERVICE);
31-
const uiState = inject(UI_STATE);
3229
const [createNewStack, stackCreation] = stackService.newStack;
3330
const [createNewBranch, branchCreation] = stackService.newBranch;
3431
@@ -84,14 +81,10 @@
8481
8582
async function addNew() {
8683
if (createRefType === 'stack') {
87-
const stack = await createNewStack({
84+
await createNewStack({
8885
projectId,
8986
branch: { name: slugifiedRefName }
9087
});
91-
// Why is there a timing thing going on here? Without sleep you end
92-
// up on stacks[0] after creating a new one.
93-
await sleep(50);
94-
uiState.project(projectId).stackId.set(stack.id);
9588
createRefModal?.close();
9689
} else {
9790
if (!selectedStackId || !slugifiedRefName) {

apps/desktop/src/components/FeedItem.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
{getDisplayNameForWorkflowKind(action.kind)}:
200200
</span>
201201

202-
<FeedItemKind type="workflow" {projectId} kind={action.kind} />
202+
<FeedItemKind type="workflow" kind={action.kind} />
203203
</div>
204204
{:else if isFeedMessage(action)}
205205
{#if action.type === 'assistant'}
@@ -237,7 +237,7 @@
237237
{#if action.toolCalls.length > 0}
238238
<div class="action-item__content-tool-calls">
239239
{#each action.toolCalls as toolCall}
240-
<FeedItemKind type="tool-call" {projectId} {toolCall} />
240+
<FeedItemKind type="tool-call" {toolCall} />
241241
{/each}
242242
</div>
243243
{/if}

apps/desktop/src/components/FeedItemKind.svelte

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import type { WorkflowKind } from '$lib/actions/types';
88
99
interface BaseProps {
10-
projectId: string;
1110
type: 'workflow' | 'tool-call';
1211
}
1312
@@ -23,30 +22,26 @@
2322
2423
type Props = WorkflowProps | ToolCallProps;
2524
26-
const { projectId, ...rest }: Props = $props();
25+
const { ...rest }: Props = $props();
2726
const uiState = inject(UI_STATE);
2827
2928
let isExpanded = $state(false);
3029
3130
function selectCommit(stackId: string, branchName: string, commitId: string) {
32-
const projectState = uiState.project(projectId);
3331
const laneState = uiState.lane(stackId);
3432
laneState.selection.set({
3533
branchName,
3634
commitId,
3735
previewOpen: true
3836
});
39-
projectState.stackId.set(stackId);
4037
}
4138
4239
function selectBranch(stackId: string, branchName: string) {
43-
const projectState = uiState.project(projectId);
4440
const laneState = uiState.lane(stackId);
4541
laneState.selection.set({
4642
branchName,
4743
previewOpen: true
4844
});
49-
projectState.stackId.set(stackId);
5045
}
5146
</script>
5247

apps/desktop/src/components/FeedStreamMessage.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
<p class="vibing">Vibing</p>
9595
<div class="stream-message__tool-calls">
9696
{#each toolCalls as toolCall, index (index)}
97-
<FeedItemKind type="tool-call" {projectId} {toolCall} />
97+
<FeedItemKind type="tool-call" {toolCall} />
9898
{/each}
9999
</div>
100100
{/if}

apps/desktop/src/components/NewCommitView.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
branch: { name: finalBranchName, order: 0 }
7373
});
7474
finalStackId = stack.id;
75-
projectState.stackId.set(finalStackId);
7675
finalBranchName = stack.heads[0]?.name; // Updated to access the name property
7776
uiState.global.draftBranchName.set(undefined);
7877
}

apps/desktop/src/lib/stacks/createAiStack.svelte.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,12 @@ export function useCreateAiStack(projectId: Reactive<string>) {
1919
}
2020
});
2121

22-
// Because the ui state is updated asyncly, we need to let some time
23-
// pass. This is far from a good solution to this problem.
24-
await sleep(50);
25-
uiState.project(pid).stackId.set(stack.id);
2622
if (!stack.id) return;
27-
2823
const lane = uiState.lane(stack.id);
2924
lane.selection.set({ codegen: true, branchName: stack.heads[0]?.name, previewOpen: true });
3025

31-
// I strongly dislike this sleep
26+
// Because the ui state is updated asyncly, we need to let some time
27+
// pass. This is far from a good solution to this problem.
3228
await sleep(50);
3329
focusClaudeInput(stack.id);
3430
}

apps/desktop/src/lib/stacks/macros.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ export default class StackMacros {
4343
commitId: outcome.newCommit,
4444
previewOpen: true
4545
});
46-
47-
this.uiState.project(this.projectId).stackId.set(stack.id);
4846
}
4947
}
5048

@@ -124,6 +122,5 @@ export default class StackMacros {
124122
commitId: newCommitId,
125123
previewOpen
126124
});
127-
this.uiState.project(this.projectId).stackId.set(destinationStackId);
128125
}
129126
}

apps/desktop/src/lib/state/uiState.svelte.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export type ExclusiveAction =
7676

7777
export type ProjectUiState = {
7878
exclusiveAction: ExclusiveAction | undefined;
79-
stackId: string | undefined;
8079
branchesSelection: BranchesSelection;
8180
showActions: boolean;
8281
branchesToPoll: string[];
@@ -171,7 +170,6 @@ export class UiState {
171170
readonly project = this.buildScopedProps<ProjectUiState>(this.scopesCache.projects, {
172171
exclusiveAction: undefined,
173172
branchesSelection: {},
174-
stackId: undefined,
175173
showActions: false,
176174
branchesToPoll: [],
177175
selectedClaudeSession: undefined,
@@ -459,11 +457,6 @@ export function updateStaleProjectState(
459457
) {
460458
const projectState = uiState.project(projectId);
461459

462-
// Unselect the current stack if it is not in the list of stack IDs
463-
if (projectState.stackId.current && !stackIds.includes(projectState.stackId.current)) {
464-
projectState.stackId.set(undefined);
465-
}
466-
467460
if (projectState.exclusiveAction.current) {
468461
updateExclusiveActionState(
469462
projectState.exclusiveAction.current,

apps/desktop/src/lib/testing/mockUiState.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const MOCK_STACK_UI_STATE: StackState = {
2525
const MOCK_PROJECT_UI_STATE: ProjectUiState = {
2626
exclusiveAction: undefined,
2727
branchesSelection: { branchName: 'test' },
28-
stackId: undefined,
2928
showActions: false,
3029
branchesToPoll: [],
3130
selectedClaudeSession: undefined,

0 commit comments

Comments
 (0)