From ffbf35e0d2b6b3be276f9671c644f05fb9f0bf27 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sun, 6 Sep 2026 01:09:18 -0700 Subject: [PATCH] fix(source-control): stack Retry below the too-many-changes message (#19037) --- .../listing/too-many-changes-banner.tsx | 31 ++++++++++--------- .../source-control-large-file-count.spec.ts | 16 +++++++--- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/renderer/src/components/right-sidebar/source-control/listing/too-many-changes-banner.tsx b/src/renderer/src/components/right-sidebar/source-control/listing/too-many-changes-banner.tsx index 3da7b3e58f1..468f919ce6b 100644 --- a/src/renderer/src/components/right-sidebar/source-control/listing/too-many-changes-banner.tsx +++ b/src/renderer/src/components/right-sidebar/source-control/listing/too-many-changes-banner.tsx @@ -68,9 +68,12 @@ export function TooManyChangesBanner({ } return ( -
-
- +
+
+ {translate( 'auto.components.right.sidebar.SourceControl.tooManyChanges', @@ -78,18 +81,18 @@ export function TooManyChangesBanner({ { value0: limit.toLocaleString() } )} -
+
) } diff --git a/tests/e2e/source-control-large-file-count.spec.ts b/tests/e2e/source-control-large-file-count.spec.ts index 85f3710b308..c8c699b2bd8 100644 --- a/tests/e2e/source-control-large-file-count.spec.ts +++ b/tests/e2e/source-control-large-file-count.spec.ts @@ -31,6 +31,7 @@ import { removeLargeFileCountUntrackedTree } from './large-file-count-fixtures' import { DEFAULT_GIT_STATUS_LIMIT } from '../../src/shared/git-status-limit' +import { RIGHT_SIDEBAR_MIN_WIDTH } from '../../src/renderer/src/components/right-sidebar/right-sidebar-width' // Matches the large-diff freeze budget: a blocking stall past 1s is the // "UI becomes unresponsive" symptom reported in #8013. @@ -416,12 +417,17 @@ test.describe('Source Control large file count (#8013)', () => { rendererWorkingSetMb: { before: workingSetBeforeMb, after: workingSetAfterMb } }) - const tooManyChangesBanner = orcaPage.getByText('Too many changes detected.', { - exact: false - }) + const tooManyChangesBanner = orcaPage.getByTestId('too-many-changes-banner') await expect(tooManyChangesBanner).toBeVisible() if (process.env.ORCA_LARGE_FILE_SCREENSHOT_PATH) { - await orcaPage.screenshot({ path: process.env.ORCA_LARGE_FILE_SCREENSHOT_PATH }) + // Narrowest supported sidebar is where the banner layout is worst. + await orcaPage.evaluate((minWidth) => { + window.__store?.getState().setRightSidebarWidth(minWidth) + document.documentElement.classList.add('dark') + }, RIGHT_SIDEBAR_MIN_WIDTH) + await tooManyChangesBanner.screenshot({ + path: process.env.ORCA_LARGE_FILE_SCREENSHOT_PATH + }) } expect(measurement.didHitLimit).toBe(true) @@ -439,7 +445,7 @@ test.describe('Source Control large file count (#8013)', () => { ) expect(hugeState).not.toBeNull() - const retryButton = tooManyChangesBanner.locator('..').getByRole('button', { name: 'Retry' }) + const retryButton = tooManyChangesBanner.getByRole('button', { name: 'Retry' }) await expect(retryButton).toBeVisible() // Keep automatic refreshes from removing Retry before its real request starts. await installGitStatusRetryBarrier(electronApp, fixture.repoPath)