Skip to content

v0.4.0

Choose a tag to compare

@ralyodio ralyodio released this 09 Sep 17:08
4155d20

Collapsed borders now reach every seam, and the world map is a screen in the demo.

Collapsing merges the seam down the middle

collapseBorders merged the seams inside a column but never the one splitting the screen in two, so most screens collapsed about half their panels. Three things were in the way, and all three are fixed.

The screens themselves hard-coded a gap of one on the row that splits left from right, so those seams could never close. The library then merges a seam only where two bordered siblings meet — and the only way to put a stack of panels beside one tall panel is to wrap the stack in a column, which is not itself bordered, so the seam that mattered most was the one seam that could never merge. Containers now take a bordered flag declaring that their own edges are panel borders, and a grid of panels merges its tracks too.

before                                after
╭─ Services ─╮╭─ Kernel ─────╮        ╭─ Services ─┬─ Kernel ─────╮
│ ...        ││ ...          │        │ ...        │ ...          │
╰────────────╯╰──────────────╯        ╰────────────┴──────────────╯

The third was a panel with a background: box filled its whole rect before drawing its border, erasing the neighbour's border out of the shared column, so the merge found a blank cell and overwrote it — a corner where a junction belonged. Filling under collapsing now stops at the border ring, which the border paints in the same background.

Landed in all seven implementations together: TypeScript, Rust, Go, Python, Zig and C/C++, plus the Ruby, PHP and Perl bindings.

Rendering that does not ask for collapsing is byte-for-byte unchanged. Of the 240 shared reference frames, all 120 open ones are identical and 90 of the 120 collapsed ones changed.

A clickable world map in the demo

The world map shipped in 0.3.x as a library widget and a standalone example. It is now a screen in the reference dashboard, on w: hover to read the country under the cursor, click to select, z to zoom to the selection and r to go back to the globe. The country list beside it and the map are two views of one selection, so the arrow keys move the highlight on the map as well.

bunx @profullstack/hqtui-demo

For callers

ContainerOptions gains bordered, defaulting to false. Set it on a row or column whose children are all panels filling it across the seam, so a neighbouring panel can merge with them. Nothing else changes, and no existing layout moves unless it asks for collapsing.