Skip to content

Fix for CmdPal settings page offset#46568

Open
niels9001 wants to merge 2 commits intomainfrom
niels9001/settingspage-fix
Open

Fix for CmdPal settings page offset#46568
niels9001 wants to merge 2 commits intomainfrom
niels9001/settingspage-fix

Conversation

@niels9001
Copy link
Copy Markdown
Collaborator

@niels9001 niels9001 commented Mar 27, 2026

Summary of the Pull Request

This is a weird bug in WinUI where a child panel gets a weird offset when wrapped in a ScrollViewer and if it has a MaxWidth. The solution is to wrap it with another panel 🤷

Top: with fix
Bottom: 0.98.1
image

PR Checklist

  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@niels9001 niels9001 requested a review from Copilot March 27, 2026 13:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a WinUI layout bug affecting the CmdPal settings page where content becomes offset/cropped when a MaxWidth panel is hosted inside a ScrollViewer, improving resize behavior in Settings.

Changes:

  • Wrapes the CmdPal page content in an additional panel inside the ScrollViewer to avoid the WinUI offset issue.
  • Switches the page’s max width from a hard-coded value to the shared PageMaxWidth resource.

@@ -13,208 +13,210 @@
mc:Ignorable="d">
<Grid>
<ScrollViewer AutomationProperties.AutomationId="PageScrollViewer">
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ScrollViewer has Background="Red", which looks like a debugging aid and will ship a visibly incorrect background/theme for the CmdPal settings page. Please remove it (or replace with an appropriate {ThemeResource ...} if a background is actually intended).

Copilot uses AI. Check for mistakes.
@@ -13,208 +13,210 @@
mc:Ignorable="d">
<Grid>
<ScrollViewer AutomationProperties.AutomationId="PageScrollViewer">
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extra wrapper <Grid> inside the ScrollViewer appears to be a layout workaround for the WinUI offset/MaxWidth issue. To prevent future cleanups from removing it (and reintroducing the bug), add a short XAML comment explaining why this wrapper grid is required (ideally referencing the related issue).

Suggested change
<ScrollViewer AutomationProperties.AutomationId="PageScrollViewer">
<ScrollViewer AutomationProperties.AutomationId="PageScrollViewer">
<!-- Wrapper Grid required to work around WinUI ScrollViewer + MaxWidth layout offset issue. Do not remove. -->

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings: Command Palette settings page does not resize properly

2 participants