Skip to content

fix(web): spreadsheet text and fills no longer vanish when their cell scrolls out - #41263

Merged
Yash-Singh1 merged 2 commits into
mainfrom
t3/fix-spreadsheet-cell-unmounting
Nov 23, 2026
Merged

Yash-Singh1 merged 2 commits into
mainfrom
t3/fix-spreadsheet-cell-unmounting

Conversation

@Yash-Singh1

Copy link
Copy Markdown
Collaborator

Problem

In the spreadsheet preview, scrolling a little to the right made content disappear: titles spilling across empty columns, merged headers and their fills vanished as soon as the cell that owns them left the screen. Merged blocks spanning rows lost their text the same way once their top row scrolled out. The engine (@betteroffice/xlsx) draws only cells whose column and row start inside the requested viewport, so anything anchored before the viewport's first track was dropped.

Change

The spreadsheet worker asks the engine for an area that starts up to 1024 px further left and 512 px further up than the frame (reach in sheet-frame.ts), then crops it back to the frame while painting. Frozen panes stay where the engine drew them, and only the cells past them move. The grid used for headers, selection and hit tests still comes from the frame's own viewport, and the bitmap sent to the window is the same size as before.

Cost: on a dense sheet, engine time per frame goes from about 4.6 ms to 6.4–9.7 ms in the worker (measured headlessly). Frames are only built when scrolling past the cached area. Content anchored more than reach before the viewport still clips.

Scope

A small fix for an obvious rendering bug reported directly by a maintainer while previewing a workbook, so there is no separate issue.

Verification

  • New worker browser test in sheet-resize.browser.test.ts: text overflowing from a column scrolled out sideways, and a vertically centred merge whose top row scrolled out, with and without frozen panes. Both cases fail on main and pass here.
  • vp run check:changed passes; all 93 office tests in apps/web/src/components/files pass.
  • Real app: the same scripted scroll on the reporter's workbook in the dev app, with the old and new sheet-frame.ts.
Before After
before after

Videos of the scroll: before.mp4 · after.mp4

Made with Claude Opus 5.5 in T3 Code (Cursor harness).

Yash-Singh1 and others added 2 commits November 23, 2026 00:01
… scrolls out

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Nov 23, 2026
@Yash-Singh1
Yash-Singh1 merged commit f1c1317 into main Nov 23, 2026
36 checks passed
@Yash-Singh1
Yash-Singh1 deleted the t3/fix-spreadsheet-cell-unmounting branch November 23, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant