diff --git a/gitbutler-ui/src/lib/vbranches/types.ts b/gitbutler-ui/src/lib/vbranches/types.ts index 0226559ea..e8daa8a75 100644 --- a/gitbutler-ui/src/lib/vbranches/types.ts +++ b/gitbutler-ui/src/lib/vbranches/types.ts @@ -70,6 +70,8 @@ export class Branch { updatedAt!: Date; } +export type CommitStatus = 'local' | 'remote' | 'integrated'; + export class Commit { id!: string; author!: Author; @@ -87,6 +89,16 @@ export class Commit { return !this.isRemote && !this.isIntegrated; } + get status() { + if (!this.isIntegrated && !this.isRemote) { + return 'local'; + } else if (!this.isIntegrated && this.isRemote) { + return 'remote'; + } else if (this.isIntegrated) { + return 'integrated'; + } + } + isParentOf(possibleChild: Commit) { return possibleChild.parentIds.includes(this.id); } diff --git a/gitbutler-ui/src/routes/[projectId]/components/BranchLanePopupMenu.svelte b/gitbutler-ui/src/routes/[projectId]/components/BranchLanePopupMenu.svelte index ac86a554f..0700e6ae2 100644 --- a/gitbutler-ui/src/routes/[projectId]/components/BranchLanePopupMenu.svelte +++ b/gitbutler-ui/src/routes/[projectId]/components/BranchLanePopupMenu.svelte @@ -24,6 +24,10 @@ }>(); const aiGenEnabled = projectAiGenEnabled(projectId); + + $: commits = branch.commits; + $: hasIntegratedCommits = + commits.length > 0 ? commits.some((c) => c.status == 'integrated') : false; {#if visible} @@ -54,6 +58,7 @@ { newRemoteName = branch.upstreamName || ''; visible = false; diff --git a/gitbutler-ui/src/routes/[projectId]/components/CommitList.svelte b/gitbutler-ui/src/routes/[projectId]/components/CommitList.svelte index 9604350df..a233d13a8 100644 --- a/gitbutler-ui/src/routes/[projectId]/components/CommitList.svelte +++ b/gitbutler-ui/src/routes/[projectId]/components/CommitList.svelte @@ -1,10 +1,9 @@ diff --git a/gitbutler-ui/src/routes/[projectId]/components/CommitListFooter.svelte b/gitbutler-ui/src/routes/[projectId]/components/CommitListFooter.svelte index 53eb94e95..c0ac33ecc 100644 --- a/gitbutler-ui/src/routes/[projectId]/components/CommitListFooter.svelte +++ b/gitbutler-ui/src/routes/[projectId]/components/CommitListFooter.svelte @@ -1,15 +1,14 @@