|
6 | 6 | import ReduxResult from '$components/ReduxResult.svelte';
|
7 | 7 | import SelectionView from '$components/SelectionView.svelte';
|
8 | 8 | import UnassignedView from '$components/UnassignedView.svelte';
|
| 9 | + import BaseBranchService from '$lib/baseBranch/baseBranchService.svelte'; |
9 | 10 | import { SettingsService } from '$lib/config/appSettingsV2';
|
10 | 11 | import {
|
11 | 12 | DefinedFocusable,
|
|
28 | 29 |
|
29 | 30 | const { projectId }: Props = $props();
|
30 | 31 |
|
31 |
| - const [stackService, focusManager, idSelection, uiState, settingsService] = inject( |
32 |
| - StackService, |
33 |
| - FocusManager, |
34 |
| - IdSelection, |
35 |
| - UiState, |
36 |
| - SettingsService |
37 |
| - ); |
| 32 | + const [stackService, focusManager, idSelection, uiState, settingsService, baseBranchService] = |
| 33 | + inject(StackService, FocusManager, IdSelection, UiState, SettingsService, BaseBranchService); |
38 | 34 | const worktreeSelection = $derived(idSelection.getById({ type: 'worktree' }));
|
39 | 35 | const stacksResult = $derived(stackService.stacks(projectId));
|
40 | 36 | const projectState = $derived(uiState.project(projectId));
|
41 | 37 | const settingsStore = $derived(settingsService.appSettings);
|
42 | 38 | const canUseActions = $derived($settingsStore?.featureFlags.actions ?? false);
|
43 | 39 | const showingActions = $derived(projectState.showActions.current && canUseActions);
|
44 | 40 | const exclusiveAction = $derived(projectState.exclusiveAction.current);
|
| 41 | + const baseBranchResult = $derived(baseBranchService.baseBranch(projectId)); |
| 42 | + const baseSha = $derived(baseBranchResult.current.data?.baseSha); |
45 | 43 |
|
46 | 44 | const snapshotFocusables = writable<string[]>([]);
|
47 | 45 | setContext('snapshot-focusables', snapshotFocusables);
|
|
115 | 113 | return;
|
116 | 114 | }
|
117 | 115 |
|
| 116 | + // When we're committing to the bottom of the stack we set the |
| 117 | + // commit id to equal the workspace base. |
118 | 118 | const hasCommit = branch.current.data.commits.some((c) => c.id === action.parentCommitId);
|
119 |
| - if (!hasCommit) { |
| 119 | + if (!hasCommit && action.parentCommitId !== baseSha) { |
120 | 120 | uiState.project(projectId).exclusiveAction.set(undefined);
|
121 | 121 | }
|
122 | 122 | });
|
|
0 commit comments