Skip to content

refactor(streaming): write-only column widths reuse serializeCols - #316

Merged
baseballyama merged 1 commit into
mainfrom
refactor/write-only-reuse-serialize-cols
Nov 9, 2026
Merged

baseballyama merged 1 commit into
mainfrom
refactor/write-only-reuse-serialize-cols

Conversation

@baseballyama

@baseballyama baseballyama commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #315. The write-only writer now emits <cols> through the same serializeCols the modelled writer uses, instead of a second copy of the coalescing loop. Output is byte-identical.

Motivation

#315 added range coalescing twice: once in serializeCols and once inline in src/streaming/write-only.ts, where a -1 sentinel width was needed to keep column 1 at width 0 from joining an empty run. One implementation removes that sentinel and the risk of the two drifting apart.

Changes

  • Write-only <cols> output goes through serializeCols (no output change).

Testing

pnpm vitest run tests/worksheet/cols-coalescing.test.ts tests/streaming/write-only.test.ts

Breaking changes

None

Checklist

  • I have read CLAUDE.md and followed the project's conventions.
  • I have added or updated tests for the change.
  • I have added or updated documentation where user-visible behavior changed.
  • If this is a user-visible change, I have run pnpm changeset and committed
    the result.
  • If this is a breaking change, I have flagged it above and the changeset is
    marked accordingly.
  • I have re-read my own diff and removed dead code, debug prints, and stale
    comments.
  • If I used an LLM to draft this PR, I have verified each change myself, this
    PR represents real work that warrants a maintainer's review, and I am
    willing to defend each line in review.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MNFNHrh8yhz9PQ3bWTPBHo

Copilot AI balanced review requested due to automatic review settings November 8, 2026 22:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

The write-only writer had its own copy of the <col> coalescing loop added in
Build ColumnDimension entries and call the modelled writer's serializeCols so
there is one coalescing implementation. Reword the #315 changeset to tell
users that a reloaded file holds one columnDimensions entry per range.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNFNHrh8yhz9PQ3bWTPBHo
@baseballyama
baseballyama force-pushed the refactor/write-only-reuse-serialize-cols branch from a562edc to 76550b5 Compare November 8, 2026 23:09
@baseballyama
baseballyama merged commit 490505c into main Nov 9, 2026
18 checks passed
@baseballyama
baseballyama deleted the refactor/write-only-reuse-serialize-cols branch November 9, 2026 11:42
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.

2 participants