fix: use cached row pins for WASM viewport rendering#133
Draft
darrinm wants to merge 2 commits intocoder:mainfrom
Draft
fix: use cached row pins for WASM viewport rendering#133darrinm wants to merge 2 commits intocoder:mainfrom
darrinm wants to merge 2 commits intocoder:mainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pages.pin(.active)calls inrenderStateGetViewportwith cached row pins fromRenderState.row_data, matching how the native renderer reads cell datascrollback_limitto properly convert line counts to bytes (matchingTerminal.init's expected units)Pageimports needed for the bytes-per-line calculationThe 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 passbun test lib/iris-repro-fix-verify.test.ts— scrollback drop verification passesbun test— full suite passes🤖 Generated with Claude Code