Repository navigation
feat(editor): open spreadsheets and Word documents (xlsx/csv editable, docx preview) - #20363
excellence-wh wants to merge 12 commits into
Conversation
…tion - add [email protected] (renderer dev dependency; passes the 4320h supply-chain policy on the full 1391-entry lockfile) - add shared spreadsheet extension/mime classification (.xlsx/.xls) - add a normalized SpreadsheetData model + exceljs-backed xlsx parse/serialize (round-trips the cell grid and worksheet names; formulas read as cached results, formatting intentionally dropped) - 5 unit tests covering parse, sparse-cell normalization, invalid-buffer rejection and serialize round-trips
… SSH) - classify .xlsx/.xls as previewable spreadsheets on both the local (filesystem read/write handlers) and relay/SSH (fs-handler) read paths, delivering the raw bytes as base64 with an isSpreadsheet marker instead of the generic "binary cannot display" empty blob; adds isSpreadsheet to the FileContent type - base64 write-back: fs:writeFile accepts an encoding option (local writes the decoded buffer; SSH routes through the existing SFTP writeFileBase64), so an edited workbook can return to disk - share mime classification via resolvePreviewableBinaryMime; move readFullStreamChunk into fs-handler-stream-chunk so fs-handler-file-read stays under the 300-line limit - node typecheck + oxlint clean; existing fs-handler-file-range tests pass
- add an editable, virtualized SpreadsheetFileSurface grid for both formats: CSV keeps the text-draft path (Cmd+S / autosave / dirty indicator work unchanged via serialized drafts); XLSX renders a worksheet-tab grid and saves through the editor save pipeline with encoding='base64' - thread an optional encoding through the editor save target -> autosave controller -> save queue -> writeRuntimeFile -> fs:writeFile, so a binary workbook returns to disk (local writes the decoded buffer, SSH reuses the existing SFTP writeFileBase64) - wire EditorEditFileSurface: isSpreadsheet files render the grid; CSV rich mode switches from the read-only CsvViewer to the editable grid - preload fs type gains isSpreadsheet + writeFile encoding - i18n keys for Save/Saving/read-failed/save-failed across en/zh/ja/ko/fr/es - tests: 3 csv-serialize round-trip cases; node+web typecheck and oxlint clean
excel-xlsx.ts used Buffer.from for base64 decode/encode; the renderer has no global Buffer, so every xlsx open threw 'Buffer is not defined' and the grid showed a generic read-failed message. Encode/decode with atob/btoa + Uint8Array, which are available in both Node >= 16 and browsers, so the shared module round-trips identically in node (tests) and the renderer (exceljs browser build). Verified in-app: parsing a real xlsx returns the grid. Also log the underlying parser error to the console for diagnosis.
Add a read-only .docx preview so Word documents open in the editor instead of falling back to the generic 'binary file' state, mirroring the existing image/PDF preview pattern. - classify .docx in the shared office-file-extensions and both read paths (local fs:readFile + SSH relay) so the blob arrives as base64 content with a new isOfficeDocument flag, keeping isImage/isSpreadsheet single-valued - render with docx-preview (MIT) in a lazy OfficeDocumentViewer; the viewer decodes base64 with atob (no global Buffer in the renderer) and renders pages into a scrollable, read-only surface - thread isOfficeDocument through FileContent, the preload read type, and the relay StreamMetadata - tests: 4 cases covering the image/spreadsheet/office/plain classification; i18n keys (loading + read-failed) across en/zh/ja/ko/fr/es; node+web typecheck and oxlint clean
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe editor classifies spreadsheet and Office files during file reads. It adds normalized spreadsheet parsing, CSV serialization, editable CSV/XLSX views, and read-only DOCX rendering. The save pipeline supports UTF-8 and base64 content for local and SSH-backed files. New tests cover MIME classification, CSV serialization, XLSX parsing and serialization, encoded saves, and DOCX link filtering. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The updated runtime save routing preserves separate base64 and text write paths with targeted tests. No unresolved merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 396725f0-4750-4321-bf00-f3b5ff2bec10
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (33)
package.jsonsrc/main/ipc/filesystem/filesystem-read-handlers.tssrc/main/ipc/filesystem/filesystem-write-handlers.tssrc/preload/api/filesystem-api.tssrc/relay/fs-handler-classify.test.tssrc/relay/fs-handler-file-range.test.tssrc/relay/fs-handler-file-range.tssrc/relay/fs-handler-file-read.tssrc/relay/fs-handler-stream-chunk.tssrc/relay/fs-handler-utils.tssrc/renderer/src/components/editor/EditableSpreadsheetGrid.tsxsrc/renderer/src/components/editor/EditorEditFileSurface.tsxsrc/renderer/src/components/editor/OfficeDocumentViewer.tsxsrc/renderer/src/components/editor/SpreadsheetFileSurface.tsxsrc/renderer/src/components/editor/csv-serialize.test.tssrc/renderer/src/components/editor/csv-serialize.tssrc/renderer/src/components/editor/editor-autosave-controller.tssrc/renderer/src/components/editor/editor-autosave.tssrc/renderer/src/components/editor/editor-lazy-views.tssrc/renderer/src/components/editor/editor-panel-content-types.tssrc/renderer/src/components/editor/editor-save-queue.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/runtime/runtime-file-mutation-client.tssrc/shared/office-file-extensions.tssrc/shared/spreadsheet-file-extensions.tssrc/shared/spreadsheet/excel-xlsx.test.tssrc/shared/spreadsheet/excel-xlsx.tssrc/shared/spreadsheet/spreadsheet-data.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
- save queue: a base64 (workbook) save writes the caller's payload instead of a stale text draft, which would have corrupted the file on disk; regression test covers the existing-draft case - xlsx surface: keep the external-change banner on editable workbooks so a changed-on-disk file still warns before saving stale content - csv: re-serialize with the delimiter detected at load time rather than re-detecting against an empty string (a tab-delimited file no longer rewrites with commas) - csv: keep edited fields as raw text; numeric coercion rewrote identifiers like `00123` as `123` and dropped trailing zeros - xlsx save: only clear dirty when no edit landed during the async write - classification: drop `.xls` until BIFF parsing exists — it opened empty and then overwrote the file on save - parser: flatten rich-text runs, keep error cell values, and preserve blank rows so later row indices do not shift
|
Addressed in 71b3e55 — each item mapped to its fix:
Verification: |
|
On the two remaining pre-merge warnings: Linked Issues check — the Docstring coverage — this repo's |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 1730b849-21fe-47f9-9597-596799f6ab75
📒 Files selected for processing (7)
src/renderer/src/components/editor/EditorEditFileSurface.tsxsrc/renderer/src/components/editor/SpreadsheetFileSurface.tsxsrc/renderer/src/components/editor/editor-save-queue.test.tssrc/renderer/src/components/editor/editor-save-queue.tssrc/shared/spreadsheet-file-extensions.tssrc/shared/spreadsheet/excel-xlsx.test.tssrc/shared/spreadsheet/excel-xlsx.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- src/shared/spreadsheet/excel-xlsx.ts
- src/shared/spreadsheet-file-extensions.ts
- src/renderer/src/components/editor/SpreadsheetFileSurface.tsx
- src/renderer/src/components/editor/editor-save-queue.ts
- src/renderer/src/components/editor/EditorEditFileSurface.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
|
Done in 5612e02 — the serialize round-trip test now asserts |
There was a problem hiding this comment.
Caution
This PR renders untrusted .docx content with docx-preview's default options, so renderAltChunks stays enabled and document-supplied HTML runs in an unsandboxed same-origin iframe. A crafted document can execute script on open inside the renderer, where the preload bridge exposes api/electron and the main renderer sets no CSP. The inline comment on OfficeDocumentViewer.tsx carries the details and a one-line fix — please treat it as a merge blocker.
Reviewed changes
- Shared classification + read path — new
SPREADSHEET_FILE_MIME_TYPES/OFFICE_DOCUMENT_FILE_MIME_TYPESmaps plus a sharedresolvePreviewableBinaryMime; the single-shot IPC, streamed relay, and preload read paths now emitisSpreadsheet/isOfficeDocumentalongside base64 content. - Binary write path —
fs:writeFilegainsencoding: 'base64'; local writes useBuffer, SSH writes useprovider.writeFileBase64, base64 saves bypasseditorDrafts, and remote-runtime writes throw. - Renderer surfaces — lazy
SpreadsheetFileSurface+EditableSheetGrid(editable grid with sheet tabs and Save for xlsx; CSV through the normal text-draft/autosave path) and a read-onlyOfficeDocumentViewerfor.docx. - Shared xlsx codec —
excel-xlsx.tsparses/serializes viaexceljswithout the globalBuffer, with unit tests for parse/serialize, CSV serialization, and the classification helper.
ℹ️ Saving an .xlsx silently strips formulas, formatting, and merged cells
The grid round-trips only cell values: normalizeCellValue reads the cached formula result and serializeXlsxWorkbook writes plain values. A user who opens a real workbook, edits one cell, and clicks Save therefore destroys every formula, style, and merged-cell layout in the file with no warning. The PR description and the excel-xlsx.ts header both disclose this, but the Save affordance itself gives no signal that it is lossy.
Technical details
# Lossy `.xlsx` save with no user warning
## Affected sites
- `src/shared/spreadsheet/excel-xlsx.ts` — parse keeps only the cached formula result; serialize writes plain values, dropping formulas/styles/merges.
- `src/renderer/src/components/editor/SpreadsheetFileSurface.tsx:298` — the grid exposes an unconditional Save button.
## Required outcome
- Decide whether a destructive first save is acceptable. If not, warn/confirm before writing a workbook that contained formulas or formatting, or preserve unsupported parts by re-writing only edited cells into the original package.
## Open questions for the human
- Is value-only xlsx round-tripping an intentional long-term contract for this surface, or a v1 limitation that should be surfaced in the UI?ℹ️ Nitpicks
- No automated test exercises the edit → save → reload round-trip for either grid, nor the
.docxrender path; the new tests cover only parse/serialize and classification. CsvVieweris no longer referenced byEditorEditFileSurfacebut is still exported fromeditor-lazy-views.ts, leaving a dead export.
openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Caution
The data-integrity fixes in 71b3e55a18 and 5612e02212 are correct, but the untrusted-.docx execution path flagged in the previous review is still untouched: OfficeDocumentViewer continues to call renderAsync with docx-preview defaults, so renderAltChunks stays enabled and a crafted document runs script on open in the unsandboxed same-origin iframe. The existing inline comment carries the one-line fix (renderAltChunks: false); please address it before merging.
Reviewed changes since e4ba7a1
- CSV delimiter round-trip —
LoadStatenow carries thedelimiterdetected at load;kindDelimiter/empty-content re-sniffing is gone, so a tab-delimited.csvstays tab-delimited on edit and save. - CSV numeric fidelity —
buildPatchRowsstores the raw edited string instead ofparseCellValue, so00123/1.50no longer normalize (and no longer reset the caret viaCellInput's value effect). .xlsdeclassified — removed fromSPREADSHEET_FILE_MIME_TYPES, since exceljs has no BIFF reader and the file would otherwise open as an empty sheet that could be saved over.- xlsx blank rows / rich text / errors —
parseXlsxWorkbookwalks the full row range (blank rows no longer shift later rows) andnormalizeCellValuehandlesrichTextruns and#DIV/0!-style.errorvalues. - Save durability — the grid tracks a revision so an edit during an in-flight xlsx write keeps the tab dirty;
editor-save-queue.test.tspins base64-vs-text content selection and the neweditor-save-queue.tsbranch. - External-change banner — the spreadsheet surface now renders
ExternalFileChangeBannerlike the other editor tabs.
The previously-flagged .xls, CSV-delimiter, and CSV-numeric findings are all resolved by these commits; the new tests cover the blank-row and rich-text/error cases with exact assertions.
openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
docx-preview renders `w:altChunk` HTML parts into an unsandboxed same-origin iframe (its `renderAltChunks` defaults on) and copies relationship targets into `href` verbatim, so a crafted .docx could run script on open inside the renderer, where the preload bridge is exposed. - pass `renderAltChunks: false` to `renderAsync` - after render, drop `href` values whose scheme is not http(s)/mailto; leading C0 control characters are stripped first so `\tjavascript:` cannot slip past - unit tests cover the scheme allow-list
|
Thanks — addressing each: Security (
The three other inline findings were already fixed in 71b3e55 (your review was written against e4ba7a1):
Lossy Test coverage nitpick — the grid's edit→save→reload path is covered indirectly (parse/serialize round-trip including blank rows, plus the save-queue encoding test); a full renderer-level grid test isn't practical in this environment (component tests here run through
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/runtime/runtime-file-mutation-client.ts (1)
51-55: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winUse
files.writeBase64for base64 saves on runtime environments.When an active runtime environment owns the worktree, XLSX saves reach this guard, throw, and show the user “Failed to save the spreadsheet.” The runtime RPC already exposes
files.writeBase64; dispatch the encoded payload through that method. Direct SSH routes correctly bypass this guard and use the filesystem provider’swriteFileBase64path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: a82bf66e-f0d0-4857-97cf-4ab46b4f6e55
📒 Files selected for processing (2)
src/renderer/src/components/editor/OfficeDocumentViewer.test.tssrc/renderer/src/components/editor/OfficeDocumentViewer.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
A base64 (binary workbook) save on a worktree owned by a remote runtime environment hit the text-only guard and threw, so the user saw "Failed to save the spreadsheet". Route the payload through the runtime's existing `files.writeBase64` mutation; direct SSH already used the filesystem provider's `writeFileBase64`. Tests pin base64 -> files.writeBase64 and text -> files.write routing.
|
Fixed in ae02dc1 — thanks, good catch.
New test pins the routing: base64 → |
There was a problem hiding this comment.
Important
2257fb9 closes the altChunk auto-execution path, but the hyperlink sanitizer added alongside it can be bypassed. Browsers remove ASCII tab/newline from a URL anywhere in the input, while isSafeLinkTarget only strips leading control characters, so a .docx relationship target of jav\tascript:alert(1) survives sanitization and resolves to javascript:alert(1) when clicked. The one-line fix is inline.
Reviewed changes
- Disabled
docx-previewaltChunks —renderAltChunks: falseremoves the unsandboxedsrcdociframe that let a crafted document run script on open. - Added hyperlink sanitization —
sanitizeLinkTargetswalks the rendered anchors and strips any target whose scheme is nothttp/https/mailtovia the new exportedisSafeLinkTarget. - Added unit tests —
OfficeDocumentViewer.test.tscovers script-capable schemes, allowed schemes, and relative/fragment links.
openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The new files.writeBase64 routing sends runtime spreadsheet saves into the host's create-only base64 writer, so editing an existing .xlsx and saving on a runtime environment fails with EEXIST. The added test asserts only which method is chosen, so it passes while the actual overwrite path is broken.
Reviewed changes since 2257fb9
- Routed base64 saves through the runtime RPC —
writeRuntimeFilenow dispatchesencoding: 'base64'payloads tofiles.writeBase64instead of throwing "not supported yet" (the behavior CodeRabbit flagged onruntime-file-mutation-client.ts). - Added a dispatch test —
runtime-file-mutation-client.test.tspins base64 →files.writeBase64withcontentBase64, and text →files.write, for a remote runtime context.
openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
Saving an existing .xlsx failed with EEXIST whenever the write landed on a
create-only base64 writer: the runtime host resolved its own worktree to local
and took writeFile(..., { flag: 'wx' }), and the SSH provider's writeFileBase64
mapped to SFTP `exclusive`. Both call sites serve saves as well as upload
staging, so the binary path contradicted the text path, which overwrites.
Create-only stays the default and saves opt in:
- `FileBase64WriteOptions { overwrite }` on IFilesystemProvider's
writeFileBase64/writeFileBase64Chunk, honoured by the SSH provider as
`exclusive: !append && !overwrite`.
- writeFileExplorerFileBase64(-Chunk) passes overwrite, so uploads to a unique
staging name keep their semantics and the no-clobber guarantee stays where it
belongs, at commitFileExplorerUpload (COPYFILE_EXCL / provider copy).
- fs:writeFile's SSH branch passes overwrite for base64, matching its text
branch; the preload bridge now declares the `encoding` it already forwarded.
Tests write a real workbook twice and read it back, so the overwrite itself is
the assertion rather than the RPC method chosen; the chunked staging write still
replaces on the first chunk and appends after.
There was a problem hiding this comment.
ℹ️ No new issues in this commit — the base64 overwrite fix is clean. One earlier concern remains open: the
isSafeLinkTargetembedded-tab bypass inOfficeDocumentViewer.tsxis untouched here and still needs its one-line normalization fix before merge.
Reviewed changes
- Overwrite-capable base64 writes —
FileBase64WriteOptions { overwrite }added toIFilesystemProvider.writeFileBase64/writeFileBase64Chunk; the SSH provider derivesexclusive = !append && !overwrite, so create-only stays the default. - Saves opt in — runtime
writeFileExplorerFileBase64/-Chunkpassoverwritefor saves and the local branch dropswxforw/a, matching the text write above it. - Upload staging stays safe — staging writes keep their unique
.orca-upload-<nonce>/.incoming-<transferId>temp names, and no-clobber remains atcommitFileExplorerUpload(COPYFILE_EXCL/ provider copy), so relaxing the write flag does not let an upload clobber a real file. - Direct SSH save path —
fs:writeFile's base64 branch now passesoverwrite: true, matching its text branch; the preload bridge declares theencodingit already forwarded. - Tests — SFTP-flag mapping for the SSH provider, plus a runtime double-write that reads the workbook back, so the overwrite itself is the assertion rather than the RPC method chosen.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…them `isSafeLinkTarget` trimmed only leading control characters, so a relationship target with a tab, LF or CR inside the scheme (`java\tscript:alert(1)`) matched no scheme pattern and passed as a relative link, while the URL parser removes those characters from anywhere in its input and resolves it to `javascript:` — the anchor docx-preview renders would have run on click. Normalize tab/LF/CR out before reading the scheme, and assert the embedded-tab and embedded-CR spellings (of javascript: and data:) alongside the existing leading-whitespace cases.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior review (8b215b3), the single follow-up commit da9684d9a4 closes the last open security thread:
-
Normalized link targets the way the URL parser does —
isSafeLinkTargetnow strips ASCII tab/LF/CR from the whole string (href.replace(/[\t\n\r]/g, '')) before the leading-whitespace skip and scheme regex, sojava\tscript:alert(1)resolves tojavascript:and is rejected instead of passing on the raw attribute. -
Added regression tests —
OfficeDocumentViewer.test.tsnow assertsjava\tscript:,java\nscript:,jav\rascript:, andda\tta:are rejected, alongside the existing leading-control-char and allowed-scheme cases.
All prior Pullfrog review threads are now resolved. The remaining informational notes (lossy value-only .xlsx round-trip, remote-runtime orcad preview not classifying Office files) are disclosed scope decisions, not merge blockers.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
The changed-code quality gate failed on SpreadsheetFileSurface.tsx: a side-effecting call ran inside the setLoad updater (React may invoke an updater more than once, so the previous workbook must not be mutated), and the sheet tabs used an array index in their key. Move the cell write into spreadsheet-cell-edit.ts as setSpreadsheetCell, which returns a new workbook and leaves the one it was given untouched, and key the tabs by sheet name. Coercion and row/column growth are unchanged, and the CSV path still stores raw text. The extracted helper carries the unit tests the inline version could not: immutability, growth, per-sheet targeting, and the numeric-versus-text boundary.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior review (da9684d9a4), the single new commit e7bf4e42e0 is a behavior-preserving refactor:
- Extracted the cell-edit logic into
spreadsheet-cell-edit.ts—setSpreadsheetCell,cloneSpreadsheetData, andparseSpreadsheetCellValuenow live in a standalone module, so the xlsxsetLoadupdater and CSVbuildPatchRowsshare one pure clone-and-write path. - Added
spreadsheet-cell-edit.test.ts— 7 exact-assertion tests pin input-workbook immutability, out-of-extent growth, per-sheet targeting, deep row copies, and numeric/text coercion. - Simplified the sheet-tab key —
SpreadsheetToolbarkeys onsheet.namealone; still unique for real.xlsxand the single-sheet CSV path.
The extraction is genuinely behavior-preserving: the old setLoad updater already cloned (cloneData) before mutating, so this commit moves that logic rather than fixing it. The new tests pass locally (pnpm test src/renderer/src/components/editor/spreadsheet-cell-edit.test.ts — 7 passed). All prior review threads remain resolved.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
Orca's editor already previews images and PDFs. This change makes it open the everyday Office files too:
.xlsxand.csvopen in an editable spreadsheet grid, and.docxopens as a read-only rendered document — instead of falling back to the "binary file can't be displayed" state.What Changed
Read path (local + SSH relay)
src/shared/spreadsheet/(workbook/sheet/row/cell; string/number/boolean/null) and anexceljswrapper (excel-xlsx.ts) that parses and serializes xlsx..xlsxis now classified asisSpreadsheet,.docxasisOfficeDocument; both are delivered to the renderer as base64 content with the right MIME type. Classification lives in one helper (resolvePreviewableBinaryMime) so the single-shot and streamed SSH read paths agree.Buffer(the renderer has none) — base64 usesatob/btoa+Uint8Array.Write path
encoding: 'base64'target; local writes useBuffer, SSH writes reuse the existingprovider.writeFileBase64(SFTP). Binary writes bypasseditorDraftsand carry their content directly.Renderer
SpreadsheetFileSurface+EditableSpreadsheetGrid: a virtualized, editable grid with worksheet tabs and a Save action for.xlsx;.csvedits go through the normal text-draft pipeline (Cmd/Ctrl+S, autosave, dirty state). Both are lazy-loaded.OfficeDocumentViewer: read-only.docxrendering viadocx-preview(MIT), currently pages rendered into a scrollable surface.Other
en/zh/ja/ko/fr/es.Why
Opening a spreadsheet or a Word document is a common thing to do in a workspace, and today Orca shows nothing useful for either. This extends the existing previewable-binary pattern (images, PDFs) rather than adding a new subsystem: classify by extension, ship the blob as base64, render with a focused viewer.
.xlsxediting is a grid round-trip (formulas/formatting/merged cells are not preserved);.docxis preview-only by design.Scope:
.xlsx/.csveditable,.docxread-only..pptxis intentionally out of scope for this PR.Linked Issue
Fixes #20362
Visual Proof
BEFORE —
.xlsxand.docxfell back to the generic panel. This shot opens a legacy.doc(still unsupported) to show that same "binary file — cannot display" panel:AFTER —
.xlsxopens in the editable grid (worksheet header + Save button, cell editing), and.docxrenders as a document (CJK text and embedded images):.csvuses the same grid as.xlsx.Testing
pnpm typecheck— passpnpm build— pass (renderer + native)pnpm lint— code-quality / max-lines / i18n gates pass;verify:skill-bundle-manifestfails on this branch for a pre-existing, unrelated reason (resources/skills/*.jsonare stale on the base — noresources/skillschange in this PR)Automated tests: xlsx parse/serialize, CSV serialize, binary classification helper. (Full
pnpm testsuite was not run locally to completion.)Manually verified on Windows:
.xlsxopens in the grid and saves;.docxrenders (including CJK text); the read path returnsisOfficeDocument+ base64 through the real IPC.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Platforms actually exercised: Windows (local). SSH/remote paths share the same classification helper and existing base64 SFTP write, but were not manually exercised against a live remote in this session.
AI Disclosure
Implemented with an AI coding agent (Hermes Agent), driving edits, typecheck, build, and on-machine verification.
Agent skill upstream boundary
Notes
.xlsx/.docxloads the whole blob (same as the existing image/PDF preview behavior).Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)