Skip to content

Gallery: cover file pickers, ErrorBoundary, grid min/max, and TitleBar icon inheritance - #1400

Merged
Alexandre Zollinger Chohfi (azchohfi) merged 5 commits into
mainfrom
azchohfi-gallery-coverage-audit
Oct 22, 2026
Merged

Alexandre Zollinger Chohfi (azchohfi) merged 5 commits into
mainfrom
azchohfi-gallery-coverage-audit

Conversation

@azchohfi

Copy link
Copy Markdown
Collaborator

Summary

Several user-facing features merged since the ReactorGallery was last updated had no gallery coverage. This adds it:

Also: regenerated reactor-search-index.json with editorial entries for the new pages, linked the pickers page from GAPS.md, a CHANGELOG entry, and a new GalleryDeepLinkTests gate that every control's category is listed in ControlRegistry.Categories (a missing entry silently drops a page from the nav).

Linked issue / spec

Follows up #1106, #1145, #1153, #1311, #1372, #1394. Search-index conventions per docs/specs/064-search-index-framework-concepts.md.

Test plan

  • dotnet test tests/Reactor.Tests --no-build -p:Platform=x64 --filter-class "*Gallery*" --filter-class "*SearchIndex*" — 337 passed, 0 failed (includes the new EveryControlCategory_IsListedInCategories, mutation-checked: removing "System" from Categories makes it fail).
  • dotnet run --project tools/Reactor.SearchIndex -- --check — up to date (106 controls, 0 skipped).
  • dotnet restore samples/ReactorGallery/ReactorGallery.csproj then dotnet build samples/ReactorGallery/ReactorGallery.csproj -c Release -p:Platform=x64 --no-restore — succeeded, 0 warnings.
  • Manual check of the running gallery over UIA (winapp ui):
    • All five pickers open their native dialog owned by the gallery window, and Cancel reports "Cancelled.".
    • ErrorBoundary: crashing → fallback → Retry works, and crashing cards 1 and 2 then retrying card 1 leaves card 2 in its fallback.
    • The unguarded card shows the built-in in-slot fallback, and Reset recovers it.
    • Grid tracks clamp at 650px (the max 100 column is capped).
    • Shell and sample title bars show the inherited window icon.

Risk / breaking changes

Sample-only; no framework or public API changes. The search index stays schemaVersion: 1 and only adds entries and fields. It is consumed externally (winui-search), so the new System category value and the file-pickers / error-boundary ids are additive.

…n inheritance

- New System -> File pickers page (PickFileAsync, PickMultipleFilesAsync with
  FileTypeChoices, PickFolderAsync/PickMultipleFoldersAsync, PickSaveFileAsync).
- New Patterns -> ErrorBoundary page: catch-and-retry via WithKey, static
  fallback, and the built-in fallback a RenderErrorHandler replaces.
- Grid page: GridSize.MinSize/MaxSize card driven by a width slider.
- TitleBar page: inherited / custom / NoIcon() variants.
- Gallery declares its window icon once via ReactorApp.Run(icon:); the shell
  TitleBar now inherits it instead of hand-building the path.
- Regenerate reactor-search-index.json; editorial entries for the new pages.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f1845cfe-c63e-4596-ad7d-ce1007ea9f93
- ErrorBoundary page: each demo is its own component so a click in one card no
  longer re-mounts every other card's crashed boundary; correct the comments
  about what bumping a key does.
- Make System a non-control category (top-level nav, 'topics' label).
- Snippets: declare gridWidth; wrap the save write in try/catch; TitleBar icon
  scope wording; use WindowIcon.FromPath like the guide and other samples.
- Program.cs: WindowIcon.FromPath("Assets/GalleryIcon.ico").
- Gate: every ControlRegistry category is listed in Categories.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f1845cfe-c63e-4596-ad7d-ce1007ea9f93
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build metrics

Artifact sizes for 954d35e vs the base branch (4f0bf1c).

Packages (compressed .nupkg)

Artifact base PR Δ
Microsoft.UI.Reactor.nupkg 1.90 MB 1.90 MB -57 B (0.00%) ≈
Microsoft.UI.Reactor.Advanced.nupkg 493.3 KB 493.3 KB -12 B (0.00%) ≈
Microsoft.UI.Reactor.Devtools.nupkg 287.9 KB 287.8 KB -7 B (0.00%) ≈

Assemblies in Microsoft.UI.Reactor

Artifact base PR Δ
Reactor.Analyzers.dll 410.5 KB 410.5 KB +0 B (0.00%) ≈
Reactor.dll 2.65 MB 2.65 MB +0 B (0.00%) ≈
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 99.5 KB 99.5 KB +0 B (0.00%) ≈

Assemblies in Microsoft.UI.Reactor.Advanced

Artifact base PR Δ
Reactor.Advanced.dll 1.00 MB 1.00 MB +0 B (0.00%) ≈

Assemblies in Microsoft.UI.Reactor.Devtools

