Skip to content

Fix DevTools picking in dialogs and flyouts, and make the toolbar pill usable - #1172

Merged
Zach Teutsch (zateutsch) merged 3 commits into
mainfrom
zateutsch-devtools-flyout-dialog-pick
Oct 23, 2026
Merged

Zach Teutsch (zateutsch) merged 3 commits into
mainfrom
zateutsch-devtools-flyout-dialog-pick

Conversation

@zateutsch

Copy link
Copy Markdown
Contributor

What and why

DevTools pick mode selected the wrong element around dialogs and flyouts, and some toolbar and inspector controls couldn't be used from the keyboard or UI Automation (UIA). Now:

  • Dialogs: clicking the dimmed area around an open ContentDialog selects the dialog. Before, it selected whatever was underneath (for example the page's ListView). This works for dialogs declared in XAML and dialogs built in code, and the highlight covers the dialog.
  • UI built in code: picking text or a text box inside a dialog built in code selects that TextBlock or TextBox. Before, it selected a ScrollViewer from the dialog's template.
  • Flyouts: Ctrl+Shift+P turns pick mode on while a flyout is open, and the flyout stays open. The same shortcut works in the inspector window.
  • Toolbar pill: the collapsed toolbar pill is now a button. UIA can invoke it to open the toolbar, and you can drag it.
  • Inspector: the splitter between the tree and properties panes moves with the Left/Right arrow keys (Shift for bigger steps). The tree filter shows "No matches" when nothing matches.

Fixes #1145

Before / after

Picking the dimmed area of an open dialog in a test app (Internal.pick over the DevTools pipe, observed output):

Before

{"nodeType":"Microsoft.UI.Xaml.Controls.ListView","name":"ItemsList", ...}

After

{"nodeType":"Microsoft.UI.Xaml.Controls.ContentDialog","name":"XamlDialog","bounds":{"x":0,"y":0,"w":1284,"h":961}}

Picking the body text of a dialog built in code: before, a template ScrollViewer; after, the TextBlock.

Not tested / risks

  • Tested on arm64 only.
  • Dragging the pill, the splitter arrow keys, and the "No matches" text are covered by contract tests but weren't checked by hand.
  • In a dialog built in code, picking the title or the OK button selects the dialog itself, because there's no source to tell the app's parts from the template's.

Checklist

  • Tests added or updated
  • Tested locally on Windows
Notes for reviewers
  • Ctrl+Shift+P uses a thread message hook, because a flyout's popup doesn't route key events to the app's root. The hook only acts for app windows, so the inspector (same thread) handles the shortcut itself.
  • A dialog declared in XAML stays in the page at zero size and moves its template into a popup, so the dialog is found by walking up from that popup, and its highlight uses the popup's size.
  • The pill's Button marks pointer presses handled, so the drag handler is added with handledEventsToo.

…l usable

- Clicking a ContentDialog's dimmed area selects the dialog, not what is behind it
- Picks inside a dialog built in code select the app's element, not template parts
- Ctrl+Shift+P toggles pick mode while a flyout is open, and in the inspector
- The toolbar pill is a Button: UI Automation can invoke it and it can be dragged
- The inspector splitter resizes with the arrow keys
- The tree filter shows a message when nothing matches

Fixes #1145

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 973a972d-0915-462e-9320-550db9eff063
…peater

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 973a972d-0915-462e-9320-550db9eff063
Copilot AI balanced review requested due to automatic review settings October 23, 2026 03:42
@zateutsch Zach Teutsch (zateutsch) added agent-preparing Agent is addressing feedback or completing required validation and CI docs-not-needed labels Oct 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The splitter subscription can crash the inspected app, and nested code-built ScrollViewer content can resolve to the wrong pick target.

2 open issues
What changed in this PR

This PR improves DevTools picking in dialogs and flyouts and makes the toolbar and inspector more accessible, addressing #1145.

Changes:

  • Adjusts dialog hit testing, highlighting, and pick targets for UI built in code.
  • Adds Ctrl+Shift+P handling for app popups and the inspector.
  • Makes the collapsed toolbar pill invokable and draggable, adds keyboard resizing to the inspector splitter, and displays an empty-filter message.
File Description
src/​winapp-devtools/​test/​toolbar-tests.cpp Adds source-contract checks for the new interactions.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​xaml/​toolbar.xaml Converts the collapsed pill to a button.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​xaml-window/​window-shell.xaml Adds empty-filter text and keyboard splitter metadata.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​DevToolsWindow.TreeView.inc Shares pick-toggle logic and updates empty-filter text.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​DevToolsWindow.State.inc Stores references to the empty-filter controls.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​DevToolsWindow.PropsPane.inc Handles the inspector shortcut and releases new references.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​DevToolsWindow.PaneSinks.inc Adds arrow-key splitter resizing.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​DevToolsWindow.Lifecycle.inc Connects empty-filter controls and splitter keyboard events.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​DevToolsTap.Route1Read.inc Revises pick-target selection for code-built UI.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​DevToolsOverlay.Toolbar.inc Adds popup-aware shortcuts and pill interactions.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​DevToolsOverlay.Pick.inc Adds an event-handler slot for pill invocation.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​DevToolsOverlay.Exports.inc Resolves dialog popup hits and highlight bounds.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​DevToolsOverlay.Build.inc Installs the pick-shortcut message hook.

Review effort: Balanced

Comment thread src/winapp-devtools/native/WinApp.DevTools.Native/DevToolsWindow.Lifecycle.inc Outdated
Comment thread src/winapp-devtools/native/WinApp.DevTools.Native/DevToolsTap.Route1Read.inc Outdated
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Build Metrics Report

Validation passed. All required build and validation jobs succeeded.

Binary Sizes

Artifact Baseline Current Delta
CLI (ARM64) 65.05 MB 65.10 MB 📈 +50.5 KB (+0.08%)
CLI (x64) 64.97 MB 65.01 MB 📈 +38.5 KB (+0.06%)
MSIX (ARM64) 26.93 MB 26.94 MB 📈 +15.5 KB (+0.06%)
MSIX (x64) 28.55 MB 28.57 MB 📈 +19.2 KB (+0.07%)
NPM Package 56.12 MB 56.14 MB 📈 +20.4 KB (+0.04%)
NuGet Package 56.27 MB 56.30 MB 📈 +27.7 KB (+0.05%)

.NET Test Results (TRX reports)

Other suites are reflected in the overall validation status above.

✅ 10669 passed, 43 skipped out of 10712 tests in 2293.1s (+5 tests, -291.2s vs. baseline)

Test Coverage

✅ 87.4% line coverage, 81.5% branch coverage · ✅ no change vs. baseline

CLI Startup Time

78ms median (x64, winapp --version) · ⚠️ +18ms vs. baseline

Try This Build

Installs the MSIX for your architecture, replacing any previously installed build. Needs the GitHub CLI — the command offers to install it and sign you in if it is missing.

& ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) 1172
Switching between builds often?

