Expand description
Mode-keyed pane render resolution (renderer-agnostic algorithm).
Phase 5.6: the algorithm that walks a buffer’s active modes
(minors most-recently-activated first, then the major) lives
host-side here; the per-renderer storage of provider fn-pointers
stays renderer-specific (TUI uses ratatui::Frame-typed fns; a
future GPUI renderer will use its own native shapes). Renderers
implement ProviderLookup over their own registry and call
resolve_pane_render_mode to find the ModeId whose provider
should drive a pane.
See docs/dev/architecture/phase-5-extraction.md “Hard Case §2”
→ “Post-Option-E revision (slice 5.6)”. The trait-object plan
from the original draft is superseded — composition made the
registry naturally renderer-specific, so the only shared piece
is the mode-walking lookup.
Traits§
- Provider
Lookup - Renderer-supplied “is this mode registered?” probe. Each renderer
implements this trait on its own typed pane-render registry; the
host walks modes via
resolve_pane_render_modeand asks the probe whether the candidateModeIdhas a provider.
Functions§
- resolve_
pane_ render_ mode - Resolve the
ModeIdwhose pane-render provider should drive the pane displayingbuffer_id. Walks active minors in reverse activation order (most-recently activated wins — same priority the option resolver uses) before falling back to the major. ReturnsNonewhen no active mode has a provider registered, in which case the renderer uses its default document path.