Files
codewhale/crates
Hunter Bown 033fef6cb2 fix(tui): force clean redraw on resize / bound sidebar labels (closes #65)
After v0.6.1's light-theme removal exposed it more visibly, rapid resizes
left stale glyphs in the right column (sidebar fragments, mid-character
title truncation, duplicated transcript timestamps). Three small fixes:

- Coalesce queued `Event::Resize` events, run a single `terminal.clear()`,
  and immediately draw the new frame instead of waiting for the next event
  loop iteration. Previously the cleared screen could sit blank between
  the resize handler's `continue` and the next draw, so any other event
  arriving in that window would be processed before the repaint.
- `truncate_line_to_width` for budgets `<= 3` was counting codepoints
  instead of display widths, overrunning the cell budget for any
  double-width grapheme. Fix by accumulating display widths consistently.
- Add a `tracing::debug!` log to the resize handler so users hitting this
  in the wild can confirm whether crossterm is delivering the event.

Adds two regression tests in `tui/widgets` (resize cycle + cache
invalidation on width change) and one in `tui/ui` (truncate semantics).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 14:42:42 -05:00
..