Skip to content

Comments

fix: use cached row pins for WASM viewport rendering#133

Draft
darrinm wants to merge 2 commits intocoder:mainfrom
darrinm:fix/viewport-cached-row-pins
Draft

fix: use cached row pins for WASM viewport rendering#133
darrinm wants to merge 2 commits intocoder:mainfrom
darrinm:fix/viewport-cached-row-pins

Conversation

@darrinm
Copy link

@darrinm darrinm commented Feb 24, 2026

Summary

  • Replace per-row pages.pin(.active) calls in renderStateGetViewport with cached row pins from RenderState.row_data, matching how the native renderer reads cell data
  • Fix scrollback_limit to properly convert line counts to bytes (matching Terminal.init's expected units)
  • Add Page imports needed for the bytes-per-line calculation

The per-row approach independently resolved the viewport top-left position for every row, which could produce inconsistent results when the viewport spanned multiple pages. Using the cached pins (built during update()) matches the native renderer's approach and avoids this class of issues.

Test plan

  • bun test lib/iris-repro-final.test.ts — scrollback and viewport regression tests pass
  • bun test lib/iris-repro-fix-verify.test.ts — scrollback drop verification passes
  • bun test — full suite passes

🤖 Generated with Claude Code

darrinm and others added 2 commits February 23, 2026 20:49
Replace per-row pages.pin(.active) calls in renderStateGetViewport with
cached row pins from RenderState.row_data, matching how the native
renderer reads cell data. This avoids inconsistent top-left resolution
when the viewport spans multiple pages.

Also fixes scrollback_limit to properly convert line counts to bytes
(matching Terminal.init's expected units) and adds Page imports needed
for the bytes-per-line calculation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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