Skip to content

Fix named-color confirmation in DevTools set-property - #1167

Merged
Zach Teutsch (zateutsch) merged 2 commits into
mainfrom
chiaramooney-fix-issue-1157
Oct 24, 2026
Merged

Zach Teutsch (zateutsch) merged 2 commits into
mainfrom
chiaramooney-fix-issue-1157

Conversation

@chiaramooney

@chiaramooney Chiara Mooney (chiaramooney) commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Reapplying a named color now succeeds when the app reads back the same color in hexadecimal. Previously, Red and #FFFF0000 were treated as different values, causing a false write-unconfirmed error. Named-color writes that change the color also report matchesRequested: true when the readback is equivalent.

Fixes #1157

Before / after

With Background already set to #FFFF0000:

winapp devtools set-property AppTitleBar Background Red -a WinUIApp --json

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 Blue and Transparent, 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

  • Tests added or updated
  • Tested locally on Windows
  • Docs, samples, and plugins/winapp/skills/ updated if user-facing behavior changed (not needed: no syntax or workflow changes)
Notes for reviewers

Validation:

  • Build and Package passed for commit 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.
  • Built CLI: winapp.exe devtools set-property --help: passed.
  • npm run build from src\winapp-npm: failed locally during native DevTools compilation with C2026 and C1060; 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.

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
@chiaramooney Chiara Mooney (chiaramooney) added agent-preparing Agent is addressing feedback or completing required validation and CI docs-not-needed labels Oct 22, 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.

🔵 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

@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.10 MB 65.10 MB ✅ 0.0 KB (0.00%)
CLI (x64) 65.02 MB 65.02 MB 📉 -0.5 KB (-0.00%)
MSIX (ARM64) 26.95 MB 26.95 MB 📈 +0.0 KB (+0.00%)
MSIX (x64) 28.57 MB 28.57 MB 📈 +1.1 KB (+0.00%)
NPM Package 56.15 MB 56.15 MB 📈 +0.5 KB (+0.00%)
NuGet Package 56.30 MB 56.30 MB 📈 +0.7 KB (+0.00%)

.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 Time

77ms median (x64, winapp --version) · ✅ no change 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))) 1167
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 1167

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


Updated 2026-10-24 00:40:33 UTC · commit 1fbd4e9 · workflow run

@chiaramooney
Chiara Mooney (chiaramooney) marked this pull request as ready for review October 23, 2026 16:28
@chiaramooney Chiara Mooney (chiaramooney) 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
@zateutsch
Zach Teutsch (zateutsch) merged commit 6564e7a into main Oct 24, 2026
43 checks passed
@zateutsch
Zach Teutsch (zateutsch) deleted the chiaramooney-fix-issue-1157 branch October 24, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-not-needed ready-for-review Agent work and technical checks complete; awaiting review or re-review, not approval or merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: DevTools reports a failed write when a named color is already set

3 participants