Repository navigation
Add reusable item virtualization and recycling foundation - #201
Merged
Merged
Conversation
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
Add the shared virtualization foundation needed before #55 control integration and #13 collection controls. Indexed layouts plan a viewport/cache range without enumerating logical values; the typed generator realizes that range and recycles containers with explicit ownership. Parent #55 remains open for #200.
Architecture
VirtualizingLayoutextends the existingLayoutEnginethroughIVirtualizingLayoutHost. Vertical/horizontal stack and fixed-cell wrap geometry use logical pixels. A measured prefix tree supports variable stack extents and unrealized-item offsets.ItemIndexChangemaps occurrences through indexed source mutations, keeping equal values distinct.Public API
Ten additive types in
ModernFormsNext.Virtualization: range/context, layout/host contracts, stack/wrap strategies, metrics, occurrence mapping, and generic generator/factory. Existing APIs are preserved. XML documentation anddocs/virtualization.mdexplain usage, limits and ownership. SDK ApiCompat against exact starting master passes for Debug/Release and both core TFMs, with parameter-name/attribute rules, no suppressions, and fully resolved references.Lifecycle/threading
Use the host owning thread and existing Control/dispatcher/focus/binding checks. The generator borrows its factory/source, coalesces reentrant range requests, queues mutations in order, and prevents older callbacks from overwriting newer state. Callback disposal is deferred until callback return; fault cleanup attempts every owned container and propagates errors. No finalizer or separate dispatcher is introduced.
Platform behavior
The implementation is shared and introduces no platform-native types. Geometry uses finite logical coordinates; overflowing extents/far edges throw. No backend changes, new dependencies, package version changes or publication.
Designer
These strategy/metadata constructors start no native host. Control property persistence, bounded previews and code-generation acceptance remain required by #200.
Tests
Native validation
Existing Windows native suites run in full validation. This child establishes engine behavior; rendered virtualization, selection/focus/accessibility, Android emulator/physical-device and Designer control integration are required by #200. No new virtualized UI/native performance claim is made here.
Known limitations
Fixed-cell wrap explicitly rejects variable metrics. Metrics retain numeric metadata proportional to logical count; reset is O(count). Hosts own scroll anchors, logical selection/focus and existing integer-scrollbar limits. Async/infinite-source contracts are not implemented.
Two original Debug native failures are preserved in local evidence: a Designer host WS_VISIBLE assertion and modal owner-input release. Neither was reproduced in ten predetermined alternating exact-base/feature trials for each test. The append-only PID log permits an old FORM_SHOWN marker to satisfy the Designer wait; this synchronization hazard is documented as unresolved. No assertions, timeouts, native flags or thresholds were changed. Successful subsequent checks do not mean these failures were fixed.
Issue linking
Fixes #199.
Part of #55. Integration continues in #200 after this PR merges; #55 remains open.