Skip to content

#1447: two value fields without a column field hide the Values row - #1683

Merged
aiongg merged 1 commit into
storytold:mainfrom
HyakoV3:fix/1447-values-row
Oct 22, 2026
Merged

aiongg merged 1 commit into
storytold:mainfrom
HyakoV3:fix/1447-values-row

Conversation

@HyakoV3

@HyakoV3 HyakoV3 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Item 6. Two or more value fields with no column field wrote firstHeaderRow="1" and no extension; Excel 365 then adds a Values caption row that can turn the report into #SPILL!. Now firstHeaderRow="0" and <x14:pivotTableDefinition hideValuesRow="1"/>, as Excel writes them. Test two_value_fields_without_columns_hide_the_values_row fails on main.

Part of #1447 (one PR per item, as asked on the ticket). cargo xtask ci passes.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Fixed XLSX PivotTable layouts with multiple value fields and no column fields.
    • Prevented Excel 365 from adding an unexpected Values row and causing #SPILL! errors.
    • Preserved the Values row for PivotTables with a single value field.
  • Documentation

    • Updated file-format compatibility notes to document the corrected PivotTable layout behavior.

@HyakoV3
HyakoV3 force-pushed the fix/1447-values-row branch from 410276b to eb30ab8 Compare October 20, 2026 21:49
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: storytold/gridcraft/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 79715d77-5386-43fe-bdc2-4eef362642d8
📥 Commits

Reviewing files that changed from the base of the PR and between 68e58a2 and eb30ab8.

📒 Files selected for processing: 3
  • crates/xlsx/src/pivot.rs
  • crates/xlsx/src/tests/pivot_tests.rs
  • docs/file-format-parity.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

📝 Walkthrough

The XLSX PivotTable writer now hides the Values row when multiple value fields appear in columns without column fields. Regression tests cover this layout and the single-value case. The parity history records the updated XML attributes.

Changes: PivotTable Values Row

Layer / File(s) Summary
Write and validate the Values row layout
crates/xlsx/src/pivot.rs, crates/xlsx/src/tests/pivot_tests.rs, docs/file-format-parity.md
For columns-only PivotTables with multiple value fields, the writer sets firstHeaderRow="0" and emits an x14 extension with hideValuesRow="1". Tests confirm these attributes and verify that a single value field does not hide the row. The parity history records the change.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: echelon, neilcawse

Merge Risk: ⚪ Minimal · up to eb30a

This change makes the XLSX writer hide the Values row for pivots with two or more value fields and no column field, which prevents Excel 365 from inserting a Values row and producing #SPILL!. Other layouts keep their existing behavior, and tests cover both cases. No merge-blocking risk is identified.

Security architecture risk: ⚪ Minimal · up to eb30a

The change adjusts exported PivotTable layout metadata without adding an input path, granting privileges, or weakening XML escaping. No material security risk was identified in the changed behavior.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed behavior is scoped to matching PivotTable definitions in exported workbooks. Inspection of the complete production diff and existing export relationship found no expansion into service authority, credentials, or cross-tenant access.

Trust Boundaries and Controls

  • observed — User-controlled PivotTable names, value-field captions, and style names continue through esc_attr. The added metadata does not bypass that control or introduce a new unescaped string source; esc_attr escapes XML-sensitive characters.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 75.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. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: hiding the Values row when two value fields exist without a column field.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 75.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. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@aiongg
aiongg merged commit 508d230 into storytold:main Oct 22, 2026
2 checks passed
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