Channel-agnostic header layout & content spec.
Every channel — terminal TUI, web, Telegram, future surfaces — renders the same conceptual header band:
[LEFT 30%] [CENTER 40% workspace switcher] [RIGHT 30%]
The decisions a channel cannot make on its own (slot ratios, workspace switcher sizing/visibility caps, default labels, copy id length, glyphs) live here as plain Clojure data. A channel imports this namespace, reads the values, and projects them onto its medium — TextGraphics cells for Lanterna, divs/spans for HTML, a keyboard row for Telegram, etc.
No graphics. No I/O. No channel-specific deps. Pure data + tiny
pure helpers, written as .cljc so a ClojureScript web UI can
require it directly.
Channel-agnostic header layout & content spec.
Every channel — terminal TUI, web, Telegram, future surfaces —
renders the same conceptual header band:
[LEFT 30%] [CENTER 40% workspace switcher] [RIGHT 30%]
The decisions a channel cannot make on its own (slot ratios, workspace
switcher sizing/visibility caps, default labels, copy id length, glyphs)
live here as plain Clojure data. A channel imports this namespace,
reads the values, and projects them onto its medium — TextGraphics
cells for Lanterna, divs/spans for HTML, a keyboard row for
Telegram, etc.
No graphics. No I/O. No channel-specific deps. Pure data + tiny
pure helpers, written as `.cljc` so a ClojureScript web UI can
require it directly.Glyph used by the right-slot copy session id affordance.
Glyph used by the right-slot `copy session id` affordance.
How many leading characters of the session UUID every channel
shows next to the copy affordance. Matches vis sessions
short form.
How many leading characters of the session UUID every channel shows next to the copy affordance. Matches `vis sessions` short form.
Static width (in display cells) of the LEFT header slot (notifications). A fixed column count instead of a fraction, so the left slot stays the same size whether the terminal is 80 or 200 columns wide.
Static width (in display cells) of the LEFT header slot (notifications). A fixed column count instead of a fraction, so the left slot stays the same size whether the terminal is 80 or 200 columns wide.
Fraction of the total width given to the LEFT slot (notifications).
Fraction of the total width given to the LEFT slot (notifications).
Upper clamp for visible workspace count: huge screens stop spreading past this — past it the centre slot would look like a header full of workspaces and nothing else.
Upper clamp for visible workspace count: huge screens stop spreading past this — past it the centre slot would look like a header full of workspaces and nothing else.
(max-visible-workspace-count workspace-n width)How many workspaces to show inside width cells.
Policy (identical across channels):
width / tab-entry-target-width to
[min-visible-tab-entries, max-visible-tab-entries],workspace-n (cannot show what does not exist),min-visible-tab-entries cannot fit the natural
budget, fall back to the natural fit so tiny surfaces degrade
gracefully.How many workspaces to show inside `width` cells. Policy (identical across channels): - clamp the natural fit `width / tab-entry-target-width` to `[min-visible-tab-entries, max-visible-tab-entries]`, - never exceed `workspace-n` (cannot show what does not exist), - if even `min-visible-tab-entries` cannot fit the natural budget, fall back to the natural fit so tiny surfaces degrade gracefully.
Lower clamp for visible workspace count: even on narrowish screens we keep at least this many visible (the arrows reach the rest).
Lower clamp for visible workspace count: even on narrowish screens we keep at least this many visible (the arrows reach the rest).
Static width (in display cells) of the RIGHT header slot (session-id copy
affordance). Fixed column count, see left-slot-cols.
Static width (in display cells) of the RIGHT header slot (session-id copy affordance). Fixed column count, see `left-slot-cols`.
Fraction of the total width given to the RIGHT slot (channel status + session-id copy affordance).
Fraction of the total width given to the RIGHT slot (channel status + session-id copy affordance).
(short-id id)Shorten a session UUID to the shared display length. Returns nil for blank input so channels can use truthy guards.
Shorten a session UUID to the shared display length. Returns nil for blank input so channels can use truthy guards.
Blank columns kept on EACH side between the centre slot and the left / right side slots, so the middle never crashes into either edge slot.
Blank columns kept on EACH side between the centre slot and the left / right side slots, so the middle never crashes into either edge slot.
(slot-layout cols)Fixed-width header layout for a band cols wide.
LEFT and RIGHT are sized by their slot ratios (left-slot-ratio /
right-slot-ratio) but capped at the static left-slot-cols /
right-slot-cols so they never eat the whole band on a wide terminal;
CENTER absorbs whatever is left after also reserving slot-gap-cols
blank columns on each side of the centre. Every width
clamps at 0 so a narrow band degrades gracefully (centre collapses first,
then the right slot) instead of going negative.
Returns {:left-x :left-w :center-x :center-w :right-x :right-w} -
absolute x positions + widths a channel paints directly.
Fixed-width header layout for a band `cols` wide.
LEFT and RIGHT are sized by their slot ratios (`left-slot-ratio` /
`right-slot-ratio`) but capped at the static `left-slot-cols` /
`right-slot-cols` so they never eat the whole band on a wide terminal;
CENTER absorbs whatever is left after also reserving `slot-gap-cols`
blank columns on each side of the centre. Every width
clamps at 0 so a narrow band degrades gracefully (centre collapses first,
then the right slot) instead of going negative.
Returns `{:left-x :left-w :center-x :center-w :right-x :right-w}` -
absolute x positions + widths a channel paints directly.(slot-widths cols)Compute integer widths [left center right] for a header cols wide.
center = cols - left - right so rounding errors never bleed off-screen.
Compute integer widths `[left center right]` for a header `cols` wide. `center = cols - left - right` so rounding errors never bleed off-screen.
Inner padding (in display cells / spaces) reserved on each side of a workspace label so the label never crashes into the cell border.
Inner padding (in display cells / spaces) reserved on each side of a workspace label so the label never crashes into the cell border.
Natural width per workspace entry used to drive the visible-entry clamp. Wider → fewer workspaces fit before arrows appear; narrower → more workspaces fit but labels truncate sooner.
Natural width per workspace entry used to drive the visible-entry clamp. Wider → fewer workspaces fit before arrows appear; narrower → more workspaces fit but labels truncate sooner.
(title-or-placeholder title)Visible label for a session: its title if non-blank, otherwise
untitled-session-label. Used by both workspace-label sync in
state and the synthesised fallback workspace in channels.
Visible label for a session: its title if non-blank, otherwise `untitled-session-label`. Used by both workspace-label sync in state and the synthesised fallback workspace in channels.
Default label every channel shows for a workspace whose session has no title yet. Renamed by the state layer once a title is generated.
Default label every channel shows for a workspace whose session has no title yet. Renamed by the state layer once a title is generated.
Glyph for the previous workspace overflow affordance.
Glyph for the `previous workspace` overflow affordance.
Glyph for the next workspace overflow affordance.
Glyph for the `next workspace` overflow affordance.
Glyph appended when a workspace label has to be truncated.
Glyph appended when a workspace label has to be truncated.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |