Skip to content

XLSX: keep "remove personal information on save" and honour it (part of #3089) - #3238

Merged
h-a-n-a-s-h-i merged 2 commits into
storytold:mainfrom
hectorviov:fix/keep-filter-privacy
Nov 3, 2026
Merged

h-a-n-a-s-h-i merged 2 commits into
storytold:mainfrom
hectorviov:fix/keep-filter-privacy

Conversation

@hectorviov

@hectorviov hectorviov commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Part of #3089: fixes the file part. The setting is now kept through open and save, and honoured for the author and company. Note authors made generic, lastModifiedBy (which overlaps PR #881) and a command or Options control for the setting are still open, so this PR doesn't close the issue.

What

Excel has a per-workbook privacy setting: Trust Center › Privacy Options › "Remove personal information from file properties on save". The Document Inspector also turns it on. Excel saves it as <workbookPr filterPrivacy="1"/>, and while it's on, Excel leaves the author and company empty on every save. GridCraft dropped the attribute. So a cleaned workbook opened and saved in GridCraft came back with the setting off, and with the author and company GridCraft wrote back.

  • Workbook.remove_personal_info (model) holds the setting. It's #[serde(default)] and skipped when false, so GridCraft JSON files are unchanged.
  • The xlsx reader sets it from filterPrivacy; the writer puts filterPrivacy="1" back.
  • While it's on, the writer leaves dc:creator and Company out. The other properties (title, subject, keywords, description) are written as before. The in-memory properties aren't touched, so turning the setting off writes them again.

Comparison

A minimal workbook with <workbookPr filterPrivacy="1"/>, then file.properties {author: "Jane Example", company: "Example Co"} (the issue's own example values), saved with gridcraft-cli run:

Saved GridCraft main (178f3eb) GridCraft with this PR Excel (the issue's measurement)
workbookPr <workbookPr/> (setting lost) <workbookPr filterPrivacy="1"/> keeps filterPrivacy="1"
dc:creator Jane Example (none) empty
Company Example Co (none) empty

I didn't turn the setting on in Excel myself (it's set through the Trust Center or the Document Inspector). The Excel column is the issue's measurement.

Tests

  • tests::roundtrip::remove_personal_information_is_kept_and_honoured checks that the setting is read from a file and written back, that the author and company are left out while it's on and other properties stay, and that with it off nothing changes. It fails on main.
  • cargo xtask ci passes.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a workbook privacy setting that, when enabled, omits author and company information from saved files while preserving other properties.
    • The privacy setting is retained when opening and resaving workbooks.
  • Documentation
    • Updated file format notes to describe support for workbook privacy filtering.

Excel's per-workbook privacy setting (Trust Center › Privacy Options ›
Remove personal information from file properties on save, set by the
Document Inspector) is saved as <workbookPr filterPrivacy="1"/>, and
while it is on Excel leaves the author and company empty on save.
GridCraft dropped the attribute, so a cleaned workbook came back with
the setting off, and it wrote the author and company back.

Workbook.remove_personal_info now keeps the setting (read and written
as filterPrivacy), and while it is on the writer leaves dc:creator and
Company out. Other properties are written as before. Note authors and
lastModifiedBy are the rest of the issue (the latter overlaps storytold#881).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between f0557ec and a774d18.

Files selected for processing: 1
  • crates/model/src/workbook.rs
Walkthrough

The workbook model adds a privacy setting. XLSX reading and writing preserve filterPrivacy. When enabled, saving omits the author and company properties.

Changes: Workbook privacy filter

Layer / File(s) Summary
Add and read the privacy setting
crates/model/src/workbook.rs, crates/xlsx/src/read.rs
The workbook model adds a false-by-default privacy flag. XLSX reading sets it from filterPrivacy.
Write filtered properties and verify round trips
crates/xlsx/src/write.rs, crates/xlsx/src/tests/roundtrip.rs, docs/file-format-parity.md
When the setting is enabled, XLSX writing preserves filterPrivacy and omits author and company properties. The round-trip test and parity notes cover this behavior.

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

Change: Bug fix

Possibly related issues

  • Issue 3089 — The change implements reading and writing filterPrivacy and omitting author and company, but does not cover the issue’s other noted gaps: generic note author, lastModifiedBy, and an Options control.

Suggested reviewers: echelon, prxnvt

Merge Risk: Low · previous review f0557

The privacy setting works for XLSX saves, but its documentation implies it covers every save format. GridCraft JSON files still keep the author and company. Correct the wording before merging so users are not misled.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the XLSX workbook setting "remove personal information on save" is kept and honoured. The raw summary and PR objectives confirm the change stores the setting in Workbo…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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: Title check

Explanation

The title names the main change: the XLSX workbook setting "remove personal information on save" is kept and honoured. The raw summary and PR objectives confirm the change stores the setting in Workbook.remove_personal_info, reads and writes it as workbookPr filterPrivacy, and omits dc:creator and Company while the setting is on. The title also references part of issue #3089, which matches the PR objectives' note that the issue remains open. The title is specific and accurate, so it passes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 4 files. (1 skipped: 1 unsupported.)

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.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 178f3eb and f0557ec.

Files selected for processing: 5
  • crates/model/src/workbook.rs
  • crates/xlsx/src/read.rs
  • crates/xlsx/src/tests/roundtrip.rs
  • crates/xlsx/src/write.rs
  • docs/file-format-parity.md

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

@coderabbitai coderabbitai Bot 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.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread crates/model/src/workbook.rs Resolved
…iter

Addresses CodeRabbit review on storytold#3238, "Limit the remove_personal_info
doc comment to XLSX saves": only the XLSX writer leaves out the author
and company; the workbook's own serialization still holds them. The
comment now says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 89d6584 into storytold:main Nov 3, 2026
1 check passed
@echelon

echelon commented Nov 3, 2026

Copy link
Copy Markdown
Member

Merged — thank you @hectorviov for the contribution!

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.

3 participants