Repository navigation
Improve terminal redraws to reduce navigation flickering - #252
Merged
Merged
Conversation
Replace full-screen redraws with buffered differential line updates. Clear stale tails, clip output to the viewport and invalidate the frame on resize. Add regression coverage for navigation, ANSI styles and Unicode.\n\nFixes #251 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
|
Coverage after merging shouze-reduce-terminal-flickering into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Normalize CRLF and tab-indented snippets before diffing, preserve full-width edge cells, and add cell-level scrolling regressions. Reuse shared named controls across terminal consumers and enforce the convention through agent instructions and CI architecture tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
|
Coverage after merging shouze-reduce-terminal-flickering into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Address the CodeQL incomplete-escaping finding and verify the wire-format matcher preserves surrounding text. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
|
Coverage after merging shouze-reduce-terminal-flickering into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.

What does this PR do?
Fixes #251.
The interactive TUI previously erased the entire screen and wrote the replacement frame separately on every redraw, exposing an intermediate blank screen during Up/Down navigation.
src/terminal-control.ts, alongside named cursor/erase/style/mouse controls andLINE_FEED,CARRIAGE_RETURN,TAB. Reuse them across the TUI, rendering, progress bars and CLI; new frame tests no longer embed protocol strings.AGENTS.md, the bug-fixing skill and a dedicated terminal instruction file. Add an architecture guard to the normal Bun/CI suite that rejects raw control encodings outside the shared vocabulary and enforces named line controls on terminal surfaces and new render tests. Only established legacy protocol fixtures and the independent vocabulary contract tests are exempt.mainand resolve therender.tsconflict by preserving bothbuildFrameUpdateand the terminal-wrapper façade exports.Reproduction and manual verification: Run an interactive query with multiple results; navigate Up/Down across viewport boundaries, then exercise folding, filtering, help and resizing. Before this change, redraws cleared the entire screen. Afterward only affected lines change. The original reporter's exact query, terminal emulator and installed binary version were not provided.
How did you verify your code works?
bun test --dots— passed: 1,079 tests, including the three reproduced review defects, additional Unicode/cell regressions, independent control-protocol contracts and the architecture guard. The frame builder has 100% function/line coverage.bun run typecheck— passed, no type errors in 63 files.bun run format:check— passed, all 154 files formatted.bun run knip— passed; two existing informational configuration hints for native Bun commands remain.bun run build.ts— passed; the macOS ARM64 binary compiled and passed codesign verification.git diff --check— passed.runInteractive(): 44 interactions and two resizes for each ofq, Ctrl+C and Enter. Confirmed one write per changed redraw, no full-screen erase during interaction, no output at navigation boundaries, restored terminal attributes/mouse mode, and valid JSON on confirmation. The first navigation update was 339 bytes versus 2,793 bytes for the initial frame. This local harness is not committed.1facfdd: repository CI (Bun checks and bats) and all CodeQL checks passed. All review threads are resolved, and GitHub reports the PR as conflict-free.Security scan limitation:
aikido_full_scanremains unavailable because the Aikido MCP server is not installed/connected in this session. Setup guide: https://help.aikido.dev/ide-plugins/aikido-mcp.