pub fn layout_grid(
model: &WhichKeyModel,
width: usize,
opts: GridOpts,
) -> RenderedGridExpand description
Lay the model out (§6). Pure: no renderer type crosses in, so both the column algorithm and the span placement are unit-testable with no renderer at all.
Returns header, grid rows, then any footer lines — plus the byte ranges of every key. The caller writes the lines into the popup buffer verbatim and hands the spans to the highlight path, so everything-is-a-buffer holds and no new render model reaches either peer.
Returns empty when the model has no rows or the pane is too narrow; the caller suppresses the popup rather than opening an empty box.