Artifact base PR Δ
Microsoft.UI.Reactor.Devtools.dll 787.5 KB 787.5 KB +0 B (0.00%) ≈

No size change beyond the noise floor. ✅

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

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.

🟡 Changes recommended

The new grid example needs accessibility fixes for its slider name and label contrast.

2 open issues
What changed in this PR

This PR expands ReactorGallery coverage of existing framework features without changing framework APIs.

Changes:

  • Adds file-picker and ErrorBoundary pages, including navigation and search integration.
  • Demonstrates grid track min/max sizing and TitleBar icon inheritance.
  • Adds a category-registration test and updates documentation and the generated search index.
File Description
tools/​Reactor.SearchIndex/​editorial.json Adds search metadata for new and expanded examples.
tests/​Reactor.Tests/​Samples/​GalleryDeepLinkTests.cs Checks that every page category is registered.
samples/​ReactorGallery/​reactor-search-index.json Includes regenerated examples and search metadata.
samples/​ReactorGallery/​Program.cs Declares the gallery window icon centrally.
samples/​ReactorGallery/​PageRouter.cs Routes the two new pages.
samples/​ReactorGallery/​GAPS.md Points users to the picker gallery page.
samples/​ReactorGallery/​GalleryShell.cs Adds System navigation and inherits the window icon.
samples/​ReactorGallery/​ControlRegistry.cs Registers new pages and the System category.
samples/​ReactorGallery/​ControlPages/​SystemServices/​FilePickersPage.cs Demonstrates all five picker operations.
samples/​ReactorGallery/​ControlPages/​Patterns/​ErrorBoundaryPage.cs Demonstrates isolated failures, fallbacks, and recovery.
samples/​ReactorGallery/​ControlPages/​Navigation/​TitleBarPage.cs Shows inherited, custom, and suppressed icons.
samples/​ReactorGallery/​ControlPages/​Layout/​GridPage.cs Adds an interactive min/max track-sizing example.
CHANGELOG.md Records the gallery additions.

Review effort: Balanced

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🧪 Merged coverage

Coverage for 954d35e vs the base branch (4f0bf1c) — unit + selftest merged.

Metric base PR Δ
Line 87.24% 87.25% +0.01 pp ≈
Branch 76.69% (977/1274) 76.77% (978/1274) +0.08 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.

- Grid min/max card: darken the green and blue track backgrounds so white
  labels meet 4.5:1 contrast (5.39:1 and 5.30:1).
- Give the width slider an accessible name ("Grid width") in the live card
  and the displayed snippet; regenerate the search index.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f1845cfe-c63e-4596-ad7d-ce1007ea9f93

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.

🟡 Changes recommended

The copyable and exported save-file snippet can let access-denied exceptions escape its async callback and terminate consuming apps.

1 open issue
2 resolved since last review

Review effort: Balanced

- Save-file snippet: also catch UnauthorizedAccessException (a read-only or
  non-writable target), which is not an IOException and would otherwise escape
  the async void handler; regenerate the search index.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f1845cfe-c63e-4596-ad7d-ce1007ea9f93

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 copyable open-file handler leaves file-access exceptions unhandled in an async-void callback, potentially terminating consuming applications.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Handle file-access failures in the copyable open-file handler

samples/​ReactorGallery/​ControlPages/​SystemServices/​FilePickersPage.cs:39

The copyable open-file handler omits the live card's Guard. If the selected file disappears or becomes inaccessible before FileInfo.Length runs, the read can throw IOException or UnauthorizedAccessException. Button accepts an Action, so this lambda is async void: the exception escapes instead of updating the status and can terminate an app using the snippet. Catch these file-access failures as the save snippet does, then regenerate samples/ReactorGallery/reactor-search-index.json so the exported "Pick a file" scenario receives the same protection.

1 resolved since last review

Review effort: Balanced

- Open-file snippet: catch IOException / UnauthorizedAccessException around
  the FileInfo read, matching the save snippet, so a file that vanished or is
  inaccessible cannot escape the async void handler; regenerate the index.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f1845cfe-c63e-4596-ad7d-ce1007ea9f93

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.

🟢 Approval recommended

The sample changes and supporting navigation, search, and test updates are consistent, with no unresolved blocking issues.

No open issues 🎉

Review effort: Balanced

@azchohfi Alexandre Zollinger Chohfi (azchohfi) added ready-for-review Agent work and technical checks complete; awaiting review, not approval or merge and removed agent-preparing Agent is addressing feedback or completing required validation and CI labels Oct 22, 2026
@azchohfi
Alexandre Zollinger Chohfi (azchohfi) merged commit 731911e into main Oct 22, 2026
66 of 70 checks passed
@azchohfi
Alexandre Zollinger Chohfi (azchohfi) deleted the azchohfi-gallery-coverage-audit branch October 22, 2026 16:42
@azchohfi Alexandre Zollinger Chohfi (azchohfi) removed the ready-for-review Agent work and technical checks complete; awaiting review, not approval or merge label Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants