Skip to content

Keep a sheet's frozen rows and columns in view — the workbook declares what Excel froze, but the preview pins only its own letter and number gutters today #205

Closed as not planned

Description

@bencode

Problem

An Excel sheet states its own orientation: <sheetView><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/></sheetView> in xl/worksheets/*.xml is where the author froze a header row, a label column, or both. The preview never reads it.

  • readSpreadsheet goes through read-excel-file, whose Sheet result is only { sheet, data } (node_modules/read-excel-file/types/Sheet.d.ts); the Worksheet type carries just name and rows (ui-packages/web/src/formats/xlsx.ts:3), and readSpreadsheet maps straight onto that (formats/xlsx.ts:127-131). The pane declaration never reaches the reader.
  • SheetGrid renders every data row as a plain virtualized <tr> (ui-packages/web/src/features/reader/xlsx-reader/sheet-grid.tsx:81-94); sticky positioning is applied only to the column-letter header and the row-number gutter (xlsx-reader/style.module.scss:83-109).

So on a sheet taller than the viewport — a case the code itself anticipates ("a ten thousand row sheet", formats/xlsx.ts:56-57) — the author's frozen header row scrolls off after one row, and every value below loses its column name until the reader scrolls back to check. Scrolling right on a wide sheet (the grid already expects 100+ columns, sheet-grid.tsx:51-55) carries the label column away too, leaving only the row numbers pinned. The assistant does not share the loss: sheet_read returns the column letters with every read (selectCells, formats/xlsx.ts:110-122), so asking "what is this number?" works while reading it directly does not — the same reader-vs-assistant asymmetry #68 filed for PDF search.

Proposal

  • Read each sheet's <pane> splits — frozen row and column counts — alongside the values, the way markUnconvertedContent already opens package XML with JSZip (ui-packages/web/src/formats/docx-unconverted.ts:90-97); carry them on Worksheet.
  • In SheetGrid, render the frozen rows inside the sticky header area, and the frozen columns as position: sticky cells at cumulative left offsets — the fixed 160px column width makes those offsets trivial (style.module.scss:72-74).
  • Ignore split-but-not-frozen panes; sheets without a pane render exactly as today.

Goal

After this, opening a workbook whose sheets freeze header rows or label columns keeps them pinned while the body scrolls, vertically and horizontally, with the file's own pane declaration as the only input — nothing is guessed — and sheets without frozen panes are unchanged.

Verification

grep -rEq "pane|ySplit|xSplit" ui-packages/web/src/formats/xlsx.ts
pnpm --filter @gamma-reader/web test --silent
pnpm --filter @gamma-reader/web exec vitest run --project unit src/formats/xlsx.test.ts
pnpm check

(the fixtures and tests to add with the change: a workbook with ySplit/xSplit frozen panes whose readSpreadsheet result carries the frozen counts, and a SheetGrid render where the frozen header row stays mounted while the virtualizer scrolls — today Worksheet has no field to hold a pane, and no such test can pass)

Refs

Activity

  1. added
    enhancement
    source:scheduled
    on Oct 23, 2026
  2. bencode commented on Oct 23, 2026

    @bencode
    OwnerAuthor

    Independent review — posted by the scheduled issue-reviewer loop (independent of the authoring session), against main@90b046f.

    Evidence audit: all citations confirmed.

    • ✅ formats/xlsx.ts:3 — Worksheet = { name: string; rows: readonly SheetRow[] }; readSpreadsheet maps read-excel-file's result straight onto it, and node_modules/read-excel-file/types/Sheet.d.ts is exactly { sheet, data } — panes are dropped at the door, as filed.
    • ✅ sheet-grid.tsx:81-94 — every data row a plain virtualized <tr>; sticky positioning exists only for thead th and .rowNumber (style.module.scss:83-109); the fixed 160px cell width (:72-74) and the over-100-columns notice both confirmed.
    • ✅ docx-unconverted.ts:90-97 — the JSZip-reads-OOXML precedent is real; selectCells does return letter labels with every read (the reader-vs-assistant asymmetry).

    Duplicate check: none — #161/#157/#170 are value fidelity in the same grid and correctly cross-referenced, not overlaps; #69 is sheet search.

    Sensor + a defect found: lint ✓, but verify passed vacuously — the original Verification block was suite-runs only (test / vitest run / check), which passes on any green main. The feature is demonstrably absent (Worksheet has no pane field, no frozen rendering exists), so a passing verify here is a false positive of the same family that burned #41/#55 — left alone, a future beat would close this as "implemented".

    Verification block edited (logged per policy): added as its first line

    grep -rEq "pane|ySplit|xSplit" ui-packages/web/src/formats/xlsx.ts

    — the proposal mandates reading each sheet's <pane> splits in the format layer, and pane/ySplit/xSplit are OOXML's own names, not implementer vocabulary; zero matches on main today. Re-linted ✓; verify now ✗ on main as it should be.

    Verdict: valid, keep open. One edge worth a sentence when implementing: maximumPreviewColumns = 100 clamps the grid — a frozen label column past column 100 has no cell to pin, so panes only bind within the visible set.

  3. bencode commented on Oct 25, 2026

    @bencode
    OwnerAuthor

    Re-audit — posted by the scheduled issue-reviewer loop (independent of the authoring session), against main@90b046f.

    No commits since the 2026-10-23 review (HEAD unchanged), so this beat confirms:

    Verdict unchanged: valid, keep open. The implementer edge from the prior review still applies: maximumPreviewColumns = 100 clamps the grid, so panes only bind within the visible column set. No action this beat.

  4. bencode commented on Oct 26, 2026

    @bencode
    OwnerAuthor

    Closing as not planned. The preview keeps the column letters and row numbers pinned, and we're not reading frozen panes from the workbook.

    To check what a value is deep in a sheet, ask the assistant, which reads cells by row and column, for example "what is the value in row 120 under Revenue?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsource:scheduled

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions