8000 Add first-class OpenDocument (ODF) package support by DominikPalo · Pull Request #5 · DominikPalo/OOXML-Toolkit · GitHub
[go: up one dir, main page]

Skip to content

Add first-class OpenDocument (ODF) package support - #5

Merged
DominikPalo merged 4 commits into
mainfrom
feature/odf-support
Oct 7, 2026
Merged

DominikPalo merged 4 commits into
mainfrom
feature/odf-support

Conversation

@DominikPalo
@DominikPalo DominikPalo commented Oct 7, 2026 •
Copy link
Copy Markdown
Owner

What

OpenDocument files (.odt, .ods, .odp, templates, …) already opened as plain ZIP packages. This PR makes them first-class: ODF has no relationships or content types, so the app now follows ODF's own conventions instead of showing empty OOXML views. This is "Tier 1" from the earlier ODP discussion — no slide/text/cell previews yet (those would be separate PRs).

Core (src/core)

  • New package/odf.ts: ODF media types, META-INF/manifest.xml parsing, meta.xml reading (title, author, keywords, dates, editing time, custom properties, statistics), manifest edit helpers, and the ODF package check.
  • Part media types come from the manifest (ODF has no [Content_Types].xml); the package analysis refreshes when the manifest changes.
  • mimetype is always written first and stored (it used to be deflated on save, which breaks ODF consumers) and is shown as text.
  • ODF package check: mimetype missing / not first / compressed / trailing whitespace / disagrees with the manifest; manifest missing; manifest lists a missing file; files not in the manifest; no content.xml; encrypted entries (info).

UI

  • Overview shows the meta.xml properties and statistics; main part is content.xml.
  • The explorer's Relations button becomes Manifest: every file entry with its media type, missing entries in red, unlisted files grouped under Not in manifest.
  • Part headers say "not in the manifest" instead of "no content type"; the meaningless Relationships tab is hidden for ODF.
  • Adding a part adds a manifest entry; renaming updates it (one undo step); the delete confirmation mentions the manifest.

Tests / docs

  • buildOdp fixture, tests/odf.test.ts, tests/odf-tree.test.ts; samples/sample.odp.
  • e2e smoke test opens a copy of sample.odp and checks metadata and the Manifest view.
  • README, user guide, CHANGELOG (Unreleased) and two new screenshots.

Notes for reviewers

  • main moved while this was in progress (Percent-encode and decode PartName in [Content_Types].xml #4, content-types percent-encoding), so the branch is rebased onto it (linear history, no merge commit) — the only conflicts were import lines in opc.ts and actions.ts.
  • Deleting a part leaves its manifest entry, consistent with how OOXML relationships are handled; the package check reports it.
  • Only existing screenshots were left untouched to avoid binary churn, so their tab bars don't show the new .odp tab.
  • Verified locally: typecheck, 153 unit tests, build, e2e smoke (13/13). Tested against the generated sample only, not yet against files saved by real LibreOffice.

🤖 Generated with Claude Code

@chatgpt-codex-connector
chatgpt-codex-connector Bot commented Oct 7, 2026 •
Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T08:44:23.322071Z 12de46e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

DominikPalo and others added 3 commits October 7, 2026 10:43
ODF files are ZIP + XML but have no relationships or content types.
Teach the core about their conventions:

- detect every ODF media type (also templates, master documents, charts,
  formulas, databases, images) and use content.xml as the main part
- parse META-INF/manifest.xml; derive part media types from it and refresh
  the package analysis when it changes
- read meta.xml (title, author, keywords, dates, statistics, custom
  properties) and turn it into overview rows
- package check: mimetype first / stored / no trailing whitespace / matches
  the manifest, manifest versus parts, encrypted entries
- helpers to add and rename manifest entries
- always store the mimetype entry uncompressed when writing a package
- show mimetype as text

Includes an ODP fixture builder, tests and samples/sample.odp.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- overview: properties and statistics from meta.xml, ODF-specific package
  check description
- explorer: a Manifest view replaces the empty Relations view for ODF, with
  missing and unlisted files marked
- part header: say "not in the manifest" instead of "no content type" and
  hide the Relationships tab, which has no meaning in ODF
- adding a part adds a manifest entry; renaming a part updates it (one undo
  step); the delete confirmation mentions the manifest

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- smoke test opens a copy of sample.odp and checks its metadata and the
  Manifest view
- two new screenshots (overview and manifest) taken from the real app
- README, user guide and changelog describe what works for ODF files and
  what does not (no slide / text / cell previews yet)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 12de46ea7b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/core/package/opc.ts Resolved
Comment thread src/core/package/odf.ts Resolved
Comment thread src/core/package/odf.ts Resolved
Comment thread src/core/package/odf.ts Resolved
Review feedback on the ODF support:

- A manifest, meta.xml or mimetype entry that cannot be read (bad CRC,
  unsupported compression) no longer aborts opening the document: the
  readers return nothing and the package check reports the damaged part.
- A manifest that is well-formed XML but not a manifest is reported
  (odf-manifest-invalid) instead of passing silently.
- mimetype must precede directory entries as well: the order is taken from
  the entries that will be written (PackageModel.entryOrder), not from the
  list of part names.
- Adding a manifest entry works for manifests that use the default
  namespace or bind it to another prefix: attributes get a prefix bound
  to the manifest namespace, declared on the new entry when there is none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@DominikPalo
DominikPalo merged commit 759c3df into main Oct 7, 2026
1 check 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.

1 participant

0