Repository navigation
Draw only the visible lines of a log pane - #56
Merged
Merged
Conversation
The stdout, stderr and custom panes measured their content with Paragraph::line_count and then rendered it scrolled to the tail, and both wrap every line of the log, so each frame cost time in proportion to the log's size: about 65 ms per MB. A WrapIndex now records where each line starts and which wrapped row it lands on. It is built once per log and width and extended with just the new lines as a log grows, and each frame hands ratatui only the lines on screen, so a frame takes the same fraction of a millisecond at 1 MB and 20 MB. The row count no longer includes the border, which line_count added, so follow mode stops leaving two blank rows under the last line, and the scroll offset given to ratatui is now within one line, so these panes keep following past 65,535 rows.
fedonman
force-pushed
the
fixed/draw-visible-log-lines
branch
from
September 29, 2026 09:17
d103855 to
0205584
Compare
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.
A wrapped
Paragraphalso wraps every line above its scroll offset when it renders, and follow mode sits at the tail, so cachingline_countwould still leave one full wrap per frame. A newWrapIndexrecords where each line starts and which wrapped row it lands on. It is built once per log and pane width and extended with only the new lines as the log grows, and the stdout, stderr and custom panes now hand ratatui just the lines on screen. A frame takes about 0.16 ms at both 1 MB and 20 MB. Follow mode also stops leaving two blank rows under the last line, and these panes keep following past 65,535 rows.Closes #20