Skip to content

fix(reader): Keep diagrams after quick resizes, and add width keys - #52

Merged
DeepanshuMishraa merged 2 commits into
mainfrom
fix/reader-width-and-resize
Nov 18, 2026
Merged

DeepanshuMishraa merged 2 commits into
mainfrom
fix/reader-width-and-resize

Conversation

@DeepanshuMishraa

@DeepanshuMishraa DeepanshuMishraa commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

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 to reader.max_width.

Changes last for the session. The pen and eraser now share a row in the ? list so quit still fits on a 30-row screen.

Screenshots (Rex)

Pane zoom toggled 12 times on a short Mermaid diagram.

Before: diagram gone After: diagram kept
before after

= fits the column to the pane, so the sequence diagram from #46 is readable:

fit width

Tests

  • a_resize_uploads_figures_again_because_terminals_may_drop_them
  • angle_brackets_narrow_and_widen_the_column_and_equals_fits_the_screen
  • cargo 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 configured max_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 so quit still fits on short screens.

Written for commit 5710970. Summary will update on new commits.

View guided diff Turn on auto-fix

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>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/viewer.rs Resolved
Comment thread src/viewer.rs Resolved
Comment thread README.md Resolved
Comment thread README.md Resolved
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>
@DeepanshuMishraa
DeepanshuMishraa merged commit 49d6d96 into main Nov 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant