feat(x): local spreadsheet create/edit tools + in-app read-only viewer - #843
Open
hrsvrn wants to merge 4 commits into
Open
feat(x): local spreadsheet create/edit tools + in-app read-only viewer#843hrsvrn wants to merge 4 commits into
hrsvrn wants to merge 4 commits into
Conversation
Adds assistant-driven spreadsheet editing and an in-app grid viewer: - New builtin tools spreadsheet-create / spreadsheet-edit (.xlsx/.csv): create workbooks from row data; setCells/setRange/appendRows/clearRange plus add/remove/rename sheets via an ops array applied in one atomic write. CSV enforces single-sheet semantics. file-boundary gated. - New core module packages/core/src/spreadsheet (shared by tools and the spreadsheet:load IPC): SheetJS via dynamic import, etag-guarded read-modify-write, single-entry parse cache, 50 MB cap, windowed reads. - files.writeBuffer: binary sibling of writeText (atomic, locked, etag). - Read-only SpreadsheetFileViewer (xlsx/xls/csv/tsv): sheet tabs, 500-row pages, 100-column cap, sticky headers, error fallback to OS open. - Chat file cards for spreadsheets open in-app; viewer auto-opens on assistant create/edit and refreshes in place via a spreadsheet-touched window event (workspace watcher only covers allowlisted roots) plus workspace:didChange where available. Known v1 limits: SheetJS community write drops cell styles on edited files; values are literals (no formula authoring); external-app edits outside watched roots refresh on reopen, not live.
…s-and-viewer # Conflicts: # apps/x/apps/renderer/src/App.tsx # apps/x/apps/renderer/src/lib/file-types.ts # apps/x/packages/core/src/runtime/tools/catalog.test.ts # apps/x/packages/core/src/runtime/tools/catalog.ts
Make spreadsheets first-class citizens in the workspace: - Formatted display values: spreadsheet:load returns SheetJS formatted text alongside raw values, so dates/currency/percent render as Excel shows them (no more raw date serials); raw types keep numeric alignment. - In-sheet find: new spreadsheet:find IPC scans the active sheet in the main process; viewer find bar (Ctrl+F) with match count, amber highlights, cross-page next/prev cycling and smooth scroll-to-match. - Pinned header row (default on): row 1 rides along on every window and stays under the column letters while paging; body pages cover rows 2+. - Cell selection + copy: click / shift-click range selection, Ctrl+C or value-bar button copies display values as TSV; the value bar shows the selected address and full untruncated cell content. - Go-to-row input in the footer. - Per-file view state (sheet/page/pin) restored on reopen (in-memory LRU). - Workspace search covers spreadsheets: filename matching for xlsx/xls/csv/tsv plus content grep for csv/tsv. - Chat @-mentions offer spreadsheets via a separate mentionable list (wiki links and the graph stay markdown-only); mention attachments carry the real spreadsheet mimeType; ensureMarkdownExtension no longer appends .md to media paths. - Tree context menu: "Open in System App" for spreadsheet files. - Fluid animations: find/value bars slide+fade in, grid cross-fades on page/sheet change, smooth scroll on jumps, color transitions on cells, buttons and tabs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s-and-viewer # Conflicts: # apps/x/apps/renderer/src/App.tsx
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.
What this does
Rowboat could only read spreadsheets (
parseFile→ CSV text) and clicking a spreadsheet file card kicked you out to the OS app. This PR adds assistant-driven editing of local spreadsheets plus a read-only in-app viewer that opens and refreshes automatically as the assistant works.New builtin tools
spreadsheet-create— create.xlsx/.csvworkbooks from row data (multi-sheet for xlsx, single-sheet enforced for CSV), with anoverwriteguard.spreadsheet-edit— an ops array applied in one atomic write:setCells(A1 → value map),setRange,appendRows,clearRange,addSheet,removeSheet,renameSheet. Sheet ops on CSV return a clear error.Both are
file-boundarygated (same permission flow as the other file-writing tools) and return an error envelope instead of throwing.Core
packages/core/src/spreadsheet/used by both the tools and the viewer IPC: SheetJS loaded via the dynamic-import pattern so esbuild can't inline it, etag-guarded read-modify-write for conflict detection, a single-entry parse cache, a 50 MB parse cap, and windowed sheet reads.files.writeBuffer— binary sibling ofwriteText(atomic temp+rename, file lock, etag support).Viewer
SpreadsheetFileViewerrenders.xlsx/.xls/.csv/.tsvas a grid: sticky A/B/C column headers and row numbers, sheet tabs, 500-row pages with a pager, 100-column cap with a notice, and an "Open in system app" escape hatch (also the error fallback).spreadsheet:loadIPC channel — never the whole workbook.workspace:didChangealone isn't enough) plusworkspace:didChangewhere it does fire.Known v1 limits
Testing
spreadsheet.test.ts,files.test.ts): xlsx/CSV roundtrips incl. quoting, every op, empty-sheet append, etag conflict + cache behavior, window slicing boundaries, CSV sheet-op rejection.npm run deps,npm run lint,npm run typecheckclean.