Use outline variant for merge abort buttons (#5558)
Restore the quieter abort-merge styling that was accidentally reverted during the host-context merge repair in #5071. Abort merge and abort rebase now match the Review conflicts outline button treatment.
This commit is contained in:
parent
2717c3567d
commit
1041eadeb2
|
|
@ -497,7 +497,7 @@ describe('ConflictSummaryCard', () => {
|
|||
expect(cherryPickMarkup).not.toContain('Abort rebase')
|
||||
})
|
||||
|
||||
it('renders abort actions with operation-specific button treatment', () => {
|
||||
it('renders abort actions with the quiet outline review-conflicts button treatment', () => {
|
||||
const mergeMarkup = renderToStaticMarkup(
|
||||
<ConflictSummaryCard
|
||||
conflictOperation="merge"
|
||||
|
|
@ -520,7 +520,7 @@ describe('ConflictSummaryCard', () => {
|
|||
)
|
||||
|
||||
expect(buttonContaining(mergeMarkup, 'Review conflicts')).toContain('data-variant="outline"')
|
||||
expect(buttonContaining(mergeMarkup, 'Abort merge')).toContain('data-variant="destructive"')
|
||||
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"')
|
||||
})
|
||||
|
|
@ -560,7 +560,7 @@ describe('OperationBanner', () => {
|
|||
expect(cherryPickMarkup).not.toContain('Abort rebase')
|
||||
})
|
||||
|
||||
it('renders abort actions with operation-specific button treatment', () => {
|
||||
it('renders abort actions with the quiet outline button treatment', () => {
|
||||
const mergeMarkup = renderToStaticMarkup(
|
||||
<OperationBanner conflictOperation="merge" onAbortOperation={vi.fn()} />
|
||||
)
|
||||
|
|
@ -568,7 +568,7 @@ describe('OperationBanner', () => {
|
|||
<OperationBanner conflictOperation="rebase" onAbortOperation={vi.fn()} />
|
||||
)
|
||||
|
||||
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"')
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -6856,14 +6856,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,
|
||||
|
|
@ -6939,7 +6931,9 @@ export function ConflictSummaryCard({
|
|||
{(conflictOperation === 'merge' || conflictOperation === 'rebase') && onAbortOperation ? (
|
||||
<Button
|
||||
type="button"
|
||||
variant={conflictAbortButtonVariant(conflictOperation)}
|
||||
// Why: abort is the escape hatch for this state, so match the quiet
|
||||
// outline conflict-review action instead of reading as destructive.
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="mt-1.5 h-7 w-full text-xs"
|
||||
disabled={isResolvingWithAI || isAbortingOperation}
|
||||
|
|
@ -6990,7 +6984,9 @@ export function OperationBanner({
|
|||
{(conflictOperation === 'merge' || conflictOperation === 'rebase') && onAbortOperation ? (
|
||||
<Button
|
||||
type="button"
|
||||
variant={conflictAbortButtonVariant(conflictOperation)}
|
||||
// Why: abort is the escape hatch for this state, so match the quiet
|
||||
// outline conflict-review action instead of reading as destructive.
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="mt-2 h-7 w-full text-xs"
|
||||
disabled={isAbortingOperation}
|
||||
|
|
|
|||
Loading…
Reference in New Issue