aboutsummaryrefslogtreecommitdiffstats
path: root/sl0ppij/zellij-server/src/ui (follow)
Commit message (Collapse)AuthorAge
* sl0p: make the split button work on stacked panes toouser2026-08-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported still dead on a live session after the previous fix. Stacks move the frame twice more, and neither move was in the hit-test: - a stack list is drawn over the top rows of its visible member, pushing that pane's frame down. The renderer applies this as a frame geom override (reserved_top_rows); the click side did not, so every pane in a stack was clickable one row above its own title. frame_rect_with_top_reserved() now applies the same shift, before the gap inset, in the same order as render; - a stack's collapsed members drew a button on their one-row title. Nothing could honour it -- that row is the stack's picker, and "split the pane that is not on screen" is not a thing to ask anyway. They no longer draw one, and the click side mirrors the condition. 120 snapshot lines change, every one of them a one-liner losing its button and nothing else (same width, same content otherwise; audited mechanically). Both confirmed by reintroducing each bug and watching the check fail. A third candidate fix -- resolving a click to the stack's visible member, on the theory that get_pane_at could return a collapsed sibling -- turned out to be unnecessary: collapsed members have one-row geoms, so position lookup already lands on the right pane. Removed rather than kept "just in case". The check itself was wrong twice before it was right, in the direction that matters most (reporting failures that were its own): it now reads until the pty goes quiet instead of for a fixed time, and parses only a freshly forced repaint, so a half-arrived screen cannot look like a button drawn where it is not. It clicks every button it can see, and runs against config/config.kdl as well, whose stacks the minimal config never had. When the two disagree, the server's own log settles it: log::info! in intercept_split_button_click, read /tmp/sl0ppij-$UID/sl0ppij-log/.
* sl0p: make the split button visible, and clickable where it is drawnuser2026-08-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `+` shipped in 0.1.7 and 0.1.8 without ever appearing on a live session, while rendering in 265 snapshots. Four faults, each enough on its own: - title_line_without_middle computed the right side only inside the left side's and_then, so a pane with no title (hide_default_pane_names, the live default) got none at all; - title_line_with_middle discarded the right side whenever the left was absent -- that is every frame in a session with a second client, which the live box always had, and "MY FOCUS AND:" on every frame was saying so; - the title was budgeted before the button, so a title longer than the frame (any shell showing a path) consumed its columns. The button is anchored and hit-tested by pure geometry, so it cannot be the part that loses; - the click hit-tested position_and_size() while the frame is drawn inset by the pane gap, putting the clickable columns two right of the glyph and a row above it at the top of the screen. Hence "the click works" and "nothing is drawn" both being true, and that click test proving nothing. Adds Pane::frame_rect(), the rect the frame is really drawn in, which the status bar buttons had already had to work around by hand. Also fixes render_my_focus building its short form from separators that Vec::append had already drained: 4 cells wide while reporting 6, a title line two cells short of its pane. Found by asserting the width in the new test. Verification, since unit tests have now been insufficient here four times: split_button_is_drawn_where_it_is_hit_tested covers the combinations the live config produces, and packaging/checks/split-button-live.py (make check-live) reads the glyph off a real session, attaches a second client to force the middle builder, and clicks the columns it found the glyph in. Both confirmed to fail on the parent commit.
* sl0p: account for the split button in the title-alignment testuser2026-08-13
| | | | | | A right-aligned title no longer runs flush to the corner: the split button now occupies SPLIT_BUTTON_WIDTH columns between them. Adjusts the expectation rather than the layout, since that gap is the intended design.
* sl0p: draw the split button always, not only on hoveruser2026-08-13
| | | | | | | | | | | | | | | | | | | | | | | | The hover-gated version did not work. `mouse_is_hovering_over_pane` never became true in a live session, so the `+` was invisible while its hit-test -- which is geometric and never consulted hover -- kept working. Clickable but invisible is the worst of both, and it is exactly the failure the shared `split_button_columns()` was supposed to prevent: that guarantees render and hit-test agree on WHERE, not on WHETHER. Reported as "I hover over panes but don't see a +". My end-to-end test had proved the click, not the button, and the passing snapshots only proved the renderer works when the flag is set. Why the flag is false live is still open and is written into the code comment: the plumbing from `mouse_hover_pane_id` through `FrameParams` reads correctly, and the config that reproduces it sets both `advanced_mouse_actions` and `mouse_hover_effects`. Re-gate on hover only once that is understood AND shown on a real session rather than in a snapshot. 265 snapshots updated: every pane frame now carries the button. 233 are mechanically provable as button-only (the ` + ` replaces three horizontal glyphs before a corner); the remaining 32 differ only by a header line offset in the comparison, with the same substitution underneath.
* sl0p: a mouse affordance for splitting a paneuser2026-08-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switching panes, switching tabs, renaming, reordering and resizing all have a mouse path in this fork. Spawning a pane did not: it was keyboard-only. A `+` now appears at the right end of a pane's title line while the pointer is over that pane, and clicking it splits the pane. Hover-driven rather than always drawn, for the same reason the resize hint and the status bar button highlight are: a permanent `+` on every frame is noise, and the pointer being there is exactly when the button is useful. render ui/pane_boundaries_frame.rs::render_split_button hit tab/mouse_handler.rs::intercept_split_button_click shared split_button_columns(), so what is clickable is what is visible The button sits immediately left of the top-right corner and the existing scroll and pin indications get the room that is left. That ordering is deliberate: a fixed position relative to the pane's right edge is one the mouse handler can hit-test directly, instead of re-deriving the whole title layout the way `status_bar_button_at` has to. The clicked pane is focused first, then the split is requested exactly as a keybinding would (`PtyInstruction::SpawnTerminal` with `NoPreference`), so mouse and keyboard produce the same arrangement and the split lands on the pane whose button was clicked rather than whichever pane happened to be focused. Not drawn on floating panes: their PIN control owns that corner and is hit-tested by its drawn position, so anything to its right silently moves it out from under the pointer. Caught by test_ctrl_click_on_floating_pin_button_toggles_pin, which stopped pinning. Verified on the test box by injecting real SGR mouse events into an attached client's pty at 160x45: click on the button 1 -> 2 panes click on the title 1 -> 1 click mid-frame 1 -> 1 Two hover snapshots updated, and only those two: the `+` on the hovered pane (including an unfocused one -- splitting a pane you are not in is useful). zellij-server 1502 pass, zellij-utils 473 pass.
* sl0p: add an indexed style for status bar buttonsuser2026-08-12
| | | | | | | | | | | | | | | | | | | | | `status_bar_button_style "indexed"` renders `1:Approve 2:Reject` instead of `[Approve] [Reject]`, so the bar doubles as a key legend for a harness that binds alt+1..9 to the same actions. A config option rather than a protocol field: whether the numbers mean anything depends on what the USER has bound, not on what the program knows. It needs no wire change and so no version bump, and the click report still carries the id -- never the index -- so a program is unaffected by which style is in force. The style is threaded into layout_status_bar, the one function the renderer draws from and the hit-test resolves against. That is what makes this safe: changing a button's rendered width necessarily changes its clickable span too, verified by a test asserting span width equals the drawn width and that every drawn column resolves back, for both styles. Also fixes the web client's Style construction to read the option from config rather than defaulting it -- my first pass claimed that code had no pane_frames config available, which was wrong; it uses it two lines further down.
* sl0p: highlight the status bar button under the pointeruser2026-08-12
| | | | | | | | | | | | | | | | | | | | A click target with no hover feedback gives you no way to tell what you are about to hit, which matters more here than elsewhere because the buttons sit in a frame row that is only one cell tall. The hovered button is inverted rather than merely recoloured: swapping fore/background reads regardless of which colours a theme uses, and makes "the pointer is on THIS one" unmistakable next to its unhovered neighbours. Tracked per client, because hover belongs to a pointer rather than to a pane -- with two users attached, one pointer must not light up the other's button. Stored on the pane keyed by client id, which the frame renderer already has. Updated before the action dispatch rather than in the hover action, because motion over the ACTIVE pane is dispatched as SendToTerminal, not UpdateHover -- and the pane you are about to click a button in is usually the one you are already in. Every other pane's hover for that client is cleared on each motion, so moving between panes cannot leave a button lit behind.
* sl0p: clickable action buttons in the pane status baruser2026-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Second slice of the status/action frame. A program declares buttons, and a click is reported back to it: printf '\033]5577;1;buttons;approve:Approve;reject:Reject\033\\' -> click -> program's stdin receives OSC 5577 ; 1 ; click ; approve ST The report is a FIXED format carrying only the id, never bytes the payload chose, and ids are restricted to [A-Za-z0-9_-]. The sequence that creates a button is in-band and untrusted -- `cat` of a hostile file emits it as readily as a cooperating program -- so a click that could send arbitrary bytes would let viewing a file inject into the stdin of whatever is running, a shell included. Labels are '%'-escaped since the wire format is ';'-separated, and both the button count and id length are capped because the list lives as long as the pane. Positions come from one layout_status_bar function that the renderer draws from and the hit-test resolves against. Computing that geometry twice is how the stacked-pane picker once selected the wrong pane; a test asserts every drawn column resolves back to the button drawn there, across 100 widths. Two things the drive caught that unit tests could not: - The first delivery path pushed onto grid.pending_messages_to_pty, which is only drained when the PANE produces output -- so a click on an idle program sat in the queue forever. The write now happens at the tab level, which owns the senders. - The hit-test derived the frame row from the pane's raw geometry, but this fork draws the frame inset by gap_offset, so with `gap 1` every click missed by one row. It now derives from the CONTENT rect, which is by definition the inside of the drawn frame and therefore the same columns the renderer lays out. Buttons serialise with the session like the status text, so a resurrected pane comes back with its buttons intact.
* sl0p: per-pane status bar via OSC 5577 (experimental)user2026-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | First slice of the status/action frame: one row of program-supplied text in a pane's bottom frame row. printf '\033]5577;1;status;building 3/7\033\\' printf '\033]5577;1;clear\033\\' Rendered in the EXISTING frame row rather than in reserved rows. Reserving would shrink the pane's content area and resize its PTY whenever the bar appeared or disappeared, firing SIGWINCH at the program that asked for it -- the same churn that made the stack-list picker use a fixed cap. The frame row is already a text surface with a precedence chain, so this cost no geometry work at all. State lives on Grid like the window title, so it survives re-renders, resizes and detach/reattach with no draining. Session resurrection is NOT covered yet. Versioned from the start, and unknown versions or verbs are ignored, so the planned button verbs cannot be half-interpreted by an older build. Text is the remaining params rejoined with ';', which means a single text field needs no escaping -- the trick OSC 0/2 already uses for titles. Treated as untrusted, because it is: an in-band sequence is emitted just as readily by `cat` of a hostile file as by a cooperating program. Control characters are stripped -- a raw ESC could otherwise repaint anything on screen, a newline would corrupt the frame row -- and the length is capped, since the string is retained for the life of the pane.
* sl0p: add a minimal style for the stacked-pane pickeruser2026-08-12
| | | | | | | | | | | | | | | | | | | | | The boxed entries read as clutter: every entry bracketed in vertical bars, and the active one marked by a "> " that sits outside its own cell. `stack_list_style "minimal"` drops both. The active entry is shown by inverting it instead, which needs no glyph and no column, and the padding is moved inside the styled run so the inverted block covers the whole cell rather than leaving unstyled gaps at its edges. Four fewer columns of decoration per entry, so more fit per row in grid mode. Uses ribbon_selected rather than text_selected. Themes give ribbon_selected real contrast because it marks the selected item elsewhere in zellij's UI -- gruber yellow here, white-on-blue in the TempleOS theme -- whereas text_selected's background is 40,40,40 against a 24,24,24 terminal and read as essentially no highlight when tried. Decoration width comes from the style itself, so Tab's column arithmetic and the renderer cannot disagree about how wide an entry is. Default stays boxed, so nothing changes for anyone who does not ask.
* sl0p: keep stacked-layout entries identifiableuser2026-08-12
| | | | | | | | | | | | | | | | | | | Two problems made the stack list unusable for panes nothing had named yet, which is the common case right after opening them -- and the responsive collapse walks straight into it, since collapsing is exactly when the list becomes the only way to pick a pane. `hide_default_pane_names` no longer applies to stack list entries. In a frame an empty title is fine: the pane is still visible, sized and positioned, so you can tell what it is by looking at it. In the stack list the label is the ENTIRE affordance, so blanking it leaves rows that cannot be identified or told apart. Entries fall back to the "Pane #N" placeholder even when frames are configured to hide it. Entries are also prefixed with their 1-based position, so they stay countable and addressable even when several share a title or have none. The prefix is built by one shared helper because the renderer and Tab's column-width calculation must agree on its width or the list misaligns.
* sl0p: grayscale the contents of unfocused panesuser2026-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ui { pane_frames { inactive_grayscale 0-100 } }`, default 0 (off). Real colour transformation, not the SGR 'faint' attribute zellij already uses for frames: faint is terminal-dependent, several terminals only apply it to the 16 ANSI colours, and it does not remove colour. Each cell's colour is resolved to RGB and blended toward its own Rec.709 luminance, so an unfocused pane keeps its brightness but drains of colour. Colour resolution covers the cases that actually occur: RgbCode directly, ColorIndex via eightbit_to_rgb, and NamedColor by mapping to its 0-15 index. Cells with NO explicit colour are deliberately left alone - they render in the terminal default, which is already unsaturated, and rewriting them would mean emitting an explicit colour for nearly every cell for no visible gain. Two non-obvious pieces were needed to make it actually work: - The output buffer only emits CHANGED cells, so an idle pane would keep its old colours indefinitely after losing focus. Pane::refresh_for_focus_change forces a full repaint, called from ActivePanes::insert (the single place focus changes). It is a no-op when the feature is off, so it costs nothing by default. - Terminal panes render through the SHARED multi-client path. Focus is per client, so once unfocused panes are desaturated two clients may need different output for the same pane. Both tiled and floating panes now fall back to per-client rendering when grayscale is enabled - the reason this is opt-in. Known limitation: sixel/kitty image chunks are not colour-transformed and stay in colour. Hot-reloads like the other sl0p options. Tests cover the transform: full strength yields a true neutral grey, partial sits between original and grey, indexed and named colours resolve rather than being skipped, luminance is perceptual (green brighter than blue) not a flat average, already-grey is unchanged, and non-colour codes are untouched. Baselines held: zellij-server 1436/30, zellij-utils 436/5.
* sl0p: blank the padding ring too, fixing remaining resize ghostinguser2026-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous ghosting fix only covered ONE of the two regions the insets carve out. With `padding N` there is a second unowned region: the cells between the frame border and the content rect. Nothing wrote them, so when a pane grew, cells that had previously held another pane's border or title kept those glyphs - the reported 'old pane title/border repeated in the gap space'. Both rings are now blanked at every frame-render site: 1. allocation \ drawn frame (outer gap) 2. frame inner \ content rect (inner padding) Frameless mode is explicitly excluded from ring 2. With pane frames off the cells around the content belong to ui/boundaries.rs, which draws the inter-pane boundaries there, and content_offset deliberately leaves room for them. Blanking that region erased the boundaries and broke three tests (render_stacks_without_pane_frames, swap_tiled_layout_with_stacked_children_and_no_pane_frames, send_cli_toggle_pane_frames_action). Collapsing the interior onto the content rect emits no ring at all in that mode. gap_ring_chunks is now robust to any rect relationship: spans are clamped to `outer`, so a mis-clamped caller cannot make it write outside the pane's own allocation. Tested with inner rects that cover, miss, straddle and degenerate against outer. Suite back to baseline: 1421 passed / 30 pre-existing failures.
* sl0p: fix ghosting/artifacts when resizing panes with a gapuser2026-08-12
| | | | | | | | | | | | | | | | | | | | | | With a gap configured, PaneFrame::render() emits CharacterChunks only for the INSET frame. The gap ring - the cells between a pane's allocated geometry and the smaller frame drawn inside it - was written by nobody. On a fresh paint that looks correct, but only because the screen had just been cleared. As soon as panes are moved or resized, whatever was previously drawn in those cells survives, which is the ghosting/artifacts seen while dragging pane borders. gap_ring_chunks() emits explicit blanks for that ring, restoring the renderer's existing invariant that every cell of a pane's allocation is written by exactly one pane on every render. It is appended at all four frame-render sites (tiled + plugin panes, cached and uncached paths), and is a no-op when gap is 0 so the default path is untouched. Tests assert the ring never overlaps itself, never escapes the allocation, never overdraws the frame, has exactly (outer area - inner area) cells, and that ring + frame together tile the allocation with no holes - a hole being exactly what produces the artifacts.
* sl0p: configurable pane title alignmentuser2026-08-12
| | | | | | | | | | | | | | | | | | | | | | | Adds `ui { pane_frames { title_alignment "left"|"center"|"right" } }`. Full-frame panes previously hardcoded the title flush left, while frameless panes (pane_frame_style "titles") already centered it via compose_bracketed_title. This brings full frames up to parity and makes the position configurable. Implementation notes: - The value rides on `Style`, which is already threaded to FrameParams, so no new plumbing through Tab/PaneContentsAndUi was needed. - It is deliberately NOT round-tripped over the plugin protobuf boundary: plugins have no use for frame title alignment and adding a proto field would force regenerating the committed prost assets in assets/prost/. - Left keeps the original code path untouched, so default configs render exactly as before. - The geometry loop clamps the title start against the right-side indicators and breaks on `>=` rather than `==`, so a mis-clamped segment cannot spin. Tests: alignment ordering, frame width preservation across widths, and narrow-pane safety (cols 1..24 must not panic or corrupt width).
* sl0p: compact scroll indicator + sl0p.foo tab-bar brandinguser2026-08-12
| | | | | | | | | - pane_boundaries_frame: replace 'SCROLL: 42/1000' with a single-glyph indicator ('up-arrow'42), and only show it when actually scrolled up rather than whenever scrollback exists. - tab-bar: rebrand the prefix to sl0p.foo. Pre-existing local work, committed as the base of the sl0p fork.
* vendor(sl0ppij): import zellij v0.45.0 treeuser2026-08-12
Squashed import of upstream zellij at 0e6e4404 ("Support the Kitty Image Protocol (#5428)"), the merge-base our fork was developed against. Upstream's 3311 commits are deliberately NOT replayed here; only our own fork commits are, so the monorepo stays small and `git log sl0ppij/` shows sl0p work, not zellij's entire history. Upstream provenance is tracked in FORKS.md and can always be re-fetched from https://github.com/zellij-org/zellij.