-
Notifications
You must be signed in to change notification settings - Fork 14
Fix profile button covered by native title bar buttons on Windows #2569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
dac90fd
Fix profile button covered by native title bar buttons on Windows
imnasnainaec b5dcca9
docs: document e2e-tests/isolated subdirectories
imnasnainaec 02987e8
fix: reserve title bar space locally instead of via a shared Toolbar …
imnasnainaec fde6e80
Merge branch 'main' into fix/title-bar-profile-button-overlap
imnasnainaec d40c1e1
fix: enclose the full reserved-space region in the toolbar's outline
imnasnainaec 41e5974
Merge branch 'main' into fix/title-bar-profile-button-overlap
imnasnainaec 2e28d53
Address PR #2569 review feedback on the title-bar reserved-space fix
imnasnainaec 968e59e
Keep the reserved-space wrapper height-neutral so it does not desync …
imnasnainaec 7ca24bb
Merge branch 'main' into fix/title-bar-profile-button-overlap
imnasnainaec f6590d5
Reserve title-bar space on the actual measured side, not a hardcoded one
imnasnainaec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
e2e-tests/tests/isolated/title-bar/title-bar-reserved-space.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import { test, expect } from '../../../fixtures/cdp.fixture'; | ||
| import { waitForAppReady } from '../../../fixtures/helpers'; | ||
|
|
||
| /** Window Controls Overlay API isn't in TS's DOM lib yet. */ | ||
| type NavigatorWithWindowControlsOverlay = Navigator & { | ||
| windowControlsOverlay?: { getTitlebarAreaRect(): DOMRect }; | ||
| }; | ||
|
|
||
| test.describe('Title bar reserved space', () => { | ||
| // titleBarOverlay (main.ts) — and navigator.windowControlsOverlay with it — is Windows-only. | ||
| // Skip must be called at describe/test scope; the equivalent call inside beforeAll is a silent | ||
| // Playwright no-op, so both tests would otherwise run (and fail) on macOS/Linux. | ||
| test.skip(process.platform !== 'win32', 'titleBarOverlay only applies on win32 (see main.ts)'); | ||
|
|
||
| test('profile button stays clear of the OS-reserved title bar area', async ({ mainPage }) => { | ||
| await waitForAppReady(mainPage); | ||
|
|
||
| const overlayRight = await mainPage.evaluate(() => { | ||
| // Widening navigator to the non-standard API above | ||
| // eslint-disable-next-line no-type-assertion/no-type-assertion | ||
| const { windowControlsOverlay } = navigator as NavigatorWithWindowControlsOverlay; | ||
| return windowControlsOverlay?.getTitlebarAreaRect().right; | ||
| }); | ||
| expect(overlayRight).toBeDefined(); | ||
|
|
||
| const trigger = mainPage.locator('[data-testid="user-profile-popover-trigger"]'); | ||
| await expect(trigger).toBeVisible(); | ||
| const triggerBox = await trigger.boundingBox(); | ||
| expect(triggerBox).not.toBeNull(); | ||
| if (!triggerBox || overlayRight === undefined) return; | ||
|
|
||
| // A plain visibility check would not have caught the original bug: the button was DOM-visible | ||
| // the whole time, just painted over by the native (non-DOM) OS buttons on top of it. | ||
| expect(triggerBox.x + triggerBox.width).toBeLessThanOrEqual(overlayRight); | ||
| }); | ||
|
|
||
| test('clicking the profile button opens its popover', async ({ mainPage }) => { | ||
| await waitForAppReady(mainPage); | ||
|
|
||
| const trigger = mainPage.locator('[data-testid="user-profile-popover-trigger"]'); | ||
| await trigger.click(); | ||
|
|
||
| await expect(mainPage.locator('[data-testid="user-profile-name"]')).toBeVisible(); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.