[Mac] Fix Titlebar content is not aligned to left on fullscreen - #30378
Conversation
|
Hey there @@devanathan-vaithiyanathan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
kubaflo
left a comment
There was a problem hiding this comment.
Could you please resolve conflicts?
f384a1b to
72c4023
Compare
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 30378Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 30378" |
There was a problem hiding this comment.
Pull request overview
Fixes MacCatalyst TitleBar content alignment when entering fullscreen by adjusting the TitleBar template’s left inset, and adds a UI test + HostApp repro page for issue #30248.
Changes:
- Update
TitleBar(MacCatalyst) to toggle the template root margin based on fullscreen state. - Add HostApp issue page
Issue30248that sets a customWindow.TitleBar. - Add a MacCatalyst UI test with a corresponding approved snapshot.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/Controls/src/Core/TitleBar/TitleBar.cs | Adds MacCatalyst fullscreen-aware margin adjustment for TitleBar content. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue30248.cs | New HostApp repro page that assigns a TitleBar and provides UI to screenshot. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30248.cs | New MacCatalyst UI test that enters fullscreen and verifies via screenshot. |
| src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/VerifyTitleBarContentinFullScreenmode.png | New baseline snapshot for the added UI test. |
@kubaflo , I have resolved the conflicts |
|
/review -b feature/refactor-copilot-yml |
|
/azp run maui-pr-uitests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
Tests Failure Analysis
Test Failure Review: Likely PR-caused - click to expandOverall verdict: Likely PR-caused
Recommended actionUpdate the Evidence detailsBuild: maui-pr-uitests #1475636 — PR scope: 4 changed files — VerifyTitleBarLTR causation: The failing test is in macOS WebView failures (14 tests): All stem from Appium/app unresponsiveness — Base branch comparison: All 5 most recent Android infrastructure failures: Both Android API 30 jobs (SearchBar,Shape,Slider and CollectionView) show Limitation: AzDO |
kubaflo
left a comment
There was a problem hiding this comment.
Looks like the test is failing
@kubaflo , Video reference: Screen.Recording.2026-06-23.at.7.54.20.PM.mov |
|
@devanathan-vaithiyanathan might be something with the test setup - could you modify the test so that it will pass on CI? |
@kubaflo , it seems the test is failing because of test case Issue30248. In that test, we enter full-screen mode, so the cursor remains positioned over the full-screen button. As a result, the pop-up appears in the next test case. To avoid this, I added an empty button and click it to move the cursor away from the full-screen button. |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue details in mac when the app enters in full screen mode, titlebar content is not aligned to the left. ### Description of Change <!-- Enter description of the fix in this section --> Added logic to adjust the TitleBar content margin based on full-screen state (Mac Catalyst 16+). When in full-screen, left margin is removed; otherwise, a margin of 80 is applied to align with traffic light spacing. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #30248 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [ ] iOS - [x] Mac | Before | After | |---------|--------| | **Mac**<br> <video src="https://github.com/user-attachments/assets/1224b070-4913-46ce-929d-bfd97f20ad47" width="600" height="300"> | **Mac**<br> <video src="https://github.com/user-attachments/assets/dd7de8c9-667a-486f-86c9-fcd9e450150b" width="600" height="300"> |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue details in mac when the app enters in full screen mode, titlebar content is not aligned to the left. ### Description of Change <!-- Enter description of the fix in this section --> Added logic to adjust the TitleBar content margin based on full-screen state (Mac Catalyst 16+). When in full-screen, left margin is removed; otherwise, a margin of 80 is applied to align with traffic light spacing. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #30248 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [ ] iOS - [x] Mac | Before | After | |---------|--------| | **Mac**<br> <video src="https://github.com/user-attachments/assets/1224b070-4913-46ce-929d-bfd97f20ad47" width="600" height="300"> | **Mac**<br> <video src="https://github.com/user-attachments/assets/dd7de8c9-667a-486f-86c9-fcd9e450150b" width="600" height="300"> |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue details in mac when the app enters in full screen mode, titlebar content is not aligned to the left. ### Description of Change <!-- Enter description of the fix in this section --> Added logic to adjust the TitleBar content margin based on full-screen state (Mac Catalyst 16+). When in full-screen, left margin is removed; otherwise, a margin of 80 is applied to align with traffic light spacing. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #30248 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [ ] iOS - [x] Mac | Before | After | |---------|--------| | **Mac**<br> <video src="https://github.com/user-attachments/assets/1224b070-4913-46ce-929d-bfd97f20ad47" width="600" height="300"> | **Mac**<br> <video src="https://github.com/user-attachments/assets/dd7de8c9-667a-486f-86c9-fcd9e450150b" width="600" height="300"> |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue details in mac when the app enters in full screen mode, titlebar content is not aligned to the left. ### Description of Change <!-- Enter description of the fix in this section --> Added logic to adjust the TitleBar content margin based on full-screen state (Mac Catalyst 16+). When in full-screen, left margin is removed; otherwise, a margin of 80 is applied to align with traffic light spacing. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #30248 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [ ] iOS - [x] Mac | Before | After | |---------|--------| | **Mac**<br> <video src="https://github.com/user-attachments/assets/1224b070-4913-46ce-929d-bfd97f20ad47" width="600" height="300"> | **Mac**<br> <video src="https://github.com/user-attachments/assets/dd7de8c9-667a-486f-86c9-fcd9e450150b" width="600" height="300"> |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue details in mac when the app enters in full screen mode, titlebar content is not aligned to the left. ### Description of Change <!-- Enter description of the fix in this section --> Added logic to adjust the TitleBar content margin based on full-screen state (Mac Catalyst 16+). When in full-screen, left margin is removed; otherwise, a margin of 80 is applied to align with traffic light spacing. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #30248 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [ ] iOS - [x] Mac | Before | After | |---------|--------| | **Mac**<br> <video src="https://github.com/user-attachments/assets/1224b070-4913-46ce-929d-bfd97f20ad47" width="600" height="300"> | **Mac**<br> <video src="https://github.com/user-attachments/assets/dd7de8c9-667a-486f-86c9-fcd9e450150b" width="600" height="300"> |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue details in mac when the app enters in full screen mode, titlebar content is not aligned to the left. ### Description of Change <!-- Enter description of the fix in this section --> Added logic to adjust the TitleBar content margin based on full-screen state (Mac Catalyst 16+). When in full-screen, left margin is removed; otherwise, a margin of 80 is applied to align with traffic light spacing. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #30248 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [ ] iOS - [x] Mac | Before | After | |---------|--------| | **Mac**<br> <video src="https://github.com/user-attachments/assets/1224b070-4913-46ce-929d-bfd97f20ad47" width="600" height="300"> | **Mac**<br> <video src="https://github.com/user-attachments/assets/dd7de8c9-667a-486f-86c9-fcd9e450150b" width="600" height="300"> |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue details in mac when the app enters in full screen mode, titlebar content is not aligned to the left. ### Description of Change <!-- Enter description of the fix in this section --> Added logic to adjust the TitleBar content margin based on full-screen state (Mac Catalyst 16+). When in full-screen, left margin is removed; otherwise, a margin of 80 is applied to align with traffic light spacing. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #30248 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [ ] iOS - [x] Mac | Before | After | |---------|--------| | **Mac**<br> <video src="https://github.com/user-attachments/assets/1224b070-4913-46ce-929d-bfd97f20ad47" width="600" height="300"> | **Mac**<br> <video src="https://github.com/user-attachments/assets/dd7de8c9-667a-486f-86c9-fcd9e450150b" width="600" height="300"> |

Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issue details
in mac when the app enters in full screen mode, titlebar content is not aligned to the left.
Description of Change
Added logic to adjust the TitleBar content margin based on full-screen state (Mac Catalyst 16+). When in full-screen, left margin is removed; otherwise, a margin of 80 is applied to align with traffic light spacing.
Issues Fixed
Fixes #30248
Tested the behavior in the following platforms.
Before.mov
After.mov