Skip to content

Rewrite terphite in Go with dashboards - #6

Open
benwtr wants to merge 5 commits into
masterfrom
claude/project-rewrite-improvements-fk1wxf
Open

Rewrite terphite in Go with dashboards#6
benwtr wants to merge 5 commits into
masterfrom
claude/project-rewrite-improvements-fk1wxf

Conversation

@benwtr

@benwtr benwtr commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Replace the CoffeeScript/blessed implementation with a Go rewrite built
on bubbletea/lipgloss/bubbles, distributed as a single static binary
instead of an npm package with a stale request dependency and a
blessed fork pinned to a GitHub commit.

Along the way: proper error handling on all Graphite API calls (the
original silently swallowed fetch errors), env-var credential support
alongside the existing user:pass@ URL form, a cross-platform clipboard
copy instead of the iTerm2-only escape sequence, and test coverage
across the core packages (previously none existed).

Also adds dashboards — save a set of graphs and view them together as
a grid instead of one at a time, which the original README flagged as
a "next step" but never implemented.

claude added 5 commits July 25, 2026 11:49
Replace the CoffeeScript/blessed implementation with a Go rewrite built
on bubbletea/lipgloss/bubbles, distributed as a single static binary
instead of an npm package with a stale request dependency and a
blessed fork pinned to a GitHub commit.

Along the way: proper error handling on all Graphite API calls (the
original silently swallowed fetch errors), env-var credential support
alongside the existing user:pass@ URL form, a cross-platform clipboard
copy instead of the iTerm2-only escape sequence, and test coverage
across the core packages (previously none existed).

Also adds dashboards — save a set of graphs and view them together as
a grid instead of one at a time, which the original README flagged as
a "next step" but never implemented.
Replace the single-dot scatter plot with a braille sub-character canvas
(2x4 dots per cell), connecting datapoints with Bresenham lines instead
of leaving them as isolated points, for much smoother-looking charts.

Add graphite-web-style draw modes cycled with 'g': line (as above),
area (independent per-series fill to the bottom of the plot), and
stacked (cumulative area, non-overlapping bands). Saved dashboard
panels remember their own draw mode via a new Panel.DrawMode field.
In terminals that support inline images, display Graphite's own rendered
PNGs instead of ASCII charts — giving graphite-web's real axis labels,
legends, and gridlines rather than reimplementing them in braille.

Supports the iTerm2 protocol (iTerm2, WezTerm) and the Kitty graphics
protocol (Kitty, Ghostty), auto-detected from environment variables at
startup with an 'I' key to override when detection guesses wrong — it
can, since tmux and SSH don't always relay these escape sequences.
Terminals without support keep the existing braille charts.

Fetch selection is centralized in refreshCmd() so every action that
changes what's plotted requests the right format, and built escape
sequences are cached against image version + display size rather than
re-base64-encoding the payload on every frame.
Add an up-front disclaimer that the Go rewrite was written entirely by an
LLM and has only been tested against a mock Graphite server.

Also move the graphical-mode section below the dashboard key table — it
had been inserted between the two key tables, making the dashboard keys
read as if they belonged to graphical mode.
The inline-image work broke the layout: an image escape sequence is a
single line of text but occupies many rows on screen, so lipgloss padded
the chart pane to full height on top of an image already consuming it.
The frame came out roughly twice the terminal height, which scrolled and
smeared previous frames. Images are now painted as an overlay at absolute
coordinates over a correctly-sized blank region, leaving the frame's line
count honest.

Fix a second overflow of the same kind found while testing: helpBoxHeight
capped the box's declared height, but lipgloss only pads and never
truncates, so help longer than the cap overflowed. helpText now fits
itself to an explicit row budget and the box is sized from what it
actually produced.

Lay the help out in columns (5 rows instead of 18 at 170 cols) and add `?`
to collapse it to a single line.

Graphical mode now defaults to off — detection can't see through tmux or
SSH, so it's opt-in via `I`, whose first press picks the detected protocol.

Add `l` (and undocumented `ctrl+l`) to force a redraw. In dashboard view
only ctrl+l binds, since `l` is vim-style pane movement there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants