windows-reactor improvements - #4782
Open
kennykerr wants to merge 3 commits into
Open
Conversation
Address keyed list identity, typed resources, pointer input, responsive navigation, icon elements, lifecycle transitions, and tab item identity. Copilot-Session: 49930c97-f37c-46b7-b60e-fb4b9d1b5320
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves windows-reactor reconciliation correctness and WinUI integration by fixing keyed list identity handling, adding typed resource overrides, expanding pointer input support (including capture), making NavigationView state callbacks reflect actual dependency property values, broadening icon element support, and implementing enter/exit lifecycle transitions via WinUI Composition implicit animations.
Changes:
- Preserve realized controls during equal-length keyed templated-list reorders (state follows keys; positional fallback for missing/duplicate keys).
- Add typed element resource overrides (tracked key ownership + correct removal) and expand pointer/navigation/tab identity behaviors.
- Implement lifecycle enter/exit transitions using implicit show/hide composition animations (including animation groups for combined opacity + scale).
Reviewed changes
Copilot reviewed 46 out of 46 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/crates/windows-reactor.md | Documents new reactor behaviors: keyed reorder identity, typed resources, pointer capture/window coords, navigation state callbacks, icon kinds, and lifecycle transitions. |
| docs/crates/windows-composition.md | Updates composition docs to mention animation groups and their use for combined implicit animations. |
| crates/tools/reactor/src/test.txt | Adds WinUI members needed by new icon/navigation/pointer behaviors to the reactor tool test surface list. |
| crates/tools/reactor/src/base.txt | Extends the reactor base binding set for BitmapIcon/PathIcon, pointer capture events, ElementCompositionPreview implicit animations, and NavigationView DP observation. |
| crates/tools/composition/src/composition.txt | Adds CompositionAnimationGroup and CreateAnimationGroup/Add to composition tool inputs. |
| crates/tests/libs/reactor/tests/templated_list.rs | Adds coverage for keyed reorder behavior (move realized controls, boundary behavior, duplicate-key fallback). |
| crates/tests/libs/reactor/tests/templated_list_mutate.rs | Adds perf/behavior coverage ensuring key comparison work stays proportional to realized rows. |
| crates/tests/libs/reactor/tests/resources.rs | Adds unit tests for typed heterogeneous resource overrides and correct clearing semantics. |
| crates/tests/libs/reactor/tests/pointer_handlers.rs | Extends handler bundle tests for capture lost/canceled and capture-on-press configuration; validates new pointer fields. |
| crates/tests/libs/reactor/tests/icon_bindings.rs | Updates icon tests for BitmapIcon rendering mode and adds PathIcon data coverage. |
| crates/tests/libs/reactor/tests/controls_shell.rs | Adds structural tests for tab key clearing and navigation state callbacks. |
| crates/tests/libs/reactor/tests/animation.rs | Updates animation tests to validate lifecycle transition registration/clearing and precedence vs property animations. |
| crates/tests/libs/reactor/src/lib.rs | Extends RecordingBackend with SetElementTransitions op and a navigation display-mode event injector for tests. |
| crates/tests/libs/reactor_selftest/src/registry.rs | Registers new selftest fixtures for typed resources, tab key clearing, navigation callbacks, keyed list state, icon subclasses, and exit transitions. |
| crates/tests/libs/reactor_selftest/src/fixtures/pointer_input.rs | Updates pointer injection fixture to validate window-relative coords and pointer capture behavior. |
| crates/tests/libs/reactor_selftest/src/fixtures/interactions.rs | Expands icon interaction fixture to validate native icon subclasses and adds an exit-transition interaction fixture. |
| crates/tests/libs/reactor_selftest/src/fixtures/controls.rs | Adds selftest fixtures validating resource override ownership/clearing, tab tag clearing, navigation DP-observed callbacks, and keyed list state behavior. |
| crates/tests/libs/reactor_selftest/src/bindings.rs | Regenerates selftest WinUI bindings needed for new pointer capture, DP observation, and icon support. |
| crates/tests/libs/composition/src/live.rs | Adds a live test asserting animation groups accept multiple animations. |
| crates/samples/reactor/samples/examples/tab_view_item_key.rs | Adds a sample demonstrating TabItem::with_key identity and correct clearing on key removal. |
| crates/samples/reactor/samples/examples/responsive_navigation.rs | Adds a sample demonstrating pane-open and display-mode callbacks driven by real DP state. |
| crates/samples/reactor/samples/examples/pointer_resize.rs | Adds a sample demonstrating stable window-relative drag deltas plus pointer capture for resize handles. |
| crates/samples/reactor/samples/examples/lightweight_resources.rs | Adds a sample demonstrating typed lightweight resource overrides and clearing. |
| crates/samples/reactor/samples/examples/keyed_list_reorder.rs | Adds a sample demonstrating keyed reorder preserving per-row component state. |
| crates/samples/reactor/samples/examples/icon_elements.rs | Extends icon sample to cover BitmapIcon and PathIcon in addition to existing icon kinds. |
| crates/samples/reactor/samples/examples/exit_transition.rs | Adds a sample demonstrating exit transitions where the logical subtree is removed immediately but the visual persists during the hide animation. |
| crates/libs/reactor/src/widgets/tab_view.rs | Documents TabItem::with_key as the stable identity for close requests. |
| crates/libs/reactor/src/widgets/navigation_view.rs | Adds on_pane_open_changed and on_display_mode_changed widget event bindings. |
| crates/libs/reactor/src/widgets/icon.rs | Expands Icon to include Bitmap and Path variants and adds constructors (notably bitmap_icon and path). |
| crates/libs/reactor/src/style.rs | Introduces typed resource values (ResourceValue, ResourceBuilder, CornerRadius) and extends pointer handler configuration/state. |
| crates/libs/reactor/src/reconciler/widget_dispatch.rs | Fixes TabView item key updates to clear native identity when the optional key is removed. |
| crates/libs/reactor/src/reconciler/templated.rs | Implements keyed realized-row remapping for equal-length reorders and refines update-skipping behavior. |
| crates/libs/reactor/src/reconciler.rs | Wires lifecycle transitions into reconciliation; ensures resource updates can clear stale keys; adds transition diffing on updates. |
| crates/libs/reactor/src/lib.rs | Re-exports NavigationViewDisplayMode. |
| crates/libs/reactor/src/element.rs | Adds pointer capture configuration/callbacks and introduces resource_overrides plus typed resources. |
| crates/libs/reactor/src/bindings.rs | Regenerates reactor WinUI bindings to support new DP observation, pointer capture, and icon types. |
| crates/libs/reactor/src/backend/winui/mod.rs | Implements DP observers for navigation state callbacks, typed resource ownership/removal, pointer capture lifecycle, and element lifecycle transitions via implicit animations. |
| crates/libs/reactor/src/backend/winui/convert.rs | Adds BitmapIcon and PathIcon construction (with attribute escaping + regression test). |
| crates/libs/reactor/src/backend/mod.rs | Updates PropValue::Resources to typed values; adds navigation display-mode event handler support; adds backend hook for element transitions. |
| crates/libs/reactor/readme.md | Updates crate readme with new typed resources, pointer window coords/capture, navigation callbacks, lifecycle transitions, tab identity, and expanded icon examples. |
| crates/libs/composition/src/lib.rs | Re-exports CompositionAnimationGroup. |
| crates/libs/composition/src/compositor.rs | Adds create_animation_group helper. |
| crates/libs/composition/src/bindings.rs | Regenerates composition bindings to include animation groups and compositor creation APIs. |
| crates/libs/composition/src/bindings_lifted.rs | Regenerates lifted bindings to include animation groups for WinUI hosting scenarios. |
| crates/libs/composition/src/animation.rs | Adds CompositionAnimationGroup wrapper with add and (reactor) as_host. |
| crates/libs/composition/readme.md | Documents animation groups as a core capability. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #4778 - preserves realized controls and row-local state during keyed
TemplatedListreorders.Fixes #4776 - adds typed lightweight resource overrides with correct ownership, replacement, and removal.
Fixes #4772 - adds window-relative pointer coordinates, pointer capture, and capture-loss/cancellation callbacks.
Fixes #4771 - adds
NavigationViewpane-open and actual display-mode change callbacks.Fixes #4720 - adds native
BitmapIconandPathIconsupport while retaining full-colorImageIconsupport.Also fixes lifecycle exit transitions and clears stale native
TabViewItemidentity when an item key is removed.