Files
splinter/share
lotherk 1726bc1967 ui: a status bar above the prompt, a scroll fix, a steer space
The screen had no room for the numbers that say how a turn is doing, and
two older behaviours still hurt: scrolling to the top made PgDn jump back
to the top, and a catalogue's steer mark without its trailing space glued
the typed text to ">".

- draw_statusbar() in curses.c: one row above the prompt with
  ctx used/max + [||||    ] gauge, cache share and tok/s. The history and
  sidebar lose one row; the prompt stays the bottom row. The bar is drawn
  on every idle tick, during a turn and in --attach.
- ctx: optional field on a provider (and in core) in tokens; the engine
  reports it in struct sp_engine_state. SPLINTER_CTX_MAX still overrides it.
- cache: sp_reply gained tokens_cached. OpenAI reads
  prompt_tokens_details.cached_tokens / prompt_cache_hit_tokens, Anthropic
  reads cache_read_input_tokens and counts cache reads+writes in the prompt
  total. sp_agent_stats keeps the last request's prompt and cache share;
  the engine keeps the turn's output tokens for a real tok/s.
- scroll: grow scroll by the growth of maxscroll, not by the distance from
  the first visible line. At the top that distance was 0, so every frame
  re-added the whole scrollback and PgDn could not leave the top.
- steer mark: append the missing space if a catalogue omits it.
- protocol state carries ctx_used/ctx_max/cached/turn_tokens_out, so the
  attached UI shows the same bar.
- tests: cache parsing in test_sse/test_openai/test_anthropic, ctx parsing
  in test_confblock, and test_ui checks the bar, the cache share and the
  PgUp-to-top/PgDn-down path.

make check: all tests passed.
2026-11-16 16:59:49 +00:00
..