Skip to content

windows-reactor casts and cleanup - #4856

Merged
Kenny Kerr (kennykerr) merged 5 commits into
masterfrom
reactor-less
Aug 29, 2026
Merged

windows-reactor casts and cleanup#4856
Kenny Kerr (kennykerr) merged 5 commits into
masterfrom
reactor-less

Conversation

@kennykerr

Copy link
Copy Markdown
Collaborator

This cleans up a lot of windows-reactor internals without changing how it behaves: redundant COM casts are gone, test support is collected in dedicated modules, scheduler, effect, window request, and event state now use clearer representations instead of related flags and optional fields, repeated component finalization logic is shared, and tree nodes now store only the data that belongs to their specific kind. The result is less repetitive, harder to put into an invalid state, and a bit smaller, while keeping the existing public API and lifecycle behavior intact.

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.

Pull request overview

Refactors windows-reactor internals (and the tool_reactor generator) to reduce redundant COM casts, tighten state representations, and centralize repeated logic, while keeping the public API/lifecycle behavior stable and improving test organization/coverage.

Changes:

  • Updates tool_reactor event schema/generation to carry event payload getter properties in EventPayloadSource and reduce generated COM casts.
  • Refactors core runtime structures (tree node storage, scheduler phase, component-candidate finalization) to reduce invalid intermediate states and duplication.
  • Moves/coalesces test support and unit tests into dedicated modules and adds an integration test for the public surface.

Reviewed changes

Copilot reviewed 57 out of 57 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/tools/reactor/src/schema.rs Moves event getter property into EventPayloadSource; updates validation/tests accordingly.
crates/tools/reactor/src/generate_winui.rs Removes redundant casts in generated code; centralizes default-interface handling; updates selection/event generation.
crates/tests/libs/reactor/tests/public_surface.rs New integration test asserting public builder/view composition and window visuals API visibility.
crates/tests/libs/reactor/src/lib.rs Removes in-crate test module now covered by integration test file.
crates/libs/reactor/src/test_support/recording.rs Adjusts imports and moves embedded tests into a separate module file.
crates/libs/reactor/src/test_support/recording_tests.rs New extracted unit tests for RecordingRuntime.
crates/libs/reactor/src/test_support.rs Reorganizes test-support exports and module structure.
crates/libs/reactor/src/reference.rs Replaces window request flag set with lifecycle + active-request struct for clearer invariants.
crates/libs/reactor/src/native/winui/tests.rs New extracted WinUI backend unit tests.
crates/libs/reactor/src/native/winui/mod.rs Removes redundant casts; reworks tooltip/flyout setting and caches window handle lookup.
crates/libs/reactor/src/native/winui/element_factory.rs Removes redundant casts when configuring repeater and setting realized content.
crates/libs/reactor/src/native/mod.rs Stops exporting recording runtime from native; keeps WinUI backend export.
crates/libs/reactor/src/lib.rs Makes test support available in cfg(test) and aligns gating with feature = "test".
crates/libs/reactor/src/core/scheduler.rs Encodes scheduled ticket in the scheduler phase instead of a parallel optional field.
crates/libs/reactor/src/core/pump/tests/window_visuals.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/window_titles.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/window_title_bars.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/window_requests.rs Drops crate::native::* import; adds assertion after shutdown for close commitment.
crates/libs/reactor/src/core/pump/tests/window_observations.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/visual_properties.rs Switches to crate::test_support::RecordingRuntime.
crates/libs/reactor/src/core/pump/tests/virtualization_realization.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/tree_views.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/tooltips.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/support.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/slots.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/scrolling_properties.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/rich_text.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/resource_overrides.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/properties_native_failure.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/pointer_events.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/mount_update_publication.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/model_reconciliation.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/menus.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/lifecycle_effects.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/keyed_fragments.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/imperative_references.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/image_properties.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/hyperlink_button_properties.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/grid_properties.rs Switches to crate::test_support::RecordingRuntime.
crates/libs/reactor/src/core/pump/tests/flyouts.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/failure_policy.rs Switches to crate::test_support::RecordingRuntime.
crates/libs/reactor/src/core/pump/tests/exit_retirement.rs Switches to crate::test_support::RecordingRuntime.
crates/libs/reactor/src/core/pump/tests/events_controlled_feedback.rs Narrows crate::native::* import to specific items used.
crates/libs/reactor/src/core/pump/tests/context_propagation.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/content_dialogs.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/components_turn_ordering.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/breadcrumb_bar_properties.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/tests/background_tasks.rs Drops crate::native::* import (tests now get support via core prelude).
crates/libs/reactor/src/core/pump/plan.rs Introduces ComponentCandidate to share candidate finalization inputs.
crates/libs/reactor/src/core/pump/native_work.rs Routes realization candidate finalization through shared helper.
crates/libs/reactor/src/core/pump/mod.rs Centralizes repeated component-candidate finalization logic into finalize_component_candidate.
crates/libs/reactor/src/core/engine.rs Refactors node storage into NodeData by kind; tightens insertion/update invariants; extracts tests.
crates/libs/reactor/src/core/engine_tests.rs New extracted tests for tree/engine behavior and size/layout assertions.
crates/libs/reactor/src/core/component.rs Replaces effect pending/flags with enum-based registration state; extracts tests.
crates/libs/reactor/src/core/component_tests.rs New extracted tests for component store/effects/background tasks.
crates/libs/reactor/src/core/arena.rs Adds Arena::next_id and corresponding unit test.
Suppressed comments (1)

crates/libs/reactor/src/test_support/recording.rs:4

  • use crate::*; in this module can glob-import RecordingRuntime back into the same namespace via the crate-root re-exports (#[cfg(test)] pub(crate) use test_support::*; / #[cfg(feature = "test")] pub use test_support::*;). Since this file defines RecordingRuntime, that risks an E0255 duplicate-name error (or cyclic glob-resolution) in cfg(test)/--features test builds. Prefer importing only the specific items needed from submodules (e.g. crate::generated::*, crate::element::*, crate::reference::*, etc.) rather than the crate root.

💡 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 1be5649 into master Aug 29, 2026
37 checks passed
@kennykerr
Kenny Kerr (kennykerr) deleted the reactor-less branch August 29, 2026 14:26
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