Skip to content

feat: support the csv and svg formats - #204

Merged
Mearman merged 1 commit into
mainfrom
feat/csv-svg-formats
Aug 17, 2026
Merged

feat: support the csv and svg formats#204
Mearman merged 1 commit into
mainfrom
feat/csv-svg-formats

Conversation

@Mearman

@Mearman Mearman commented Aug 17, 2026

Copy link
Copy Markdown
Member

documents.js 2.1.0 added csv and 2.2.0 added svg to the DocumentFormat union, which broke this app's build: the exhaustive content-reader switch in src/rpc/router.ts (TS2366) no longer covered every format. This PR carries the documents.js 2.3.0 bump together with the csv/svg handling that bump requires, so it supersedes the three open sibling-dependency-update bump PRs (#201, #202, #203), each of which carries the bump alone and fails CI for the same reason.

What changes here:

  • content.read decodes csv/svg bytes as text and hands them to readCsvContent/readSvgContent (both take a string, the same path markdown has always taken) instead of routing through decodeDocumentPackage.
  • Extension detection: .csv and .svg filenames now auto-detect in the extension table, so uploads land in the right format and Recent Files records them.
  • Convert previews: csv routes to the sheet data grid (readCsvContent yields a spreadsheet-kind ContentDocument, the same variant xlsx/ods preview through) and svg to the pages/shapes/vectors renderer (readSvgContent yields drawing-kind, the same variant odg previews through).
  • Format pickers and the conversion matrix need no changes: they are driven by DOCUMENT_FORMATS and the engine's own conversions list, which already carry both formats — the app only ever advertises pairs createLocalDocumentConverter() actually declares (csv and svg convert to/from every format except a pdf-to-odf-style gap: there is no *-to-odf target, which the To-picker already renders as disabled rather than advertising).

Fonts and metadata behave as they do for the other plain-text formats: readDocumentMetadata works for both, and the embedded-fonts tool rejects them with the same named error it already gives markdown/pdf/xlsx/odf.

Generated by Claude Code

documents.js 2.1.0 added csv and 2.2.0 added svg to the DocumentFormat
union, so the exhaustive content-reader switch in the RPC router no
longer compiled. Adopt documents.js 2.3.0 and wire both formats into
every place the app enumerates formats:

- content.read decodes csv/svg bytes as text (both readers take a
  string, like markdown's) instead of a document package
- .csv and .svg filenames now auto-detect, so uploads and Recent Files
  carry the formats
- csv previews through the sheet grid (readCsvContent yields a
  spreadsheet-kind ContentDocument) and svg through the drawing
  renderer (readSvgContent yields drawing-kind)
- the format pickers and conversion matrix need no changes: they are
  driven by DOCUMENT_FORMATS and the engine's own conversion list,
  which already include both formats
@Mearman
Mearman merged commit c38bdfb into main Aug 17, 2026
7 checks passed
@Mearman
Mearman deleted the feat/csv-svg-formats branch August 17, 2026 20:19
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