From 8af29892da49e10b836015a3695ca3093b02b402 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Thu, 11 Jun 2026 19:43:47 -0700 Subject: [PATCH] Use outline variant for merge abort buttons Change the abort action button variant for merge operations from destructive to outline, aligning it with rebase abort. This uses a quieter, non-destructive treatment for aborting operations. --- .../right-sidebar/CommitArea.test.tsx | 24 ++++++++++++++----- .../right-sidebar/SourceControl.tsx | 16 +++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/renderer/src/components/right-sidebar/CommitArea.test.tsx b/src/renderer/src/components/right-sidebar/CommitArea.test.tsx index 7d377e69391..22f4e73bc8a 100644 --- a/src/renderer/src/components/right-sidebar/CommitArea.test.tsx +++ b/src/renderer/src/components/right-sidebar/CommitArea.test.tsx @@ -384,8 +384,18 @@ describe('ConflictSummaryCard', () => { expect(cherryPickMarkup).not.toContain('Abort rebase') }) - it('renders rebase abort with the quiet outline review-conflicts button treatment', () => { - const markup = renderToStaticMarkup( + it('renders abort actions with the quiet outline review-conflicts button treatment', () => { + const mergeMarkup = renderToStaticMarkup( + + ) + const rebaseMarkup = renderToStaticMarkup( { /> ) - expect(buttonContaining(markup, 'Review conflicts')).toContain('data-variant="outline"') - expect(buttonContaining(markup, 'Abort rebase')).toContain('data-variant="outline"') + expect(buttonContaining(mergeMarkup, 'Review conflicts')).toContain('data-variant="outline"') + expect(buttonContaining(mergeMarkup, 'Abort merge')).toContain('data-variant="outline"') + expect(buttonContaining(rebaseMarkup, 'Review conflicts')).toContain('data-variant="outline"') + expect(buttonContaining(rebaseMarkup, 'Abort rebase')).toContain('data-variant="outline"') }) it('renders the Sparkles icon on the idle Resolve with AI button', () => { @@ -435,7 +447,7 @@ describe('OperationBanner', () => { expect(cherryPickMarkup).not.toContain('Abort rebase') }) - it('keeps rebase abort non-destructive while preserving merge abort styling', () => { + it('renders abort actions with the quiet outline button treatment', () => { const mergeMarkup = renderToStaticMarkup( ) @@ -443,7 +455,7 @@ describe('OperationBanner', () => { ) - expect(buttonContaining(mergeMarkup, 'Abort merge')).toContain('data-variant="destructive"') + expect(buttonContaining(mergeMarkup, 'Abort merge')).toContain('data-variant="outline"') expect(buttonContaining(rebaseMarkup, 'Abort rebase')).toContain('data-variant="outline"') }) }) diff --git a/src/renderer/src/components/right-sidebar/SourceControl.tsx b/src/renderer/src/components/right-sidebar/SourceControl.tsx index 5f86a1b45a3..83be74d11ca 100644 --- a/src/renderer/src/components/right-sidebar/SourceControl.tsx +++ b/src/renderer/src/components/right-sidebar/SourceControl.tsx @@ -5687,14 +5687,6 @@ function DiffCommentsInlineList({ ) } -function conflictAbortButtonVariant( - conflictOperation: GitConflictOperation -): 'outline' | 'destructive' { - // Why: aborting a rebase is the escape hatch for this state, so it should - // match the quiet outline conflict-review action instead of reading as red. - return conflictOperation === 'rebase' ? 'outline' : 'destructive' -} - export function ConflictSummaryCard({ conflictOperation, unresolvedCount, @@ -5770,7 +5762,9 @@ export function ConflictSummaryCard({ {(conflictOperation === 'merge' || conflictOperation === 'rebase') && onAbortOperation ? (