Skip to main content

Module ui

Module ui 

Source
Expand description

Presentation layer — one place owns the palette, table style, terminal width, color detection, and progress indicators. Commands call semantic helpers (project, timestamp, emphasis, …) rather than raw owo_colors methods so the palette can change in one place.

Structs§

Spinner

Enums§

ColorChoice

Functions§

apply_color_choice
banner
cell_cost
cell_count
cell_dim
cell_model
cell_plain
cell_project
cell_provider
Provider label cell, colored per agent so mixed result sets read at a glance.
cell_tool
classify_text_line
Color a plain text log line based on keywords it contains (fallback for non-JSON watch lines).
cost
Colored cost for non-table contexts (summary). Green dollar figure.
count
Colored count for non-table contexts. No special color; just formatted.
emphasis
fmt_cost
Format a cost as $12,345.67 — two decimals, thousands separator. Negative values render as -$5.00, not $-5.00. Amounts smaller than one cent but non-zero fall back to four decimals ($0.0040) so per-session costs don’t silently round to $0.00.
fmt_count
Format an integer with comma thousands separators: 12,345.
header
Build bold + cyan header cells. Comfy-table renders these as ANSI when the table’s styling is enabled; force_no_tty (called by table() under --color never) suppresses them cleanly.
level_debug
level_error
level_warn
match_highlight
model_name
note
A dim, secondary caption printed beneath a table (e.g. a truncation hint).
project
project_headline
record_type
Color a session-record type string — green for user, blue for assistant, dimmed for system, yellow for other.
right_align
Right-align the specified column indices. Use for numeric columns so digits line up on the decimal.
role
section_title
session_id
spans_providers
Whether a result set spans more than one provider — used to decide if a table should carry a Provider column (omitted when everything is one provider, e.g. a Claude-only user, to keep tables narrow).
table
Preconfigured comfy-table with a minimal style: no outer box, no vertical dividers, no per-row separators — just a horizontal rule under the header. Dynamic arrangement fits content to the current terminal width.
timestamp
tool_name
total_row
Build a bold summary row (e.g. “TOTAL”). Cells inherit column alignment.