mirror of
https://github.com/patriceckhart/zot.git
synced 2026-06-26 21:36:31 +02:00
/jump: - new slash command; opens a picker listing every user turn in the current session (timestamp relative, tool count badge, first line of the prompt). \u2191/\u2193 + enter scrolls the viewport to put that turn's user-message header at the top row. non-destructive, transcript untouched - runes extend a live filter; backspace shortens. '/jump <text>' pre-applies the filter; exactly-one-match auto-jumps without showing the picker - while parked on a past turn the scroll-up note reads 'viewing turn N of M \u00b7 pgdn to catch up' instead of the generic row count. scrolling back to the tail (or starting a new turn, or /clear) resets the parked state automatically - view.go: new MessageAnchor type + BuildWithAnchors so the dialog can resolve msgIdx -> first rendered row perf for long transcripts (the whole ui stutters on ~50 messages): - view.renderCache: per-message memoisation keyed by (fnv1a of role+content, width, expandAll). finalised messages never change so the cache hit rate is ~100% after the first render. streaming partials and in-flight tool-call views stay uncached by design - BuildWithAnchors now pre-sums line counts and allocates in a single make() instead of 50 appends with log2(N) backing- array memcpys - truncateToWidth fast path: byte-length <= cols implies cell-width <= cols, so we skip the rune-width loop entirely. covers the huge majority of lines in a session - cache purged on /clear, /compact completion, and session swap (applySessionSelection); resize invalidates implicitly via the width key. LRU eviction at 4x message count caps memory impact: a 50-msg / 2000-line transcript went from unresponsive- while-typing to drawing in well under a frame. measured locally with go-perf traces; no change to correctness. |
||
|---|---|---|
| .. | ||
| editor.go | ||
| highlight.go | ||
| image.go | ||
| input.go | ||
| markdown.go | ||
| render.go | ||
| resize_unix.go | ||
| resize_windows.go | ||
| terminal.go | ||
| theme.go | ||
| view.go | ||