diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-24 19:20:39 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-24 19:24:34 -0300 |
| commit | 326a2bac9558da0ff78987e697546a363b2b8e59 (patch) | |
| tree | 0591f7bc71544a438d7267ff2d8f4274403dd65f /core/views.zig | |
| parent | b7d275ab179635f1bf69bdb50833303c6942ff47 (diff) | |
| download | pardes-326a2bac9558da0ff78987e697546a363b2b8e59.tar.gz pardes-326a2bac9558da0ff78987e697546a363b2b8e59.zip | |
Band: the rows a tag unrolls into (walk UI, pick-ui SPEC.md §3.6 and §14.1's "rows under a tag", item 3 of line A): a per-pane band between a tag's text and its body, in the tag's tint, derived from the live view's state each time it is asked and never stored (the coordinator's R2, R4); its height is a layout term beside the tag's text rows (Pane.band_rows, each view's, out of the digest and the dump as notices are: Pardes.sync puts the band's rows under the text's and counts them in tag_rows, so the body below, its rail, its regions, the pty, the pointer's rows and every geometry that counts from tag_rows are pushed down unchanged; only the tag's own text rows, joinPaneTag and paintPaneTag, take tag_rows - band_rows); a body that would drop under four rows borrows them from the column's other panes, which shrink to their tags until it rolls up (layout.floorRows, the floor keepTerminalFloors already raises); painted as a tag layer of a new kind, `band` (Layer.Kind, BAND_LAYER_BASE: a layer a pane after the notices', wire 36's line), the grid a copy of it (draw.zig joinBand); spines (│) under the head's key cells when they are on the tag's last row, the steps right of them side by side with a one-cell rule between, a level of more than nine rows in two columns, the cursor's row `▶` and tinted as a selection, keys in the key ink, an LSP leaf dimmed, the leaf its group ran last underlined; narrow, the doc step gives way first, then the spines (the steps from the band's left edge); the other panes dim while a pane is out of rest (style.dim on their cells and layers), but a pane flagged as previewing (TagState.previewing, a bit a slot, for the states that preview: pickers, actions, themes); read-only text (R2): a select click puts the cursor on the row, an execute click runs the word under it and a look click looks at it, the tag back at rest first (mouse.zig bandPoint, bandPress: the grid's rows and a window's `band` hits alike); THE API (for the pickers, prompts and registers): Band.Row {text, on, key, dim, under, marks, index}, Band.Step {rows, two, doc; x and width placed}; a new step kind is a function filling a Step from the state that owns it (in the frame's arena, only the rows it shows), added in Band.of for its tag state, with that state's rows in Band.takes; Band.line(y) is a row's text and where each step's row starts (the painter's and the mouse's one source); levelStep and docStep are the which-key's; TagState.toRest leaves every state, TagState.point puts the cursor on a clicked row; TESTS: Band.zig's three (SPC Down unrolls into the band, the body pushed down and never drawn over, the grid's copy, Up on the first row rolls up, Right/Left through a group; borrowing from the column, the other pane dimmed, the band's own not; B2 on a band word runs it, the tag at rest); root.zig's kept_out names band_rows; core-test 1000 pass, 166 skip, 0 fail
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'core/views.zig')
| -rw-r--r-- | core/views.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/views.zig b/core/views.zig index e5f2038e..b05a116b 100644 --- a/core/views.zig +++ b/core/views.zig @@ -41,7 +41,7 @@ pub const away_kept_ns: u64 = 30 * std.time.ns_per_s; /// layout, which of its texts has the keyboard, how far it is scrolled (a /// terminal's history too), and what the view's step measured of it (its /// tag's rows, its bands). -const pane_fields = [_][:0]const u8{ "focus", "vweight", "collapsed", "docked_to", "hscroll", "tag_scroll", "tag_top", "tag_rows", "view", "layers", "notices", "pan", "follow_scroll", "scrolled_to" }; +const pane_fields = [_][:0]const u8{ "focus", "vweight", "collapsed", "docked_to", "hscroll", "tag_scroll", "tag_top", "tag_rows", "band_rows", "view", "layers", "notices", "pan", "follow_scroll", "scrolled_to" }; /// The body's: its cursor, selections and mode. Its undo stays the pane's. const body_fields = [_][:0]const u8{ "mode", "cur_pinned", "cur_row", "cur_col", "vsel", "sels", "nsel", "select", "sticky_col", "restore_cursor", "last_edit", "reg_wait", "normal", "find_op", "find_ch" }; @@ -56,6 +56,7 @@ pub const PaneView = struct { tag_scroll: u16 = 0, tag_top: u16 = 0, tag_rows: u16 = 1, + band_rows: u16 = 0, view: Pane.SessionView = .{}, layers: File.Layers = .{}, notices: Pane.Notices = .{}, @@ -73,7 +74,7 @@ pub const PaneView = struct { /// In a dump (`Shares`): what a pane's step works out again. Its `view` /// is dumped: the step after `unpark` reads it before it syncs. - pub const replica = .{ .derived = .{ "notices", "pan" } }; + pub const replica = .{ .derived = .{ "notices", "pan", "band_rows" } }; }; /// The panes' shares of a view not live, as a session's dump keeps them |
