Skip to content

feat(tui): info bar (version/model/context/skills/uptime) + /timestamps - #137

Open
Emasoft wants to merge 3 commits into
mlhher:mainfrom
Emasoft:feat/info-bar-timestamps
Open

Emasoft wants to merge 3 commits into
mlhher:mainfrom
Emasoft:feat/info-bar-timestamps

Conversation

@Emasoft

@Emasoft Emasoft commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Update 2026-09-25

New since the original description (998aa4b): the same ANSI-aware truncation fix as #135 protects the info bar too. Styled info-bar segments are truncated on narrow terminals, and the old rune walker could cut inside a CSI escape sequence — the helper now uses ansi.Truncate, keeping escape sequences intact at the same visible width.


Two opt-in TUI extras, toggled and persisted independently. Both default OFF, so out-of-the-box behavior is unchanged.

Info bar (/infobar) — a single-line footer below the status bar: late version · project folder · focused agent's provider/model (honoring agent_models) · context usage bar · running subagent count · discovered skills with estimated token footprint · compaction headroom · session uptime. Reserves one layout row, truncates to window width, and persists to config.json (show-info-bar).

Transcript timestamps (/timestamps) — a muted [HH:MM:SS] prefix on user and assistant transcript blocks. The session stamps every appended history message with its receive time; legacy history entries render unprefixed. Persists to config.json (show-timestamps).

Pure TUI work plus two config fields. The headroom segment uses a local 80% default constant (defaultContextThresholdPercent), so this PR has no dependency on the compaction PR.

Split out of #133 so the TUI changes can be evaluated separately (per review).

Testing

$ go test ./... -race -count=1
ok  	late/cmd/late	2.012s
?   	late/cmd/mcp-run	[no test files]
ok  	late/internal/agent	1.497s
?   	late/internal/assets	[no test files]
ok  	late/internal/client	3.187s
ok  	late/internal/common	3.827s
ok  	late/internal/config	2.141s
ok  	late/internal/executor	9.113s
ok  	late/internal/git	4.382s
ok  	late/internal/mcp	3.364s
ok  	late/internal/orchestrator	5.335s
?   	late/internal/pathutil	[no test files]
ok  	late/internal/plugin	14.271s
ok  	late/internal/session	4.884s
ok  	late/internal/skill	3.976s
ok  	late/internal/tool	5.402s
ok  	late/internal/tool/ast	5.310s
ok  	late/internal/tui	11.114s

exit 0 — all 18 packages green (15 ok, 3 without test files).

  • gofmt -l on the touched files: no output (clean)
  • go vet ./cmd/late ./internal/client ./internal/config ./internal/session ./internal/tui: clean
  • New tests: info bar toggle persistence, layout, rendered/omitted segments, truncation, uptime, headroom math (internal/tui/infobar_test.go), timestamp prefix rendering + persistence (internal/tui/timestamps_test.go), RFC3339 stamping (internal/session/timestamp_test.go)

Single-line footer below the status bar, toggled with /infobar and
persisted as config show-info-bar. Segments: late version, project
folder, focused agent's provider/profile ref + model (config
agent_models lookup), context usage bar, running subagent count,
discovered skills with estimated token footprint (SkillsInfo plumbed
from cmd/late/main.go), tokens to the compaction threshold, and session
uptime. The row reserves one layout row, truncates to window width, and
hides while the file picker is open.

Note: state.go and update.go also carry the /timestamps command def and
toggle handler (feature (b)) — the info bar is the dominant feature in
both files, so they are committed here per the no-hunk-split rule.

Note: config show-info-bar field lands with the compaction commit
(config.go is dominantly compaction).

Port notes (branch surgery):

- Config fields: the original note deferred show-info-bar/show-timestamps
  to a later compaction-era commit; here both fields (with their doc
  comments) are ported directly into internal/config/config.go so the
  /infobar and /timestamps toggles persist via SaveConfig and every
  commit builds.
- Headroom segment: upstream/main has no compaction config, so
  config.ResolveCompactionThreshold/config.DefaultCompactionThresholdPercent
  are replaced by a package-private tui constant
  defaultContextThresholdPercent = 80 (mirroring local/full's default);
  the segment itself is unchanged and uses only token counts plus this
  percentage.
- cmd/late/main.go: skillsInfoForTUI + model.SkillsInfo assignment
  ported from local/full (pathutil/skill/common were already available
  upstream).
…estamps

Session stamps every appended history message with an RFC3339 receive
time (appendMessage is the single path; caller-supplied timestamps are
preserved, legacy entries stay unprefixed). The TUI renders the time as
a muted [HH:MM:SS] row at the start of user and assistant blocks when
ShowTimestamps is on; toggling /timestamps invalidates the transcript
block cache and persists show-timestamps to config.json (handled by the
update.go change in the info-bar commit).

Port notes (branch surgery):

- Docs: carries the README developer-ergonomics bullet and the Quickstart
  "Info Bar & Timestamps" section for both features (the first commit
  where both exist). The Quickstart headroom wording reads "context
  threshold" instead of "compaction threshold" — this branch's base has
  no compaction configuration.
@mlhher

mlhher commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Great addition! I did notice it seems to duplicate the context window. Will likely just need some tiny polishing and then be merged. Again thank you!

…mid-CSI

The status bar and info bar truncate rendered, lipgloss-styled segments
on narrow terminals. The old rune walker counted escape bytes as content
and could cut INSIDE a CSI sequence, emitting garbage like "ESC[3..."
into the bars. Replace it with ansi.Truncate, which measures the same
visible width, keeps sequences intact, and already accounts for the
tail width.

Review fix cherry-picked from 0a97d2f (truncate helper + view_truncate_test.go only).
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