Put the tool on your PATH once:

& ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) -AddToPath

Then this build is just:

winapp-pr 1172

Run winapp-pr with no arguments to pick from a list of open PRs.


Updated 2026-10-23 05:56:00 UTC · commit 30f6f9e · workflow run

… in code-built UI

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 973a972d-0915-462e-9320-550db9eff063
@zateutsch Zach Teutsch (zateutsch) added ready-for-review Agent work and technical checks complete; awaiting review or re-review, not approval or merge and removed agent-preparing Agent is addressing feedback or completing required validation and CI labels Oct 23, 2026
@chiaramooney

Chiara Mooney (chiaramooney) commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Looks like this PR tackles some of #1155 issue too. I can close out my draft PR if we just want to fix this issue here instead.

Reviewing PR now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@zateutsch
Zach Teutsch (zateutsch) merged commit 35ed22b into main Oct 23, 2026
73 of 76 checks passed
@zateutsch
Zach Teutsch (zateutsch) deleted the zateutsch-devtools-flyout-dialog-pick branch October 23, 2026 20:36
@zateutsch Zach Teutsch (zateutsch) removed the ready-for-review Agent work and technical checks complete; awaiting review or re-review, not approval or merge label Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: DevTools can't pick elements inside flyouts or dialogs, and the toolbar pill is hard to use

3 participants