Skip to content

Commit e6aae92

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

File tree

10 files changed

+7
-42
lines changed

10 files changed

+7
-42
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 & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,10 @@
8484
8585
async function addNew() {
8686
if (createRefType === 'stack') {
87-
const stack = await createNewStack({
87+
await createNewStack({
8888
projectId,
8989
branch: { name: slugifiedRefName }
9090
});
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);
9591
createRefModal?.close();
9692
} else {
9793
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/routes/[projectId]/workspace/+page.svelte

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,26 @@
44
import WorkspaceView from '$components/WorkspaceView.svelte';
55
import { MODE_SERVICE } from '$lib/mode/modeService';
66
import { STACK_SERVICE } from '$lib/stacks/stackService.svelte';
7-
import { UI_STATE } from '$lib/state/uiState.svelte';
87
import { inject } from '@gitbutler/core/context';
98
109
const modeService = inject(MODE_SERVICE);
1110
1211
const projectId = $derived(page.params.projectId!);
1312
const mode = $derived(modeService.mode({ projectId }));
14-
const uiState = inject(UI_STATE);
1513
const stackService = inject(STACK_SERVICE);
16-
const projectState = $derived(uiState.project(projectId));
17-
const stackId = $derived(projectState.stackId.current);
1814
1915
// Check for stackId in URL query parameters
2016
const urlStackId = $derived(page.url.searchParams.get('stackId'));
2117
let scrollToStackId = $state<string | undefined>(undefined);
2218
23-
const firstStackQuery = $derived(stackService.stackAt(projectId, 0));
24-
const firstStack = $derived(firstStackQuery.response);
25-
2619
// Read all local commits in the workspace for the given project
2720
$effect(() => {
2821
stackService.allLocalCommits(projectId);
2922
});
3023
3124
$effect(() => {
3225
if (urlStackId) {
33-
projectState.stackId.set(urlStackId);
3426
scrollToStackId = urlStackId;
35-
} else if (stackId === undefined && firstStack) {
36-
projectState.stackId.set(firstStack.id);
3727
}
3828
});
3929

0 commit comments

Comments
 (0)