Feature: live reply preview, scrollable approval diffs, a context meter, and /history in the CLI - #101
Merged
Conversation
… and /history Live preview: while a reply streams, the spinner shows its last five lines above the spinner line, redrawn at most once per spinner frame and cleared with the spinner. The finished reply still prints as rendered markdown. ReplyPreview wraps by terminal cells so no row can wrap on its own and throw off the cursor-up redraws. Scrollable diffs: a diff longer than 30 lines that needs a decision no longer prints above the approval menu. Scrollback gets a one-line summary and the diff shows in a fixed-height ScrollPreview above the menu, scrolled with PgUp/PgDn/Home/End while the menu keeps focus for the arrow keys. Short diffs and auto-approved ones print as before. Context meter: a line above the prompt shows how full the context window is, from the last request's prompt tokens. Local models get a bar against the configured context length; cloud models, whose window is managed server-side, show the token count. /history: browse this session's conversation in a scrollable window, filtered as you type, with Tab between the search box and the list. The meter and /history render only while the app is idle, and the approval preview only while a menu is up: RazorConsole redraws its region in place, so it can't share the screen with output printed mid-request. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The whole bar was one Markup in the level color, so on bright or glowing themes the shaded empty cells read as nearly full. The used part keeps the level color and the unused part is grey, in a gapless FlexBox row so the two halves stay joined. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…history Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
Summary
Four additions to the CLI that make long replies, long diffs and long sessions easier to follow:
/history: browse this session's conversation, filtered as you type.What changed
Context ████████░░░░ 17k / 32k (54%). It turns yellow at 60% and red at 85%, with the empty part drawn in grey so the bar's length is easy to read. Cloud models manage their window server-side, so they show the token count only./history: opens the session's messages in a scrollable window with a search box. Tab moves between the search box and the list; Esc, or Enter on an empty search, closes it.Why this was done
/compactbefore that happens.How it was tested
/history. These depend on how RazorConsole reports those keys, so they're worth a quick manual check.Notes
/historyonly render while the CLI is idle, and the diff window only while an approval menu is up. RazorConsole redraws its area in place, so it can't share the screen with output printed while a request runs. The live preview uses the spinner's existing redraw technique for the same reason./historywill show there once Desktop picks up this engine version. Desktop has no handler for it and reports it as unknown; Desktop's transcript already has Ctrl+F search.[Unreleased]→ Added.