Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,15 @@ Conventions for contributors:
instead of `0,0,8,0`. A flip back to left-to-right with a declared physical value could
also skip the write and leave the right-to-left value on the control.

- ReactorGallery search keeps complete samples that contain ellipses in comments
or display text, restoring the Pan and `OpacityTransition` examples in
`winapp find-ui --source reactor`. Code elisions, map-token fill-ins, and placeholders
in URI-shaped string literals are filtered, including Image and MediaPlayerElement
sources and displayed URI templates. An independent coverage check catches missing
cards even after index regeneration
([issue #1020](https://github.com/microsoft/microsoft-ui-reactor/issues/1020),
[spec 064 §3.2](docs/specs/064-search-index-framework-concepts.md#32-every-clean-card-is-emitted)).

### Security

## [0.1.0-preview.18] — 2026-11-12
Expand Down
1 change: 1 addition & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ Some tests here parse repo *sources* with Roslyn rather than exercising Reactor
| `GallerySnippetAgreementTests` | A `SampleCard` snippet uses a lowerCamelCase name that does not exist in the live code beside it — the snippet renamed, or the card did and the snippet did not. Direction is snippet → live only: a snippet may omit, it may not invent. |
| `GallerySampleLintTests` | An ItemsView view builder returns something other than an item-container root; a shape paints with `.Background(...)` instead of `Fill`/`Stroke`; or an `ms-appx` asset is missing or not copied to the output. Also checks [PUA glyph fonts](#pua-glyph-fonts-in-gallery-samples) in live gallery code and displayed snippets. |
| `SearchIndexGeneratorTests` | `samples/ReactorGallery/reactor-search-index.json` is stale. Regenerate with `dotnet run --project tools/Reactor.SearchIndex`. |
| `SearchIndexCoverageTests` | A routed Gallery card is missing or out of order in the index, or a [manifest entry](tests/Reactor.Tests/Tooling/SearchIndexCoverageTests.cs) no longer names a source card. This check still catches omissions after index regeneration. |

A snippet-agreement failure names the page, line, card title and identifier, and says which of the two sides to move. There is no allowlist: fix the snippet or fix the card.

Expand Down
17 changes: 14 additions & 3 deletions docs/specs/064-search-index-framework-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,23 @@ one snippet, and the contract's `samples` array was always plural.
- An editorial `sampleOverride` still defines the **first** sample (replacing its
header, its code, or both, or standing alone when no card qualifies); the
page's remaining clean cards follow it.
- The per-card REAL-CODE-ONLY rule is unchanged: a card that abbreviates with a
placeholder is passed over, and a page with no clean card at all still fails
generation.
- The per-card REAL-CODE-ONLY rule skips code elisions, comment-only snippets,
explicit omission comments, map-token fill-ins, and placeholders in URI-shaped
literals. Ordinary comments and display strings can contain ellipses. See the
[generator's rules](../../tools/Reactor.SearchIndex/README.md#guarantees--gate)
for the supported literal arguments and omission markers. A page without a usable
sample still requires an editorial override.
- Headers are deduplicated case-insensitively — two same-titled cards would ship
two indistinguishable scenarios.

The byte-comparison gate checks freshness. As a separate coverage check for
[#1020](https://github.com/microsoft/microsoft-ui-reactor/issues/1020),
`SearchIndexCoverageTests` enumerates the routed source cards and compares their
headers and order with the index. Its manifest records deliberate omissions by
card with a reason. Override headers come directly from `editorial.json` and apply
to the first non-skipped card, or provide a standalone sample header. A missing
card fails this test even when the index has already been regenerated.

### 3.3 Prose is lifted from the skills by marker

`curatedKeywords` and `docs` are authored in `editorial.json`. `details` is not:
Expand Down
5 changes: 5 additions & 0 deletions samples/ReactorGallery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ dotnet run --project tools/Reactor.SearchIndex
```

A `Reactor.Tests` gate byte-compares the committed file, so a stale index fails CI.
`SearchIndexCoverageTests` also checks for cards that are missing from a regenerated
index. Record deliberate omissions in the
[coverage manifest](../../tests/Reactor.Tests/Tooling/SearchIndexCoverageTests.cs).
Remove an omission entry when its card becomes a complete sample.

Curate keywords and overrides in `tools/Reactor.SearchIndex/editorial.json`, never in
the generated JSON.

Expand Down
10 changes: 10 additions & 0 deletions samples/ReactorGallery/reactor-search-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2157,6 +2157,11 @@
"language": "csharp",
"code": "var (tapLog, setTapLog) = UseState(\"Tap, double-tap, or right-tap the card.\");\n\nBorder(TextBlock(tapLog))\n .IsTabStop(true)\n .AutomationName(\"Tap surface\")\n .OnTapped((_, _) => setTapLog(\"Tapped.\"))\n .OnDoubleTapped((_, _) => setTapLog(\"Double-tapped.\"))\n .OnRightTapped((_, _) => setTapLog(\"Right-tapped.\"))\n .OnLongPress(onTriggered: () => setTapLog(\"Long-pressed.\"), enableMouseEmulation: true)\n // Reachable by Tab is not the same as operable — pair the tap with Enter/Space.\n .OnKeyDown((_, e) =>\n {\n if (e.Key is not (VirtualKey.Enter or VirtualKey.Space)) return;\n setTapLog(\"Activated from the keyboard.\");\n e.Handled = true;\n })"
},
{
"header": "Pan — drag with the phase lifecycle",
"language": "csharp",
"code": "var (offsetX, moveX) = UseReducer(0.0);\nvar (offsetY, moveY) = UseReducer(0.0);\n\nBorder(TextBlock(\"Drag me\"))\n .OnPan(\n onChanged: e =>\n {\n // Functional updaters, NOT setOffsetX(offsetX + ...): several onChanged\n // callbacks can land between two renders, and each would read the same\n // stale captured value and overwrite the one before it.\n moveX(x => x + e.Delta.X);\n moveY(y => y + e.Delta.Y);\n },\n minimumDistance: 4)\n .Translation((float)offsetX, (float)offsetY, 0)"
},
{
"header": "Pinch and rotate",
"language": "csharp",
Expand Down Expand Up @@ -3271,6 +3276,11 @@
"nugetPackage": "Microsoft.UI.Reactor",
"galleryRoute": "transitions",
"samples": [
{
"header": "OpacityTransition",
"language": "csharp",
"code": "var (visible, setVisible) = UseState(true);\n\nTextBlock(\"Opacity is animated, not toggled\")\n .Opacity(visible ? 1.0 : 0.0)\n .OpacityTransition(TimeSpan.FromMilliseconds(400))\n// Omit the TimeSpan for the 300ms default. Fading to 0 leaves the element in the tree\n// and still occupying its layout slot -- use .Transition(...) if you want it to leave."
},
{
"header": "ScaleTransition",
"language": "csharp",
Expand Down
2 changes: 1 addition & 1 deletion tests/Reactor.Tests/Tooling/GallerySources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static string RepoRoot()
/// <summary>Includes supporting source files so constants and partial types bind across files.</summary>
public static IReadOnlyList<(string Path, SyntaxNode Root)> AllSources() => ReadSources(GalleryDir());

static IReadOnlyList<(string Path, SyntaxNode Root)> ReadSources(string directory)
internal static IReadOnlyList<(string Path, SyntaxNode Root)> ReadSources(string directory)
{
Assert.True(Directory.Exists(directory), $"gallery source directory not found at {directory}");

Expand Down
Loading
Loading