You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Resolve ThemeRef through WinUI instead of reading theme dictionaries - #1633
ThemeRef.Resolve read WinUI's theme dictionaries from code. WinUI creates a theme dictionary entry the first time it is read and resolves it for the app's theme, then keeps it for every element. So in a Light app, resolving the Dark brush returned the Light color, and every Dark element using that key showed the Light color from then on. In a sweep of 40 common keys, 32 were affected, in both directions. Setting RequestedTheme on the window root doesn't help, only the app theme counts.
The same lookup backed .Resources(...) overrides with theme tokens under an element with the other RequestedTheme, and validation styling in such a subtree.
Reactor now asks WinUI to resolve {ThemeResource key} on an off-tree Border with the requested RequestedTheme and reads the value back (ThemeResourceProbe). This gets the same brush an element in that theme gets, without touching WinUI's shared entries. Only when WinUI can't resolve the key for that theme does it fall back to the old dictionary walk, for example for an app key defined only in Dark, or only in Default next to Light and Dark. The walk skips XamlControlsResources, including when it is Application.Resources itself as in every Reactor app, so it can never read WinUI's own entries from code. Missing and non-brush keys still return null, and the (key, theme) brush cache is unchanged.
The probe parses a small Style with XamlReader, cached per key and UI thread, the same mechanism ApplyThemeBindings already uses. Stable WinUI has no code API for a {ThemeResource} reference. FrameworkElement.SetThemeResourceBinding (microsoft/microsoft-ui-xaml#11229) is that API, and I checked it on 2.6.6-experimental. It returns the right brush for all 40 keys in both app themes and doesn't change the shared entries, so it can replace the Style once it's stable. #1634 tracks that move.
Related: #1531 (spec 065 §7 describes this bug, and it rewrites the same ResolveForThemeUncached for contrast themes, #1506), #1618 (moves ApplyThemeBindings to SetThemeResourceBinding), #1634 (follow-up move of this probe to the same API).
Test plan
Fresh-process regression test. The bug only shows when a key is first read in a clean process, so the test host has a --themeref-probe <scenario> mode, driven by ThemeRefProbeProcessTests in tests/Reactor.SelfTests. It does one first read for the theme opposite to the app's, then renders Theme.Ref borders in both themes.
Scenarios cover ThemeRef.Resolve(key, isDark), Resolve(key, fe) (the validation path), .Resources overrides, a missing key, and the dictionary-walk fallback run on its own for real keys.
A positive control does no read. A negative control does the old dictionary read and checks that it still makes the other-theme border show the app theme's brush.
The three read scenarios failed on the unfixed code and pass now. The fallback-walk scenario fails when the XamlControlsResources guard is removed and passes with it. All 7 tests pass, locally and in CI.
In a Windows contrast theme, Light and Dark share brushes, so the probe reports a skip and the tests are Inconclusive rather than failing.
Selftest fixtures in ThemeRefResolutionFixtures.cs.
Resolved brushes match a live {ThemeResource} border in both themes.
Keys with odd characters resolve.
Partial-theme keys still resolve through the fallback, including a cached style applied for a theme without the key.
Missing or non-brush keys return null.
Unit tests in ThemeResourceProbeTests.cs for the markup quoting and XML escaping, and for keys that go straight to the fallback (control characters, tab/CR/LF, lone surrogates).
Mutation check. Ignoring the requested theme, dropping the fallback, dropping the quoting, and dropping the XamlControlsResources guard each failed the intended tests.
dotnet test tests/Reactor.Tests passed, 15,955 tests.
dotnet test tests/Reactor.SelfTests on an interactive desktop: 2,098 passed. The 3 failures were two CommandBarFlyout open-timing fixtures and a shutdown probe timeout. All three pass alone, and the flyout fixtures fail the same way on main.
dotnet test tests/Reactor.PackagedTests -p:Platform=x64: 2,089 passed. The 3 failures were the same two flyout fixtures and WindowLevel_RuntimeFlip_Topmost, which also fails 2 out of 3 times on main.
HostThemeChangeTests E2E passed.
After the review fixes I reran the Theme_, CoreCov_ThemeRef, Item1, Issue675, ResourceOverride, ThemeBindings, FlyoutTarget_Memo, Validation, FormField and NotifyResources selftests, the 7 process tests, and the theme unit tests. All passed.
Release builds of src/Reactor and the test projects with warnings as errors locally. The full Reactor.slnx Release build ran in CI, along with selftests, packaged and AOT selftests, and passed.
Not checked under a Windows contrast theme.
Risk / breaking changes
No public API change.
ThemeRef.Resolve and .Resources(...) theme overrides now return the correct brush for the theme the app isn't using, which is what the API always promised.
Resolution goes through WinUI's {ThemeResource} lookup. Where an app defines the same key in more than one merged dictionary, WinUI's lookup order now decides which one wins, the same as {ThemeResource}. While a Windows contrast theme is on, the result should follow WinUI too, but I haven't checked it by hand.
A key that exists nowhere costs a failed XAML parse plus the dictionary walk on each resolve, roughly 1.5 ms. Failed lookups aren't cached, so a dictionary merged later still resolves without Theme.NotifyResourcesChanged(). Avoid resolving a missing key per cell.
The Devtools resources tool also reads every theme dictionary entry and has the same side effect. That's out of scope here.
…1534)
Reading a WinUI theme dictionary entry from code creates it for the
application theme and shares it app-wide, so resolving the other theme
returned the wrong brush and changed it for every element. ThemeRef now
asks WinUI to resolve {ThemeResource key} on an off-tree element with the
requested RequestedTheme, and falls back to the dictionary walk only for
keys WinUI cannot resolve for that theme.
Adds a fresh-process probe (--themeref-probe) with MSTest coverage for
ThemeRef.Resolve, the element overload and .Resources overrides, plus
selftest fixtures and unit tests for the probe.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…n coverage
- Update the theming-tokens guide and the design-docs skill, which still described
ThemeRef resolution as a ThemeDictionaries walk.
- Add a raw-read negative control and a missing-key scenario to the fresh-process probe.
- Send keys XML can't hold as written (control characters, tab/CR/LF, lone surrogates)
to the dictionary walk instead of the probe.
- Cover a cached probe style applied for a theme that lacks the key.
- State the contrast-theme behavior as a property of the lookup.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ghten tests and docs
- The dictionary-walk fallback skips XamlControlsResources, so it can never read WinUI's
own theme entries from code.
- Document the fallback's plain-lookup step on ThemeRef.Resolve; drop the untested
contrast-theme claim.
- Docs: ThemeRef.Resolve resolves for the theme passed as isDark, not the element's theme.
- Replace XmlConvert with an in-file XML Char check so trimmed apps don't keep System.Xml.
- The raw-read negative control asserts the poisoning itself; the app-only-key fixture
asserts the actual brush.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The theme probes incorrectly report regressions under Windows high-contrast themes because Light and Dark can legitimately share system brushes, requiring explicit skip handling and a guarded distinctness assertion.
Fixes #1534 by letting WinUI resolve ThemeRef brushes for the requested theme, avoiding dictionary reads that could return the wrong color and affect other elements. The change also benefits theme-backed resource overrides and validation styling without changing the public API.
Changes:
Adds an off-tree resource probe with cached Styles, retaining a dictionary fallback for unresolved app keys.
Adds fresh-process regression controls, live theme-resolution fixtures, and markup-escaping unit tests.
Updates documentation and the changelog to explain the resolution behavior.
File
Description
tests/Reactor.Tests/ThemeResourceProbeTests.cs
Tests key quoting, XML escaping, and unsupported characters.
Artifact sizes for 38197d5 vs the base branch (9569c46).
Packages (compressed .nupkg)
Artifact
base
PR
Δ
Microsoft.UI.Reactor.nupkg
2.09 MB
2.09 MB
+1.76 KB (+0.08%)
⚠️
Microsoft.UI.Reactor.Advanced.nupkg
528.6 KB
528.6 KB
-11 B (0.00%)
≈
Microsoft.UI.Reactor.Devtools.nupkg
287.9 KB
287.8 KB
-17 B (-0.01%)
≈
Assemblies in Microsoft.UI.Reactor
Artifact
base
PR
Δ
Reactor.Analyzers.dll
422.5 KB
422.5 KB
+0 B (0.00%)
≈
Reactor.dll
2.83 MB
2.83 MB
+1.50 KB (+0.05%)
⚠️
Reactor.Localization.Generator.dll
16.0 KB
16.0 KB
+0 B (0.00%)
≈
Reactor.Wrappers.Abstractions.dll
10.5 KB
10.5 KB
+0 B (0.00%)
≈
Reactor.Wrappers.Generator.dll
164.0 KB
164.0 KB
+0 B (0.00%)
≈
Assemblies in Microsoft.UI.Reactor.Advanced
Artifact
base
PR
Δ
Reactor.Advanced.dll
1.08 MB
1.08 MB
+0 B (0.00%)
≈
Assemblies in Microsoft.UI.Reactor.Devtools
Artifact
base
PR
Δ
Microsoft.UI.Reactor.Devtools.dll
787.0 KB
787.0 KB
+0 B (0.00%)
≈
✅ smaller / ⚠️ larger / ≈ within noise. Sizes come from a Release dotnet pack on the CI runner: packages are the compressed .nupkg download size, assemblies the uncompressed DLL inside it. workflow run.
- The fresh-process probe reports a skip in a Windows contrast theme, where Light and Dark
share brushes, and the MSTest driver maps it to Inconclusive; the fixture skips only its
distinctness check there.
- Drop the generic catch in the app-only-key fixture check.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The guard misses root-level XamlControlsResources, allowing fallback lookup to enter native theme dictionaries and bypass protection against issue #1534 in normal Reactor apps.
Coverage for 38197d5 vs the base branch (9569c46) — unit + selftest merged.
Metric
base
PR
Δ
Line
88.69%
88.69%
0.00 pp
≈
Branch
45.73% (18375/40179)
45.73% (18382/40199)
0.00 pp
≈
No coverage change beyond the noise floor. ✅
✅ higher / ⚠️ lower / ≈ within noise. Δ is in percentage points; coverage is unit + selftest merged (Debug x64) on the CI runner. Cobertura reports attached to the workflow run as artifacts.
The dictionary-walk fallback skips XamlControlsResources' own theme dictionaries when it is
Application.Resources itself, as in every Reactor app, not only when it is merged. A new
fresh-process scenario runs the fallback walk alone on real keys for the other theme and
checks that WinUI's entries stay correct.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The fallback skips app dictionaries nested beneath merged XamlControlsResources, causing partial-theme resources such as a Dark-only brush in a Light app to resolve to null.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Recurse into nested XamlControlsResources for theme fallback
src/Reactor/Core/Theme.cs:232
When an app dictionary is nested beneath a merged XamlControlsResources, this continue makes its partial-theme keys unreachable by the fallback. A Dark-only brush in a Light app then resolves to null: the probe cannot load the reference, and the final plain lookup uses Light. Recurse through this node instead—the current-dictionary guard above already protects WinUI's own theme entries—and add a regression case for this nested shape.
Keeps both CHANGELOG Fixed entries. ThemeResourceProbe now builds its markup with
Reconciler.FormatThemeResourceReference, which #1636 added with the same quoting and
escaping rules, instead of its own copy.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Skipping merged XamlControlsResources also bypasses app-owned dictionaries, causing previously resolvable brushes defined only for the opposite theme to return null.
…trolsResources
The per-dictionary guard already keeps the fallback out of WinUI's own theme entries, so
recursing into a merged XamlControlsResources is safe and reaches app dictionaries merged
into it, as it already did for the root.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The rebase onto main removed reactor-vs-xaml, which #1633 had edited to
say theme modifiers set properties through a {ThemeResource} reference.
Add that point to the page that replaced it.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The rebase onto main removed reactor-vs-xaml, which #1633 had edited to
say theme modifiers set properties through a {ThemeResource} reference.
Add that point to the page that replaced it.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The rebase onto main removed reactor-vs-xaml, which #1633 had edited to
say theme modifiers set properties through a {ThemeResource} reference.
Add that point to the page that replaced it.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Move the docs site from MkDocs + mike to Blume
Material for MkDocs is no longer developed. The site now builds with
Blume from the new docs/_website project:
- scripts/sync.mjs turns docs/guide into Blume's source tree, places
pages with nav.json, keeps every MkDocs heading anchor and writes
redirects for old page URLs.
- scripts/publish.mjs replaces mike. It keeps the same gh-pages layout
(main/, <version>/, latest/, versions.json, root redirect), so
versions published with MkDocs stay as they were.
- docs.yml publishes main, release tags and backfills with it. A final
release now ranks above its previews when choosing `latest`.
- The PR docs-build job runs a strict Blume build and link check.
- DocsSiteScriptsTests runs the 37 node cases for both scripts.
mkdocs.yml, docs/requirements.txt and docs/_overrides are removed.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Open every guide page with its title and a short summary
Guide pages now start with the # title, then a one-sentence, link-free
summary (the site subtitle), then the longer overview. The WinUI
reference note moves from the top of the page to just before the first
section.
- TemplateParser inserts the WinUI note before the first ## heading.
- TIER_008 counts the overview between the title and the first ##.
- The comprehensive skeleton and contributor docs match the new layout.
- 58 templates restructured; docs/guide recompiled.
- sync.mjs rewrites links paragraph by paragraph, so link text that
wraps onto a second line still resolves on the site.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Add a docs home page and Showcase page, and regroup the docs
The home page links to the latest Reactor blog post and the new Showcase
page, explains Reactor next to a live counter example, and leads into
Get started, Guides, Controls, Recipes, API reference and How it works.
Showcase lists the sample apps in the repo with links to their source.
The tabs are now Get started, Guides, Controls, Recipes, API reference
and How it works ("Internals" is renamed), and Guides is grouped by task.
docs/_website/docs is now fully generated by sync.mjs. The site gets a
footer and uses the Reactor icon as its favicon.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: add showcase screenshots and gradient card art
Each Showcase app now has a screenshot, and a "Submit your app" link
opens a new Showcase issue form. The home page and Showcase cards use
soft color gradients drawn in CSS, so they need no image files.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(site): blog banner, Showcase card, Fluent icons and clearer WinUI copy on the home page
- Turn the blog card into a small banner above the title and move the
Showcase card below Get started.
- Say plainly that Reactor builds native Windows apps with WinUI 3, add a
'Built on' line, and lead the facts row with Native WinUI 3.
- Add Fluent UI System Icons (MIT, vendored with license) to the facts.
- Drop the Terminal label and the extra gap under the quickstart code.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: blog card, WinUI logo in header and facts, Fluent regular icons
Replace the blog pill with a thumbnail card for the latest devblogs post.
Show the WinUI logo next to the site title (also used on social cards)
and on the Native WinUI 3 fact. Switch the other fact icons to the
monochrome Fluent UI System Icons regular set. Keep 'Native Windows apps,'
on one line from sm up.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: frosted copy button on the dark Quickstart card
Blume's copy button uses the page background, so in light mode it was a
white square with an almost invisible icon on the always-dark card.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: compact blog banner without the thumbnail
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* test: skip the docs site build output in the SDK pin guard
A local Blume build leaves docs/_website/.blume, .blume-verify, dist and docs
behind. They are untracked copies of the guides and of CHANGELOG.md, which the
guard exempts as a historical record. Sweeping them made the guard fail after
any local docs build, on unparseable JSON-escaped pins and on CHANGELOG's old
pins. Prune them by repo-relative path; dist is not pruned by name because
tools/figma-plugin/dist is tracked.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: remove the Registry Editor from the Showcase
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(site): fix package-lock so npm ci works in CI
Drop the 20 extraneous oxc-transform-react entries (the package and its 19 platform bindings) that made npm ci fail with EBADPLATFORM, and point every resolved URL at the public npm registry instead of the internal feed.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(reference): generate the full API reference from XML docs
Rewrite the reference generator (AssemblyModel, ReferencePlanner, ReferenceRenderer) so it covers every public type, hook, factory and modifier, grouped by category. Regenerates docs/guide/reference (287 pages).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(reference): regenerate against main
Picks up main's API changes since the branch point, including the
removed PathDataParser and the rotation-in-degrees transforms.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(reference): track pending.md with the casing the generator writes
The reference generator names this page from its reference-map id,
`pending`, but Git on Windows kept the old tracked name `Pending.md`.
Links and the site nav use `pending.md`, so the Linux docs build could
not find the page.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(site): add the API reference to the site nav
The generated API reference pages need nav groups, or the strict site
build rejects them as unplaced.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(reference): regenerate for the latest main
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(reference): skip XAML markup compiler members so pages don't depend on the build
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(reference): regenerate for TransformOrigin from main
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(reference): address review: map validation, safer writes, overload tables, tests
- reference-map.yaml: ids must be slugs, unknown keys and undeclared
categories are errors (REGISTRY_001); categories are synthesized only
when none are declared.
- WriteToDisk refuses a page path outside reference/, and the prune walk
skips reparse points.
- A missing Microsoft.UI.Reactor.dll is REFGEN_003: nothing is written
or pruned, and --ci / --reference-only exit 1.
- Overloads get a table whenever their summaries differ, counting an
empty summary as different.
- Float defaults are written with "R" (0.8f); a nullable flag on a
generic value type (tuples) now lands on the right argument.
- Numbered block starts are escaped as "1\." instead of "\1.".
- Tests: FromAssembly fixture tests, UniqueStem, map schema checks,
Learn more from ref markers, write containment, junction prune, and a
nav.json check that compares the reference groups with the generator.
Drops Overloads_DoNotEmit_REFGEN_002, which could no longer fail.
- Docs: --reference-only and --reference-nav-out, REFGEN_003, grouped
reference pages; drop REGISTRY_W001 and the old page count.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(reference): regenerate for the review fixes
Output of `compile --no-screenshots --ci`.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: rebuild the Get started section
New Overview and Installation pages, a step-by-step first app tutorial, a rewritten Thinking in Reactor, and one Coming from XAML page that replaces reactor-vs-xaml. Links and tests now point at the new pages.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: add the developer tools pages
New pages for hot reload, Devtools, the mur CLI, analyzers and building with AI. Rewrites the dev tooling overview and editor extensions pages and refreshes diagnostics.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: add Native AOT, services, desktop integration and samples guides
Four new guides, each backed by a doc app. Updates packaging, windows and hooks, and adds missing cross-links.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(site): restructure navigation and add Tools to the homepage
Tabs are now Home, Get started, Guides, Controls, Tools, API reference and How it works. Adds redirects for moved pages, a Tools section and API card on the homepage, and new Fluent icons.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: version menu like the old MkDocs site
Each published build reads versions.json at runtime, so older versions list newer releases. Picking a version opens the same page there, or that version's home if the page is missing. Local dev links to the published docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Docs site: generate a Changelog from CHANGELOG.md
Sync turns each dated release in the root CHANGELOG.md into a Blume
changelog page: buckets become sections, guide links become site routes,
repo files link to GitHub at the synced ref, and bare #NNNN refs link to
issues. Blume adds the /changelog index and an RSS feed. The header and
footer link to it.
Lenient (backfill) syncs now skip a hand-written nav.json redirect whose
source page still exists in the old tag, instead of failing the build.
Also fixes the stale jump list anchor in the preview.17 notes.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: tabs, steps and prompts in guide pages
Templates mark them with HTML comments, so docs/guide still reads as plain Markdown on GitHub. sync.mjs turns the markers into Blume's Tabs, Steps and Prompt components and writes those pages as .mdx. Installation, Build with AI, the VS extension and Hot reload use them. theme.css gives inline code inside a tab or step the same chip as the rest of the page.
The runbook and CHANGELOG now say that a backfill rebuilds the MkDocs versions with Blume.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: carry the #1633 theme wording into the XAML developers page
The rebase onto main removed reactor-vs-xaml, which #1633 had edited to
say theme modifiers set properties through a {ThemeResource} reference.
Add that point to the page that replaced it.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: regenerate compiled guide and reference pages
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: say "WinUI" and "WinApp CLI"
Use the current product names across the docs site: "WinUI" instead of
"WinUI 3" in the guide pages, the homepage, the Showcase and the
render-loop diagram, and "WinApp CLI" instead of "Windows App SDK CLI"
on the install page. URLs, file paths and the generated API reference
are unchanged.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: address review feedback on the docs rewrite
- Home: the hero "Get started" button goes to first-app; header, footer and
Start here links only appear when the version has that page.
- Changelog: summaries match bucket prefixes such as "Changed (breaking)";
malformed release headings fail strict mode. CI and docs.yml watch
CHANGELOG.md.
- Version menu: path logic moved to a DOM-free module with node tests.
- Analyzers table lists every rule; a DocPipeline test keeps it in step
with AnalyzerReleases.
- Hot reload, getting started and native AOT pages: corrected rename,
static field, WithKey and devtools switch guidance.
- Pickers links, search index, SKILL.md /latest/ links and the ai-author
page table updated.
- CONTRIBUTING: manual mur refresh stamps a version, and picks up the
template and restricted-network notes; the README section now links there.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: regenerate guide pages
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* test: expect CHANGELOG.md in the compiled-docs CI filter
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(reference): fix required members, generic bases and generic defaults
- Don't show the [Obsolete] Roslyn adds to constructors of types with
required members as a deprecation, and keep the `required` modifier on
properties and fields.
- Keep constructed generic bases (`: Component<PropertyGridElement>`) in
the declaration and the "Inherits from" link.
- Write `T value = default` as `default`, not `null`.
- Regenerate the affected reference pages.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(site): address review on the Blume move
- Redirect pages for moved routes keep the #fragment. Astro writes them as
meta-refresh stubs, which drop it, so scripts/redirect-pages.mjs adds a
location.replace that carries search and hash, after every build.
- Home page: "All guides" and "API reference" linked to /guides and
/reference, which have no page. They now go to the first guide and to
/reference/hooks.
- Showcase entries can link to an app's own repo (url) as well as a folder
here. The issue form and page now agree the showcase is open source only.
- sync.mjs fails a page whose opening paragraph can't be the site summary
(has a link or runs over 420 chars), warning only with --lenient. The
skeletons and ai-author-skill state the rule for every tier, and the stub
skeleton no longer opens with a link.
- Dialogs page gets a standalone summary; the Overview page lists the docs
by the site's tabs instead of the old ten MkDocs sections.
- blume.config.ts derives its version settings from scripts/site-env.mjs so
they are testable. New tests cover those settings, the versionsort tag
pick in docs.yml, a failed sync aborting publish, and --push.
- CHANGELOG: 16 pages had the WinUI note, not 17. ai-author-skill no longer
calls order: the source of truth for site order (nav.json is).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Address review round 1
- MarkdownFence: one fence tracker for TemplateParser and TierLint. A fence
closes only on the same character, at least as long, with nothing after it,
so a four-backtick block can hold a three-backtick example.
- Home and Showcase pages pass siteUrl and ogEnabled, so they get a canonical
link and their generated social card.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(reference): regenerate Reconciler after merging the base
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Address review round 2
- MarkdownFence: an opening backtick fence can't have a backtick after it, so an
inline ```x``` span is no longer read as a fence (matches sync.mjs fenceMask).
- Home page forwards a fragment it doesn't have (a section of the old guide
index, e.g. #minimal-project-setup) to the same section on /get-started.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Address review round 3
Fence markers and section headings count only with zero to three spaces of
indent, as in CommonMark and sync.mjs. A fence line indented four spaces no
longer closes a block, and an indented " ## Usage" is a section.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Address review round 1
- Only element-returning extensions count as modifiers, so GetFocus,
GetValidation and EvaluateAsync stay on their declaring type pages.
- Correct the PoolPolicy.Reset doc: the engine keeps ReactorState and
ControlEventState across a pool return.
- Factories declared outside `Factories` name the `using static` they need.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Address review round 4
The home page also forwards a legacy fragment set after it loaded (hashchange),
not only the one it opened with.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Address review round 5
TIER_008 no longer counts an indented (4-space) code block as overview prose.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Address review round 2
Write the `notnull` constraint in generated signatures. Roslyn stores it as
a not-annotated nullable flag on a type parameter with no other constraint,
read from the parameter itself or its method or type nullable context.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs(site): drop the /reference/hooks/Pending redirect
It differs from the real /reference/hooks/pending page only by case, so
the build writes no redirect page for it and redirect-pages.mjs fails
the strict docs build. It is the only redirect that collides this way.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Alexandre Zollinger Chohfi <alzollin@microsoft.com>
…1755)
* Refresh resolved theme brushes when WinUI applies a contrast theme (#1506)
ThemeRef.Resolve already asks WinUI for the brush (#1633), so it picks the
HighContrast dictionary while a contrast theme is on. What was missing is a
re-render once WinUI has switched: ActualThemeChanged does not fire when a
contrast theme is turned on, ColorValuesChanged arrives before WinUI applies
it, and a window host without a chart never subscribed to it.
Each host now merges a small theme probe (a brush with a {ThemeResource}
reference into Default/Light/HighContrast colors) into its tree: the content
root for ReactorHost, the control itself for ReactorHostControl. WinUI updates
the probe when it applies a theme; on a later dispatcher turn the host checks
whether the contrast state changed and runs a resource-refresh pass, which
reaches memoized subtrees too. The design follows #1509's probe.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Address pr-review findings
- A probe that replaces another (root swap, or a root after an empty render)
starts from the contrast state the host last rendered with and checks on
its first turn, so a switch the old probe had not reported still refreshes.
- Static ReaderForTest seam; fixtures cover the pending-check root swap, the
empty-render detach, check coalescing, ThemeRef.Resolve in a render, and
skip on a desktop in a contrast theme.
- Regenerate the ThemeRef reference page; correct the design-doc sentence
about ColorValuesChanged.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Address review round 1: log swallowed probe-removal errors
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ThemeRef.Resolveread WinUI's theme dictionaries from code. WinUI creates a theme dictionary entry the first time it is read and resolves it for the app's theme, then keeps it for every element. So in a Light app, resolving the Dark brush returned the Light color, and every Dark element using that key showed the Light color from then on. In a sweep of 40 common keys, 32 were affected, in both directions. SettingRequestedThemeon the window root doesn't help, only the app theme counts.The same lookup backed
.Resources(...)overrides with theme tokens under an element with the otherRequestedTheme, and validation styling in such a subtree.Reactor now asks WinUI to resolve
{ThemeResource key}on an off-treeBorderwith the requestedRequestedThemeand reads the value back (ThemeResourceProbe). This gets the same brush an element in that theme gets, without touching WinUI's shared entries. Only when WinUI can't resolve the key for that theme does it fall back to the old dictionary walk, for example for an app key defined only in Dark, or only in Default next to Light and Dark. The walk skipsXamlControlsResources, including when it isApplication.Resourcesitself as in every Reactor app, so it can never read WinUI's own entries from code. Missing and non-brush keys still return null, and the(key, theme)brush cache is unchanged.The probe parses a small Style with
XamlReader, cached per key and UI thread, the same mechanismApplyThemeBindingsalready uses. Stable WinUI has no code API for a{ThemeResource}reference.FrameworkElement.SetThemeResourceBinding(microsoft/microsoft-ui-xaml#11229) is that API, and I checked it on2.6.6-experimental. It returns the right brush for all 40 keys in both app themes and doesn't change the shared entries, so it can replace the Style once it's stable. #1634 tracks that move.Linked issue / spec
Fixes #1534
Related: #1531 (spec 065 §7 describes this bug, and it rewrites the same
ResolveForThemeUncachedfor contrast themes, #1506), #1618 (movesApplyThemeBindingstoSetThemeResourceBinding), #1634 (follow-up move of this probe to the same API).Test plan
--themeref-probe <scenario>mode, driven byThemeRefProbeProcessTestsintests/Reactor.SelfTests. It does one first read for the theme opposite to the app's, then rendersTheme.Refborders in both themes.ThemeRef.Resolve(key, isDark),Resolve(key, fe)(the validation path),.Resourcesoverrides, a missing key, and the dictionary-walk fallback run on its own for real keys.XamlControlsResourcesguard is removed and passes with it. All 7 tests pass, locally and in CI.ThemeRefResolutionFixtures.cs.{ThemeResource}border in both themes.ThemeResourceProbeTests.csfor the markup quoting and XML escaping, and for keys that go straight to the fallback (control characters, tab/CR/LF, lone surrogates).XamlControlsResourcesguard each failed the intended tests.dotnet test tests/Reactor.Testspassed, 15,955 tests.dotnet test tests/Reactor.SelfTestson an interactive desktop: 2,098 passed. The 3 failures were twoCommandBarFlyoutopen-timing fixtures and a shutdown probe timeout. All three pass alone, and the flyout fixtures fail the same way onmain.dotnet test tests/Reactor.PackagedTests -p:Platform=x64: 2,089 passed. The 3 failures were the same two flyout fixtures andWindowLevel_RuntimeFlip_Topmost, which also fails 2 out of 3 times onmain.HostThemeChangeTestsE2E passed.Theme_,CoreCov_ThemeRef,Item1,Issue675,ResourceOverride,ThemeBindings,FlyoutTarget_Memo,Validation,FormFieldandNotifyResourcesselftests, the 7 process tests, and the theme unit tests. All passed.src/Reactorand the test projects with warnings as errors locally. The fullReactor.slnxRelease build ran in CI, along with selftests, packaged and AOT selftests, and passed.Risk / breaking changes
ThemeRef.Resolveand.Resources(...)theme overrides now return the correct brush for the theme the app isn't using, which is what the API always promised.{ThemeResource}lookup. Where an app defines the same key in more than one merged dictionary, WinUI's lookup order now decides which one wins, the same as{ThemeResource}. While a Windows contrast theme is on, the result should follow WinUI too, but I haven't checked it by hand.Theme.NotifyResourcesChanged(). Avoid resolving a missing key per cell.resourcestool also reads every theme dictionary entry and has the same side effect. That's out of scope here.