You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(xlsx): preserve outline summary placement in streaming writers - #593
Streaming a parent row followed by an outlined child writes the child's outlineLevel, but omits the sheet-level summary placement. Excel therefore uses summary-below placement even when the caller needs summaries above their children. The buffered writer already supports this setting.
This adds the existing OutlineProperties option to writeXlsxStream, writeXlsxStreamSheets, and XlsxStreamWriter. The shared worksheet prelude emits sheetPr/outlinePr before sheetViews, preserving explicit summaryBelow and summaryRight values on every rollover sheet. Omitted settings retain their existing behavior, and multi-sheet exports keep each sheet's settings separate.
For example, outlineProperties: { summaryBelow: false } with [["Parent"], ["Child"]] and child row outlineLevel: 1 now emits <sheetPr><outlinePr summaryBelow="0"/></sheetPr> and reads back as summaryBelow: false.
Existing row-outline coverage did not exercise sheet-level summary placement. The new regression tests cover both writer paths, explicit true/false and omitted attributes, XML element ordering, freeze panes, repeated headers, rollover, and per-sheet isolation. 13 of the 15 new tests failed before the fix.
Validation on Bun 1.4.2 and Node.js 26.7.0:
bun run test --maxWorkers=2: lint, formatting, both TypeScript configurations, and all 10,713 tests across 241 files passed.
bun run verify:package: build and all packaged-artifact checks passed.
git diff --check: passed.
The default-worker test run hit an unrelated 20-second timeout in test/html-import.test.ts; reducing workers passed without changing that test or its timeout. Generated worksheet XML and read-back behavior were checked; the workbook was not opened manually in Excel.
Summary by CodeRabbit
New Features
Streaming XLSX exports now support configuring outline summary placement for each sheet, including whether summaries appear below rows and to the right of columns. Unspecified settings remain unchanged.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID: e7cf2bf9-4ba4-4b23-90d5-dc09cd26e89e
📥 Commits
Reviewing files that changed from the base of the PR and between c991ad0 and 1ff6737.
📒 Files selected for processing: 2
src/xlsx/stream-writer.ts
test/xlsx-stream-outlines.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Streaming XLSX writer options now accept outlineProperties for single-sheet and per-sheet configuration. The writers serialize defined summary-placement values in worksheet properties. Tests cover both writer APIs, rollover sheets, and independent outline settings.
Changes: Streaming XLSX Outline Properties
Layer / File(s)
Summary
Outline options and worksheet serialization src/xlsx/stream-writer.ts
Streaming options now include outlineProperties. The shared sheet prelude emits sheetPr and outlinePr before sheet views, and writes each defined placement value as 1 or 0.
Writer integration and coverage src/xlsx/stream-writer.ts, test/xlsx-stream-outlines.test.ts
The incremental writer, single-sheet streaming API, and per-sheet streaming API pass outline properties to the prelude builder. Tests check omitted properties, rollover sheets, freeze panes, element order, and independent settings across sheets.
The outline-property change is ready for normal merge checks; no current merge-blocking risk was identified.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: preserving outline summary placement in streaming XLSX writers.
Linked Issues check
Issue #592 requires streaming options to expose and serialize outlineProperties, including summaryBelow and summaryRight, before sheetViews, with values preserved on rollover and omitted setti…
Out of Scope Changes check
The changes stay within issue #592. The source changes add the requested public option, shared worksheet serialization, and propagation through the streaming writer paths. The new tests verify the req…
Full details: Linked Issues check
Explanation
Issue #592 requires streaming options to expose and serialize outlineProperties, including summaryBelow and summaryRight, before sheetViews, with values preserved on rollover and omitted settings retaining defaults. The diff adds outlineProperties to StreamWriterOptions and XlsxStreamSheet. buildSheetPrelude emits sheetPr/outlinePr before sheetViews and serializes each defined property as 1 or 0. The option reaches writeXlsxStream, writeXlsxStreamSheets, and XlsxStreamWriter, including rollover sheets. The new tests cover both writer paths, rollover, omitted attributes, default behavior, and per-sheet isolation.
Full details: Out of Scope Changes check
Explanation
The changes stay within issue #592. The source changes add the requested public option, shared worksheet serialization, and propagation through the streaming writer paths. The new tests verify the requested XML, read-back behavior, ordering, rollover behavior, and sheet isolation. The documentation comment describes the same per-sheet behavior. No unrelated product behavior is shown.
Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
This branch has not been deployed
No deployments
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
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.
Streaming a parent row followed by an outlined child writes the child's
outlineLevel, but omits the sheet-level summary placement. Excel therefore uses summary-below placement even when the caller needs summaries above their children. The buffered writer already supports this setting.Closes #592.
This adds the existing
OutlinePropertiesoption towriteXlsxStream,writeXlsxStreamSheets, andXlsxStreamWriter. The shared worksheet prelude emitssheetPr/outlinePrbeforesheetViews, preserving explicitsummaryBelowandsummaryRightvalues on every rollover sheet. Omitted settings retain their existing behavior, and multi-sheet exports keep each sheet's settings separate.For example,
outlineProperties: { summaryBelow: false }with[["Parent"], ["Child"]]and child rowoutlineLevel: 1now emits<sheetPr><outlinePr summaryBelow="0"/></sheetPr>and reads back assummaryBelow: false.Existing row-outline coverage did not exercise sheet-level summary placement. The new regression tests cover both writer paths, explicit true/false and omitted attributes, XML element ordering, freeze panes, repeated headers, rollover, and per-sheet isolation. 13 of the 15 new tests failed before the fix.
Validation on Bun 1.4.2 and Node.js 26.7.0:
bun run test --maxWorkers=2: lint, formatting, both TypeScript configurations, and all 10,713 tests across 241 files passed.bun run verify:package: build and all packaged-artifact checks passed.git diff --check: passed.The default-worker test run hit an unrelated 20-second timeout in
test/html-import.test.ts; reducing workers passed without changing that test or its timeout. Generated worksheet XML and read-back behavior were checked; the workbook was not opened manually in Excel.Summary by CodeRabbit