Skip to content

windows-reactor uniform typed constraints - #4971

Merged
Kenny Kerr (kennykerr) merged 1 commit into
masterfrom
reactor-uniform-types
Sep 19, 2026
Merged

Kenny Kerr (kennykerr) merged 1 commit into
masterfrom
reactor-uniform-types

Conversation

@kennykerr

@kennykerr Kenny Kerr (kennykerr) commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

This builds on #4970's compile-time validation for icon views by applying the same idea to WinUI collections with narrow item contracts. Reactor now derives accepted controls from metadata and generates typed keyed collection APIs for SelectorBar, MenuBar, and CommandBar, so incompatible views fail to compile instead of reaching native insertion and aborting with E_NOINTERFACE; typed attachments preserve the control type through menus, tooltips, and flyouts without adding runtime checks or manual allowlists.

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.

Copilot review overview

🟢 Approval recommended

The metadata inference, generated APIs, attachment typing, samples, and coverage are internally consistent.

Review effort: Balanced
Findings: None

What changed in this PR

Adds metadata-derived compile-time constraints for narrow WinUI collections while preserving control types through attachments.

Changes:

  • Generates typed Keyed<T> collection APIs.
  • Adds AttachedView<T> for typed attachments.
  • Updates generated surfaces, tests, samples, docs, and API snapshots.
File Description
docs/​crates/​windows-reactor.md Documents typed collections.
crates/​tools/​reactor/​src/​winui.toml Removes manual command allowlists.
crates/​tools/​reactor/​src/​schema.rs Infers accepted controls.
crates/​tools/​reactor/​src/​metadata.rs Resolves type assignability.
crates/​tools/​reactor/​src/​generate.rs Generates typed wrappers and methods.
crates/​tools/​reactor/​src/​generate_surface.rs Generates typed surface coverage.
crates/​tests/​libs/​reactor_surface/​src/​generated_surface.rs Updates generated surface cases.
crates/​samples/​reactor/​gallery/​src/​pages/​menus/​selector_bar.rs Uses typed keys.
crates/​samples/​reactor/​gallery/​src/​pages/​menus/​menu_bar.rs Uses typed menu items.
crates/​samples/​reactor/​app-bar-icon/​src/​main.rs Demonstrates heterogeneous commands.
crates/​libs/​reactor/​src/​generated.rs Adds generated typed collection APIs.
crates/​libs/​reactor/​src/​element.rs Adds generic keys and typed attachments.
crates/​libs/​reactor/​src/​core/​pump/​tests/​tooltips.rs Adapts tooltip tests.
crates/​libs/​reactor/​src/​core/​pump/​tests/​slots.rs Adapts typed slot tests.
crates/​libs/​reactor/​src/​core/​pump/​tests/​menus.rs Adapts menu attachment tests.
crates/​libs/​reactor/​src/​core/​pump/​tests/​flyouts.rs Adapts flyout tests.
crates/​libs/​reactor/​src/​core/​pump/​tests/​content_dialogs.rs Adapts overlay test.
crates/​libs/​reactor/​public-api.txt Records the new public surface.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@kennykerr
Kenny Kerr (kennykerr) merged commit a38689a into master Sep 19, 2026
38 checks passed
@kennykerr
Kenny Kerr (kennykerr) deleted the reactor-uniform-types branch September 19, 2026 02:54
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.

3 participants