feat: add optional comment field to ContentSheetCell - #17
Merged
Conversation
One structured shape covers both comment mechanisms a real spreadsheet uses: xlsx's legacy single notes (text/author/createdAt, replies absent) and its newer threaded comments (root text plus a flat replies array -- a reply never carries replies of its own). A legacy note is simply a comment whose replies stay absent, so no union or discriminant is needed. The field is optional on ContentSheetCellSchema, existing documents validate unchanged, and CONTENT_FORMAT_VERSION stays 3.
|
🎉 This PR is included in version 3.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cells had no way to carry an annotation, so anything reading a spreadsheet with comments had nowhere to put them and silently dropped them on the floor. This adds an optional
commentfield toContentSheetCellSchema, one structured shape covering both mechanisms a real spreadsheet uses:xl/comments*.xml, ODF annotations):{ text, author?, createdAt? }withrepliesabsentxl/threadedComments/*.xml): the same root shape plus a flatrepliesarray of{ text, author? }-- a reply never carries replies of its own, matching how threaded comments actually nest in the source formatsNo union or kind discriminant is needed: a legacy note is simply a comment whose replies stay absent.
createdAtis an ISO 8601 date-time in the source format's own spelling and precision, present only when the source recorded one. Following the house precedent for temporal strings (ContentCellValueSchema's own wire-spelling contract), it is a stated contract rather than a validated format -- a regex would turn a producer not yet normalised to ISO 8601 into a hard parse failure.The field is optional, existing documents validate unchanged, and
CONTENT_FORMAT_VERSIONstays 3 (a compatible addition, not a bump).content-json-schema-defs.tsneeds no change -- it hand-transcribes only schemas behind the threez.custom()nodes, andContentSheetCellSchemais a realz.object(), so the publishedcontent-document.schema.jsonpicks the new field up automatically (verified in the generated output).Unblocks ExaDev/ooxml.js#53 (xlsx comment reading needs this field to land in).
Generated by Claude Code