Repository navigation
Spec 020: async resources design (AsyncValue + UseResource) - #12
Merged
Merged
Conversation
Proposal for AsyncValue<T> + UseResource / UseInfiniteResource / UseMutation hooks backed by a shared QueryCache. Motivated by the "UI action -> async HTTP -> update UI state" loop that every HTTP-backed component currently re-implements, and by the fact that DataGrid's DataPageCache already proves the pattern works but is trapped inside the grid. Survey of 9 comparable frameworks (TanStack Query, Solid, Paging 3, Riverpod, Elm, Compose, SwiftUI, React, SWR), 14 numbered design decisions, explicit non-fit list, DataGrid migration plan, and a 4-phase implementation roadmap. Open questions deferred. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 of 5 tasks
Chris Anderson (codemonkeychris)
added a commit
that referenced
this pull request
May 22, 2026
Resolves the 22 findings from the docking feature-branch review + two test failures that surfaced while running the full suite. Behavior fixes (Native docking host): - Tear-out / FloatOp: open the floating window BEFORE removing the pane from the docked tree. Layout mutation + OnContentFloated fire only when a real ReactorWindow was produced (review #1 — the previous broad catch around Open turned a failed transition into a success-shaped event). - Drop-overlay global Esc handler now detaches on reconciler unmount in addition to WinUI Unloaded (review #2). - Floating-window observer callbacks, BeforeInsertToolWindow strategy hook, drag-session SessionChanged broadcast, navigator commit callback, and theme/resource lookup catches all surface failures via Debug.WriteLine or narrow to the expected exception type instead of swallowing everything (reviews #3, #4, #5, #7, #8). - Splitter OnPointerCaptureLost now calls RestorePairToGrow() before the final ResizeDelta to converge with the normal release path (review #6). Persistence: - DockLayoutSerializer.Load now routes pre-current-schema documents through DockLayoutMigrationRegistry: parse to JsonNode, detect schema (absent $schema = v1 per §5.4.4), TryUpgrade, then deserialize. Adds a Load(json, registry) overload and emits a PII-safe schema-newer ETW category for forward-tolerant inputs (reviews #9 + #10). - PreviousContainerTracker.ClearAll now actually clears by swapping in a fresh ConditionalWeakTable under a lock (review #11). Surface honesty: - DockHostModel.Floating is populated by the host renderer from a per-manager floating-window tracker; doc comment makes the initial-bounds-only limitation explicit (review #12). - UseDockPanePersisted uses a canonical persisted-key encoder (pane:<typeName>|<keyText>:<userKey> with %/colon/pipe escaping) so two panes whose Key.ToString() collide get independent slots (review #13). - docking.dock detects ambiguous Key.ToString() matches and returns an explicit ambiguous-pane error (review #18). Test isolation: - New DockingGlobalsCollection ([Collection("DockingGlobals")] + DisableParallelization=true) covers DockingStringsTests, DockA11yTests, and DevtoolsDockingToolsTests — three classes that mutate process-global state (review #14). DockA11yTests now restores DockingStrings.Resolver in Dispose. - The known-failing UseEffect cleanup assertion is emitted as TAP "# SKIP" via a new Harness.Skip helper, with a back-flip to a real Check the moment the §2.25 product gap closes (review #15). - EffectCounterComponent moved off static counters; the fixture owns per-run counters and passes mount/cleanup callbacks via props (review #16). - EventListener category assertions in LayoutSerializerTests use a bounded retry helper to tolerate occasional async dispatch (review #17). Documentation: - docs/_pipeline/apps/docking/{api,overview}.md updated for the P2 reality (core Microsoft.UI.Reactor ship vehicle, DockingNativeInterop.Register, deleted vendored WinUI.Dock link) (reviews #19, #22). - DockingStrings.cs + dock-showcase sample comments updated to reflect that no .resw resource ships today; DefaultEnglish + the resolver are the localization surface (review #20). - Reactor.csproj stale "stays on disk for reference" comment about src/Reactor.Docking.Xaml/ replaced with current state (review #21). Tests / fluents: - Added 22 fluent extensions in ElementExtensions.Events.cs for DockManager event callbacks + TabViewElement.OnTabDragStarting / OnTabDragCompleted so PublicApiSurfaceGuardTests passes; the guard test itself is now scoped to public element records only (internal overlay/splitter elements aren't part of the public surface contract). - Two stale Phase-1-wrapper fixture names removed from SelfTestFixtureRegistry.AllFixtures (they had no factory case and surfaced as MSTest "fixture not found" failures). - NativeDocking_PerGroupDropTargetVisualDemo: observer-pause delays cut from 500ms/step to 50ms/step so the 20-step walk stays well inside the 15s fixture timeout under CI load; eliminates the cascading NRE in DragSessionConfirmMutatesLayout that was caused by the timed-out fixture leaving stale host state. - Mutations_OffOwnerThread_Throw uses an explicit new Thread() instead of Task.Run, so the assert can never observe a thread-id match by chance. - Load_MissingSchemaField_FallsBack renamed to Load_MissingSchemaField_TreatedAsV1AndMigrated and rewritten — empty {} now migrates as v1 (matches the integrated registry). Validation: - dotnet test tests/Reactor.Tests -p:Platform=x64 → 8720 passed, 46 skipped, 0 failed - dotnet test tests/Reactor.SelfTests -p:Platform=x64 → 813 passed, 0 failed Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 of 7 tasks
Chris Anderson (codemonkeychris)
added a commit
that referenced
this pull request
May 22, 2026
Resolves the 22 findings from the docking feature-branch review + two test failures that surfaced while running the full suite. Behavior fixes (Native docking host): - Tear-out / FloatOp: open the floating window BEFORE removing the pane from the docked tree. Layout mutation + OnContentFloated fire only when a real ReactorWindow was produced (review #1 — the previous broad catch around Open turned a failed transition into a success-shaped event). - Drop-overlay global Esc handler now detaches on reconciler unmount in addition to WinUI Unloaded (review #2). - Floating-window observer callbacks, BeforeInsertToolWindow strategy hook, drag-session SessionChanged broadcast, navigator commit callback, and theme/resource lookup catches all surface failures via Debug.WriteLine or narrow to the expected exception type instead of swallowing everything (reviews #3, #4, #5, #7, #8). - Splitter OnPointerCaptureLost now calls RestorePairToGrow() before the final ResizeDelta to converge with the normal release path (review #6). Persistence: - DockLayoutSerializer.Load now routes pre-current-schema documents through DockLayoutMigrationRegistry: parse to JsonNode, detect schema (absent $schema = v1 per §5.4.4), TryUpgrade, then deserialize. Adds a Load(json, registry) overload and emits a PII-safe schema-newer ETW category for forward-tolerant inputs (reviews #9 + #10). - PreviousContainerTracker.ClearAll now actually clears by swapping in a fresh ConditionalWeakTable under a lock (review #11). Surface honesty: - DockHostModel.Floating is populated by the host renderer from a per-manager floating-window tracker; doc comment makes the initial-bounds-only limitation explicit (review #12). - UseDockPanePersisted uses a canonical persisted-key encoder (pane:<typeName>|<keyText>:<userKey> with %/colon/pipe escaping) so two panes whose Key.ToString() collide get independent slots (review #13). - docking.dock detects ambiguous Key.ToString() matches and returns an explicit ambiguous-pane error (review #18). Test isolation: - New DockingGlobalsCollection ([Collection("DockingGlobals")] + DisableParallelization=true) covers DockingStringsTests, DockA11yTests, and DevtoolsDockingToolsTests — three classes that mutate process-global state (review #14). DockA11yTests now restores DockingStrings.Resolver in Dispose. - The known-failing UseEffect cleanup assertion is emitted as TAP "# SKIP" via a new Harness.Skip helper, with a back-flip to a real Check the moment the §2.25 product gap closes (review #15). - EffectCounterComponent moved off static counters; the fixture owns per-run counters and passes mount/cleanup callbacks via props (review #16). - EventListener category assertions in LayoutSerializerTests use a bounded retry helper to tolerate occasional async dispatch (review #17). Documentation: - docs/_pipeline/apps/docking/{api,overview}.md updated for the P2 reality (core Microsoft.UI.Reactor ship vehicle, DockingNativeInterop.Register, deleted vendored WinUI.Dock link) (reviews #19, #22). - DockingStrings.cs + dock-showcase sample comments updated to reflect that no .resw resource ships today; DefaultEnglish + the resolver are the localization surface (review #20). - Reactor.csproj stale "stays on disk for reference" comment about src/Reactor.Docking.Xaml/ replaced with current state (review #21). Tests / fluents: - Added 22 fluent extensions in ElementExtensions.Events.cs for DockManager event callbacks + TabViewElement.OnTabDragStarting / OnTabDragCompleted so PublicApiSurfaceGuardTests passes; the guard test itself is now scoped to public element records only (internal overlay/splitter elements aren't part of the public surface contract). - Two stale Phase-1-wrapper fixture names removed from SelfTestFixtureRegistry.AllFixtures (they had no factory case and surfaced as MSTest "fixture not found" failures). - NativeDocking_PerGroupDropTargetVisualDemo: observer-pause delays cut from 500ms/step to 50ms/step so the 20-step walk stays well inside the 15s fixture timeout under CI load; eliminates the cascading NRE in DragSessionConfirmMutatesLayout that was caused by the timed-out fixture leaving stale host state. - Mutations_OffOwnerThread_Throw uses an explicit new Thread() instead of Task.Run, so the assert can never observe a thread-id match by chance. - Load_MissingSchemaField_FallsBack renamed to Load_MissingSchemaField_TreatedAsV1AndMigrated and rewritten — empty {} now migrates as v1 (matches the integrated registry). Validation: - dotnet test tests/Reactor.Tests -p:Platform=x64 → 8720 passed, 46 skipped, 0 failed - dotnet test tests/Reactor.SelfTests -p:Platform=x64 → 813 passed, 0 failed Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Chris Anderson (codemonkeychris)
added a commit
that referenced
this pull request
May 23, 2026
Resolves the 22 findings from the docking feature-branch review + two test failures that surfaced while running the full suite. Behavior fixes (Native docking host): - Tear-out / FloatOp: open the floating window BEFORE removing the pane from the docked tree. Layout mutation + OnContentFloated fire only when a real ReactorWindow was produced (review #1 — the previous broad catch around Open turned a failed transition into a success-shaped event). - Drop-overlay global Esc handler now detaches on reconciler unmount in addition to WinUI Unloaded (review #2). - Floating-window observer callbacks, BeforeInsertToolWindow strategy hook, drag-session SessionChanged broadcast, navigator commit callback, and theme/resource lookup catches all surface failures via Debug.WriteLine or narrow to the expected exception type instead of swallowing everything (reviews #3, #4, #5, #7, #8). - Splitter OnPointerCaptureLost now calls RestorePairToGrow() before the final ResizeDelta to converge with the normal release path (review #6). Persistence: - DockLayoutSerializer.Load now routes pre-current-schema documents through DockLayoutMigrationRegistry: parse to JsonNode, detect schema (absent $schema = v1 per §5.4.4), TryUpgrade, then deserialize. Adds a Load(json, registry) overload and emits a PII-safe schema-newer ETW category for forward-tolerant inputs (reviews #9 + #10). - PreviousContainerTracker.ClearAll now actually clears by swapping in a fresh ConditionalWeakTable under a lock (review #11). Surface honesty: - DockHostModel.Floating is populated by the host renderer from a per-manager floating-window tracker; doc comment makes the initial-bounds-only limitation explicit (review #12). - UseDockPanePersisted uses a canonical persisted-key encoder (pane:<typeName>|<keyText>:<userKey> with %/colon/pipe escaping) so two panes whose Key.ToString() collide get independent slots (review #13). - docking.dock detects ambiguous Key.ToString() matches and returns an explicit ambiguous-pane error (review #18). Test isolation: - New DockingGlobalsCollection ([Collection("DockingGlobals")] + DisableParallelization=true) covers DockingStringsTests, DockA11yTests, and DevtoolsDockingToolsTests — three classes that mutate process-global state (review #14). DockA11yTests now restores DockingStrings.Resolver in Dispose. - The known-failing UseEffect cleanup assertion is emitted as TAP "# SKIP" via a new Harness.Skip helper, with a back-flip to a real Check the moment the §2.25 product gap closes (review #15). - EffectCounterComponent moved off static counters; the fixture owns per-run counters and passes mount/cleanup callbacks via props (review #16). - EventListener category assertions in LayoutSerializerTests use a bounded retry helper to tolerate occasional async dispatch (review #17). Documentation: - docs/_pipeline/apps/docking/{api,overview}.md updated for the P2 reality (core Microsoft.UI.Reactor ship vehicle, DockingNativeInterop.Register, deleted vendored WinUI.Dock link) (reviews #19, #22). - DockingStrings.cs + dock-showcase sample comments updated to reflect that no .resw resource ships today; DefaultEnglish + the resolver are the localization surface (review #20). - Reactor.csproj stale "stays on disk for reference" comment about src/Reactor.Docking.Xaml/ replaced with current state (review #21). Tests / fluents: - Added 22 fluent extensions in ElementExtensions.Events.cs for DockManager event callbacks + TabViewElement.OnTabDragStarting / OnTabDragCompleted so PublicApiSurfaceGuardTests passes; the guard test itself is now scoped to public element records only (internal overlay/splitter elements aren't part of the public surface contract). - Two stale Phase-1-wrapper fixture names removed from SelfTestFixtureRegistry.AllFixtures (they had no factory case and surfaced as MSTest "fixture not found" failures). - NativeDocking_PerGroupDropTargetVisualDemo: observer-pause delays cut from 500ms/step to 50ms/step so the 20-step walk stays well inside the 15s fixture timeout under CI load; eliminates the cascading NRE in DragSessionConfirmMutatesLayout that was caused by the timed-out fixture leaving stale host state. - Mutations_OffOwnerThread_Throw uses an explicit new Thread() instead of Task.Run, so the assert can never observe a thread-id match by chance. - Load_MissingSchemaField_FallsBack renamed to Load_MissingSchemaField_TreatedAsV1AndMigrated and rewritten — empty {} now migrates as v1 (matches the integrated registry). Validation: - dotnet test tests/Reactor.Tests -p:Platform=x64 → 8720 passed, 46 skipped, 0 failed - dotnet test tests/Reactor.SelfTests -p:Platform=x64 → 813 passed, 0 failed Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
docs/spec/020-async-resources-design.mdproposing a generic async-state primitive for Reactor:AsyncValue<T>sealed ADT +UseResource/UseInfiniteResource/UseMutationhooks backed by a sharedQueryCache.DataPageCachealready proves the pattern works but can't be reused byLazyVStack,TreeView, or anything else.IDataSource<T>contract stays identical;DataPageCacheis lifted behindUseInfiniteResource; async-commit lifecycle generalizes intoUseMutation.What's in the spec
createResource, Android Paging 3, RiverpodAsyncValue, ElmRemoteData, ComposeproduceState, SwiftUI.task, React Suspense, SWR) — we converge on resource + ADT + shared cache and skip Suspense (C# + non-fiber reconciler makes throw-a-Task a bad fit).Open questions are documented in §15 and will be addressed in follow-up work — this PR lands the design doc for review, not the implementation.
Test plan
Loading | Data | Error | Reloading) is the right default vs. collapsingReloadingintoData.IDataSource<T>stays untouched — no breaking changes to spec 017.