Fix tab scroll range fitting complexity
Merged
LA
2mo ago+55+55+01234567890123456789-18-18-01234567890123456789
Summary
- add behavior coverage for preserving offsets and fitting active tabs at scale
- replace repeated range scans with one-pass accumulated width subtraction
The renderer keeps Ratatui's standard model: compute bounded Rects and write widgets into the frame buffer. See https://docs.rs/ratatui/latest/ratatui/struct.Frame.html and https://docs.rs/ratatui/latest/ratatui/layout/struct.Rect.html.
Verification
- rustfmt
- git diff --check
- focused cmux-tui hosted workflow: https://github.com/manaflow-ai/cmux/actions/runs/33639066113
Two commits are intentional: the first adds the failing behavior tests, the second adds the fix.
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Fixes tab scroll range fitting so large tab sets no longer cause quadratic work. Replaces repeated range scans with a one-pass accumulated width subtraction and adds tests for preserving requested offsets and fitting active tabs at scale.