Fix tab scroll range fitting complexity

Merged
LA
2mo ago
+55-18

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

Two commits are intentional: the first adds the failing behavior tests, the second adds the fix.


View with [code]smith Autofix with [code]smith
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.