feat: support the csv and svg formats - #204
Merged
Merged
Conversation
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
This was referenced Aug 17, 2026
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.
documents.js 2.1.0 added
csvand 2.2.0 addedsvgto theDocumentFormatunion, which broke this app's build: the exhaustive content-reader switch insrc/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:
readCsvContent/readSvgContent(both take a string, the same path markdown has always taken) instead of routing throughdecodeDocumentPackage..csvand.svgfilenames now auto-detect in the extension table, so uploads land in the right format and Recent Files records them.readCsvContentyields a spreadsheet-kindContentDocument, the same variant xlsx/ods preview through) and svg to the pages/shapes/vectors renderer (readSvgContentyields drawing-kind, the same variant odg previews through).DOCUMENT_FORMATSand the engine's ownconversionslist, which already carry both formats — the app only ever advertises pairscreateLocalDocumentConverter()actually declares (csv and svg convert to/from every format except apdf-to-odf-style gap: there is no*-to-odftarget, which the To-picker already renders as disabled rather than advertising).Fonts and metadata behave as they do for the other plain-text formats:
readDocumentMetadataworks 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