Skip to main content

Module tooltip

Module tooltip 

Source
Expand description

Pango-bordered tooltip primitives shared by every vendor renderer.

Extracted from the per-vendor implementations because every tooltip (Anthropic, OpenAI, Z.AI, OpenRouter) draws the same kind of box: blue corners + horizontals, dim separators, centered title, left-padded body lines. The only thing that varies is the line content.

Mirrors the visual style of claudebar’s ${B}╭${border_h}╮${E} block (claudebar:843-859).

Structs§

WindowRow
Optional decorations for a push_window row. Default reproduces the plain row every vendor drew before pacing reached the tooltip: bar + percentage, then ⏱ Resets in ….

Enums§

Line
One row of the bordered tooltip box.

Functions§

pad_center
Pad s symmetrically; when the difference is odd, the extra space goes on the right (claudebar center_pad precedent).
pad_right
Pad s on the right with spaces so its visible width reaches inner_w.
push_window
Append the standard three-line block every vendor uses for a usage window: icon + label, progress bar + bold percentage, then the dim reset countdown.
push_window_with_detail
push_window_with_row, with an optional vendor-specific detail appended to the percentage line. Spend-based vendors use this for values such as “$1.23 of $14.00” while keeping the same label / gauge / reset rhythm as percentage-based vendors such as OpenAI.
push_window_with_row
push_window, plus the optional decorations a WindowRow carries.
render_bordered
Render the bordered tooltip. Width is computed from the widest body/center line so different vendors auto-size correctly.