Skip to content

Show brush colors in devtools search --fields - #1376

Open
Zach Teutsch (zateutsch) wants to merge 1 commit into
mainfrom
zateutsch-devtools-search-brush-fields
Open

Zach Teutsch (zateutsch) wants to merge 1 commit into
mainfrom
zateutsch-devtools-search-brush-fields

Conversation

@zateutsch

Copy link
Copy Markdown
Contributor

What and why

winapp devtools search --fields Background printed <Microsoft.UI.Xaml.Media.SolidColorBrush> instead of the color, even though get-property showed it (#B3FFFFFF). Filtering with --with Background==#B3FFFFFF also never matched.

The engine already read a solid brush as #AARRGGBB, but search dropped that value. Now search returns the color for solid brushes, and --with can match it with == or !=. Color formats like #FFF or #b3ffffff are normalized before comparing. Gradient brushes are unchanged and still show their type name.

Fixes #1364

Before / after

Not captured from a live app (see below). Expected output, based on the native runtime test for the JSON value:

Before

winapp devtools search --of-type Border --fields Background -a <pid>
Border  Background=<Microsoft.UI.Xaml.Media.SolidColorBrush>

After

winapp devtools search --of-type Border --fields Background -a <pid>
Border  Background="#B3FFFFFF"

JSON output now has "value":"#B3FFFFFF" instead of "value":null,"valueState":"object".

Not tested / risks

  • Not checked against a running app. Coverage is native unit and runtime tests: src\winapp-devtools\build-devtools.ps1 -Arch arm64 -Configuration Debug passed (dispatcher 703/703, window 14353/14353, overlay 0 failures).
  • Text output quotes the color, the same way other string fields are shown. The issue showed it without quotes.

Checklist

  • Tests added or updated
  • Tested locally on Windows

SolidColorBrush values were read as #AARRGGBB but dropped from the search
JSON, so --fields printed <SolidColorBrush> and --with Background==#... never
matched. Emit solid brush colors as strings and compare them with == / !=.

Fixes #1364

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 23:15
@zateutsch Zach Teutsch (zateutsch) added the agent-preparing Agent is addressing feedback or completing required validation and CI label Nov 19, 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.

🟢 Approval recommended

The brush-color query changes have no active review issues requiring resolution.

No open issues 🎉

What changed in this PR

Makes DevTools search show solid brush colors instead of type names, addressing #1364. The shared query formatter also makes colors visible in query-targeted writes’ before and after values.

Changes:

  • Returns solid brush colors as JSON strings, displayed as quoted colors in text output.
  • Supports color comparisons with == and !=, normalizing shorthand and lowercase hexadecimal input while leaving gradient brushes unchanged.
  • Adds native tests for brush comparisons and color serialization.
File Description
src/​winapp-devtools/​test/​query-tests.cpp Tests color matching, normalization, and unsupported comparisons.
src/​winapp-devtools/​test/​query-runtime-tests.inc Verifies solid brush colors appear as JSON field values.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​DevToolsTap.Query.inc Preserves readable brush colors in query output.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​DevToolsQuery.h Recognizes readable brush colors and compares normalized color values.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Build Metrics Report

Validation passed. All required build and validation jobs succeeded.

Binary Sizes

No baseline found. Showing absolute sizes only.

Artifact Size
CLI (ARM64) 65.94 MB
CLI (x64) 65.77 MB
MSIX (ARM64) 27.20 MB
MSIX (x64) 28.85 MB
NPM Package 56.67 MB
NuGet Package 56.83 MB

.NET Test Results (TRX reports)

Other suites are reflected in the overall validation status above.

✅ 11112 passed, 44 skipped out of 11156 tests in 1991.2s

Test Coverage

✅ 87.4% line coverage, 81.7% branch coverage

CLI Startup Time

69ms median (x64, winapp --version)

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))) 1376
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 1376

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


Updated 2026-11-20 00:05:49 UTC · commit 7e3f69c · workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-preparing Agent is addressing feedback or completing required validation and CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: devtools search --fields shows brushes as <SolidColorBrush> instead of a color

2 participants