Files
oh-my-pi/packages/tui/src
Voon Foo f92957bc6f fix(tui): clip direct Kitty placements when image blocks straddle the viewport top
- The Image line's CUU(rows-1) clamps at the viewport top once the block's
  leading rows scroll out, re-anchoring the full image shifted down; Kitty
  replace-by-id then strips the prior placement's cells, scrollback included -
  permanently cropped inline images on WezTerm/Warp.
- The renderer now rewrites placement lines at write time, clipping the source
  rectangle (y=/h=) to the visible slice, and advances the placement id (epoch)
  exactly when cells attached by the current epoch enter native scrollback:
  every rendered frame feeds its raw commit target to the budget, crossing an
  epoch's attach top latches a per-image archived flag, and the next emit
  consumes it. Era-local comparisons keep ledger rewinds (duplication-never-
  loss recommits) correct by construction; no-commit rewrites (overlay
  show/hide) keep replacing the same id. The watch set bounds the per-frame
  scan to live un-archived placements regardless of session length.
- Destructive ED3 replays restart epochs and delete every registry entry each
  image placed (placement-scoped d=i, data retained) before re-placing under
  epoch 1, so repeated resets cannot strand terminal-side placements.
- Verified against WezTerm 20240203 cell-attachment debug logs: straddling
  frames attach exactly the visible slice, the finalize commit writes a full
  archive copy under a fresh id, and resetDisplay deletes exactly the ids the
  image ever placed.
2026-08-09 21:15:33 +08:00
..