Rearchitecting the navigation stack to support asynchronous loading at every level.
This is a long-term architectural direction, not expected to happen soon. The current synchronous navigation model works well for the common case and is significantly simpler to reason about. This page captures the motivation and tradeoffs for future reference.
STRVCT's navigation stack is currently synchronous. When a user drills into a node, its subnodes are expected to be available immediately in memory -- the tile container reads the subnode array, creates tiles, and displays them in the same frame. This synchronous guarantee makes the navigation code straightforward: there are no loading states, no cancellation of in-flight requests, no partial renders, and no race conditions between navigation events.
However, this model assumes all data is local. As the framework is used with cloud-backed data, server-side collections, or very large hierarchies, the assumption that subnodes are always available breaks down. Async navigation would allow any level of the hierarchy to load its children on demand -- from a remote API, a lazy database query, or any other asynchronous source.
The synchronous contract runs deep through the navigation stack:
SvStackView assumes column content is ready when a navigation event fires.SvNavView assumes it can read a node's subnodes and build tiles immediately.SvTilesView assumes the subnode array is complete and in memory.An async-capable navigation stack would need to handle the possibility that any of these steps returns a promise rather than a value. This means:
The synchronous model is fast precisely because it avoids async overhead. Making navigation async introduces significant performance costs even when data is local:
await yields to the microtask queue, adding latency between navigation steps. A drill-in that currently takes one synchronous frame would span multiple frames even if all data is cached, creating visible delay or flicker.These tradeoffs are the primary reason this is a long-term direction rather than an immediate goal. The current synchronous model is the right default for most applications -- the performance cost of async navigation is only worth paying when the data genuinely can't be local.
Several other Future Work items intersect with async navigation:
If lazy slots and promise-wrapped slots are implemented first, they may provide the async primitives that async navigation builds on -- the slot system handles the data loading, and the navigation stack handles the display timing.