Skip to content

Commit f7bcb0c

Browse files
committed
Show commit goes here for first commit if none selected
1 parent 244683f commit f7bcb0c

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
first: boolean;
3333
last: boolean;
3434
lastCommit: boolean;
35-
selected: boolean;
35+
selectedCommitId: string | undefined;
3636
}
3737
]
3838
>;
@@ -81,14 +81,13 @@
8181
{@const first = i === 0}
8282
{@const last = i === localAndRemoteCommits.length - 1}
8383
{@const commitKey = { stackId, branchName, commitId: commit.id, upstream: false }}
84-
{@const selected = selectedCommitId === commit.id}
8584
{@render localAndRemoteTemplate({
8685
commit,
8786
commitKey,
8887
first,
8988
last,
9089
lastCommit: last,
91-
selected
90+
selectedCommitId
9291
})}
9392
{/each}
9493
{/if}

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,19 @@
127127
/>
128128
{/if}
129129
{/snippet}
130-
{#snippet localAndRemoteTemplate({ commit, first, last, lastCommit, selected })}
130+
{#snippet localAndRemoteTemplate({
131+
commit,
132+
first,
133+
last,
134+
lastCommit,
135+
selectedCommitId
136+
})}
131137
{@const commitId = commit.id}
138+
{@const selected = commit.id === selectedCommitId}
132139
{#if isCommitting}
133140
<!-- Only commits to the base can be `last`, see next `CommitGoesHere`. -->
134141
<CommitGoesHere
135-
{selected}
142+
selected={selected || (first && !selectedCommitId)}
136143
{first}
137144
last={false}
138145
onclick={() => uiState.stack(stackId).selection.set({ branchName, commitId })}

0 commit comments

Comments
 (0)