feat(tui): Phase 4 — sticky prompt headers#100
Merged
Merged
Conversation
When you scroll up through a long tool output, the prompt that section belongs to now pins to the top of the transcript, so you never lose track of which request you're reading the output for (grok's sticky-header nav). - lib.rs: a structurally-distinct TranscriptEntry::UserPrompt(Line) so the render pass can find prompt boundaries (flatten/text treat it like a Line; push_user_prompt records it; run.rs's two prompt echoes use it). - render.rs: one measuring pass builds per-line wrapped-height prefix sums — giving both the exact total (as before) and each prompt's wrapped-row offset. When scrolled (not following) past a prompt, the most recent prompt strictly above the viewport top is overlaid on the top inner row, with a subtle band (truecolor) marking it as pinned. wrapped_height is now a #[cfg(test)] helper (its overflow-saturation regression stays). Verified with a screen-dump test: pinned when scrolled past, absent while following. Deferred still (need a block cursor / live blocks / a markdown engine): per-block selection folding, the running accent-wave, mouse selection, a real markdown/syntect engine. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continues the grok-inspired TUI work (Phases 1–3 on main). Scroll up through a long tool output and the prompt that section belongs to now pins to the top of the transcript — so you never lose track of which request you're reading output for.
How
TranscriptEntry::UserPrompt(Line)— a structurally-distinct entry (vs a plainLine) so the render pass can find prompt boundaries.flatten/texttreat it like aLine;push_user_promptrecords it; run.rs's two prompt echoes route through it.wrapped_heightbecame a#[cfg(test)]helper (the render path sums the new per-line function inline); its overflow-saturation regression test stays.Scope / deferred
Bounded, no render-model rewrite. Still deferred to a future pass (each needs a block cursor / live-streaming blocks / a new engine): per-block selection folding, the running accent-wave animation, mouse selection, and a real markdown/syntect engine.
Verification
153 hi-tui tests pass (new screen-dump test: pinned when scrolled past, absent while following);
cargo fmt --all+ full-workspaceclippy -D warningsclean; ratchet updated. Ran the CI gate set locally this time (fmt --all, ratchet, full clippy, hi tests) to avoid the round-trips Phase 3 hit.🤖 Generated with Claude Code