Repository navigation
Fix named-color confirmation in DevTools set-property - #1167
Conversation
Recognize equivalent named and hexadecimal brush colors when confirming live property writes. Cover changed and unchanged values in text and JSON output. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1d403af5-9512-4300-8c98-de174a36d4fa
There was a problem hiding this comment.
🔵 Needs a closer look
The reported native DevTools build failure remains unresolved in the supplied validation evidence, so build readiness needs human confirmation.
No open issues 🎉
What changed in this PR
Fixes named-color confirmation in winapp devtools set-property for #1157. Requests such as Red now match equivalent hexadecimal readbacks, avoiding false write-unconfirmed errors.
Changes:
- Normalizes known, non-system color names for brush comparisons while preserving hexadecimal handling.
- Adds regression tests for unchanged and changed colors, invalid names, type-aware comparisons, and text and JSON output.
| File | Description |
|---|---|
| src/winapp-CLI/WinApp.Cli/Commands/DevToolsSetPropertyCommand.cs | Recognizes equivalent named and hexadecimal colors during write confirmation. |
| src/winapp-CLI/WinApp.Cli.Tests/DevToolsJsonParityTests.cs | Tests named-color confirmation and output fields in both output modes. |
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. ✅ 10683 passed, 43 skipped out of 10726 tests in 1810.3s (+14 tests, +34.0s vs. baseline) Test Coverage✅ 87.4% line coverage, 81.5% branch coverage · ✅ no change vs. baseline CLI Startup Time77ms 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))) 1167Switching 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 1167Run Updated 2026-10-24 00:40:33 UTC · commit |
What and why
Reapplying a named color now succeeds when the app reads back the same color in hexadecimal. Previously,
Redand#FFFF0000were treated as different values, causing a falsewrite-unconfirmederror. Named-color writes that change the color also reportmatchesRequested: truewhen the readback is equivalent.Fixes #1157
Before / after
With
Backgroundalready set to#FFFF0000:Before: The issue reports exit 1 and
write-unconfirmed, although the background is already red. The regression test reproduced the failed confirmation before the fix.After: The protocol regression tests confirm exit 0 with these fields:
{ "ok": true, "requested": "Red", "before": "#FFFF0000", "after": "#FFFF0000", "changed": false, "matchesRequested": true }This is a selected-field excerpt verified by tests, not a live-app capture. The tests also cover
BlueandTransparent, changed colors, and both text and JSON output.Not tested / risks
A live WinUI-app write and screenshot were not captured. Command tests use a fake DevTools agent over a real named pipe.
Checklist
plugins/winapp/skills/updated if user-facing behavior changed (not needed: no syntax or workflow changes)Notes for reviewers
Validation:
5494df6, including both CLI architectures, package creation, native DevTools validation, UI tests, and sample tests. The reported .NET results are 10,683 passed and 43 skipped. This successful CI build covers the native DevTools build concern raised in review.dotnet run --project src\winapp-CLI\WinApp.Cli.Tests\WinApp.Cli.Tests.csproj --verbosity quiet -- --filter "FullyQualifiedName~DevToolsJsonParityTests" --no-ansi: passed locally, 76 tests.winapp.exe devtools set-property --help: passed.npm run buildfromsrc\winapp-npm: failed locally during native DevTools compilation withC2026andC1060; the same release pipeline passed in CI as linked above. The remaining npm copy, command generation, formatting, lint, and TypeScript compilation steps passed locally when run separately against the published CLI binaries.git diff --check: passed.