diff options
| author | user <user@clank> | 2026-08-13 20:54:29 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-13 20:54:29 +0200 |
| commit | e220bb7cb784140ba5c9cc1fe59b71fdb9dbf4b9 (patch) | |
| tree | 2550d9edb930010b1766e697b839161188745910 /docs | |
| parent | test: run the status bar's tests in `make test` (diff) | |
| download | sl0ppi-e220bb7cb784140ba5c9cc1fe59b71fdb9dbf4b9.tar.gz sl0ppi-e220bb7cb784140ba5c9cc1fe59b71fdb9dbf4b9.tar.xz sl0ppi-e220bb7cb784140ba5c9cc1fe59b71fdb9dbf4b9.zip | |
sl0p(bar): draw the bar as a framed box, and a single line when collapsed
Given three rows the bar now draws the same rounded box the panes do, so the
bottom of the screen reads as one more pane instead of a strip of text under
them. Given one row it stays the line it always was, which is what a terminal
narrow enough to collapse the layout should spend on chrome.
The height is the LAYOUT's decision, because a plugin cannot resize its own
pane:
- default.kdl defines the bar as a pane_template `sl0pbar` and places it at
size=3;
- default.swap.kdl defines tab_template "mobile" placing the same template at
size=1, and the `stacked` swap layout -- what responsive_layout collapses to
below responsive_min_cols -- uses it.
That reuse works because zellij parses a layout and its .swap.kdl with the same
parser, on purpose, "so that we can reuse assets (eg. pane and tab templates)".
Otherwise the collapsed template would have to duplicate the whole 100-line
zjstatus configuration, and the two would drift within a week.
ModuleConfig::viewport is the one definition of where the content line lives:
three rows or more and it is framed, fewer and it is not, plus the column the
content starts at. Rendering and click routing both read it, so the frame moves
the drawing and the hit-testing together -- a click on the new border hits
nothing rather than the widget it sits above. Clicks now check the LINE too,
which a single-line bar never had to.
status-bar-live.py grew the other half of the feature: the borders must span
exactly the columns the pane frames span with rounded corners at their ends, a
click on the border must not make a tab, and after shrinking the terminal below
the responsive threshold the bar must be one line with no box -- with its button
still working. The collapse is real: the bar lands on the last row, which only
happens if the swap layout actually switched.
One test bug worth naming: locating the button with str::find gave a BYTE
offset, and the box glyphs are three bytes each, so the click landed two columns
right of the thing it found. Same trap the pane frame tests document.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/roadmap.md | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/docs/roadmap.md b/docs/roadmap.md index 3588e95..4f7cfb6 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -328,12 +328,38 @@ That check tracks painted cells, not ink: a bar segment starts with a padding space inside its coloured pill, so stripping colour puts the left edge one column off — the exact size of the thing being measured. +### The bar as a framed box + +Second pass: given three rows the bar draws the same rounded box the panes do, +and given one it stays the single line it always was. Verified live — its +borders span exactly the columns the pane frames span, and the corners are the +same glyphs. + +The height is the **layout's** decision, because a plugin cannot resize its own +pane: + +- `config/layouts/default.kdl` defines the bar as a `pane_template` named + `sl0pbar` and places it at `size=3`; +- `config/layouts/default.swap.kdl` defines a `tab_template name="mobile"` that + places the same template at `size=1`, and the `stacked` swap layout — the one + `responsive_layout` collapses to below `responsive_min_cols` — uses it. + +That reuse is only possible because zellij parses a layout and its `.swap.kdl` +with the **same parser**, deliberately, "so that we can reuse assets (eg. pane +and tab templates)". Without it the collapsed template would have to duplicate +the entire 100-line zjstatus configuration. + +The plugin adapts to the rows it is handed (`ModuleConfig::viewport`): three or +more and it frames itself, fewer and it does not, so a `size=1` bar can never +render half a box. That one function also returns where the content line starts, +and click routing reads it — which is why a click on the new box's border hits +nothing instead of the widget underneath. + ### Still open on the bar -The request was "quite a bit of an overhaul", and this is the first pass. Not -done, and worth deciding before more work: whether the bar should be a framed -box in the pane style (rounded corners, its own gap) rather than a single line; -whether it should be multi-row; what else belongs on it. +Content and further click targets: a close-`x` per tab, session name → session +manager, mode indicator → unlock, drag-to-reorder tabs. Also: the pane-split `+` +and the new-tab `+` are currently the same glyph for different verbs. ## Standing risks |
