Repository navigation
fix(reader): Keep diagrams after quick resizes, and add width keys - #52
Merged
Merged
Conversation
After several resizes in a row, Rex drops the uploaded kitty images, so placing the old ids again left an empty gap. A resize now frees and re-uploads every figure. `<` and `>` narrow or widen the reading column by 8 (down to 20), and `=` fits it to the screen or returns to the configured max_width. The pen and eraser share a row in the key list so `quit` still fits on 30 rows. Refs #46 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
A resize now frees and re-uploads pen strokes as well as figures, since the terminal can drop both. `<` and `>` step from the width already asked for, clamped to the last frame's room, so presses before the next draw each count. The README says `<` stops at 20 columns and that images follow the current reading width. Co-Authored-By: Claude Opus 5.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.
Refs #46.
Diagrams vanishing on resize
After several resizes in a row (dragging a pane edge), Rex drops the uploaded kitty images. Leaf kept placing the old ids, which showed nothing and left an empty gap. A resize now frees and re-uploads every figure (
App::resized).Checked in Rex 0.1.0-preview.20 by toggling pane zoom 7–12 times on a short Mermaid diagram: the old build lost the diagram 2/2 times, this build kept it 2/2.
Reading width keys
</>narrow or widen the column by 8 columns (minimum 20).=fits the column to the screen, and again returns toreader.max_width.Changes last for the session. The pen and eraser now share a row in the
?list soquitstill fits on a 30-row screen.Screenshots (Rex)
Pane zoom toggled 12 times on a short Mermaid diagram.
=fits the column to the pane, so the sequence diagram from #46 is readable:Tests
a_resize_uploads_figures_again_because_terminals_may_drop_themangle_brackets_narrow_and_widen_the_column_and_equals_fits_the_screencargo test: all pass.cargo clippy: same 5 existing warnings.🤖 Generated with Claude Code
Summary by cubic
Fixes diagrams and ink vanishing after several quick resizes by re-uploading them on every resize, and adds
</>to narrow or widen the reading column plus=to fit it to the screen (pressing=again returns to the configuredmax_width). Width keys pressed before the next frame each count toward the new width, and the pen and eraser now share a row in the key list soquitstill fits on short screens.Written for commit 5710970. Summary will update on new commits.