Repository navigation
Show brush colors in devtools search --fields - #1376
Zach Teutsch (zateutsch) wants to merge 1 commit into
Conversation
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>
There was a problem hiding this comment.
🟢 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
Build Metrics ReportValidation passed. All required build and validation jobs succeeded. Binary Sizes
.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 Time69ms median (x64, Try This BuildInstalls 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))) 1376Switching between builds often?Put the tool on your PATH once: & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) -AddToPathThen this build is just: winapp-pr 1376Run Updated 2026-11-20 00:05:49 UTC · commit |
What and why
winapp devtools search --fields Backgroundprinted<Microsoft.UI.Xaml.Media.SolidColorBrush>instead of the color, even thoughget-propertyshowed it (#B3FFFFFF). Filtering with--with Background==#B3FFFFFFalso 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--withcan match it with==or!=. Color formats like#FFFor#b3ffffffare 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
After
JSON output now has
"value":"#B3FFFFFF"instead of"value":null,"valueState":"object".Not tested / risks
src\winapp-devtools\build-devtools.ps1 -Arch arm64 -Configuration Debugpassed (dispatcher 703/703, window 14353/14353, overlay 0 failures).Checklist