Skip to content

feat: inline data file viewer for tabular data#95

Draft
dimavedenyapin wants to merge 4 commits intomainfrom
task/zfcsmfcm5kv4titdotlewf6u
Draft

feat: inline data file viewer for tabular data#95
dimavedenyapin wants to merge 4 commits intomainfrom
task/zfcsmfcm5kv4titdotlewf6u

Conversation

@dimavedenyapin
Copy link
Copy Markdown
Contributor

Summary

  • Inline data file previews in agent chat: when a tool call reads/writes a CSV, JSON, Excel, or TSV file, an interactive table automatically renders below the tool call
  • Fullscreen dialog with search/filter, column sorting, and expanded row limits (5000 rows)
  • Smart attachment handling: tabular file attachments open in the built-in viewer instead of the OS default app
  • File parsing in main process via papaparse (CSV/TSV) and xlsx (Excel), keeping the renderer thread fast

Data File Preview

Architecture

Layer Change
Main process New fileViewer:readTabularFile and fileViewer:getFileInfo IPC handlers + attachments:resolvePath
Preload Exposed fileViewer and attachments.resolvePath namespaces
Renderer New DataFilePreview (inline) and DataFileDialog (fullscreen) components
AgentTranscriptPanel Auto-detects tabular files in ToolCallMessage tool inputs
TaskAttachments Routes tabular file clicks to DataFileDialog

Supported Formats

CSV, TSV, JSON, JSONL, XLSX, XLS (Parquet placeholder for future)

Screenshot generated with Remotion

The PR screenshot above was rendered programmatically using Remotion (scripts/remotion/).

Test plan

  • Attach a CSV file to a task → click it → DataFileDialog opens with sortable table
  • Run agent that reads a .csv file → inline DataFilePreview appears in chat transcript
  • Click "View full table" or expand icon → fullscreen dialog opens
  • Sort columns by clicking headers, verify sort order toggles
  • Attach a .json array file → verify it opens in data viewer
  • Attach a .xlsx file → verify Excel parsing works
  • Verify non-tabular files (.pdf, .png) still open with OS default app

🤖 Generated with Claude Code

dimavedenyapin and others added 4 commits March 9, 2026 20:30
Add DataFilePreview and DataFileDialog components that detect tabular files
(CSV, JSON, JSONL, TSV, Excel) in agent tool calls and task attachments,
rendering interactive inline table previews with sort, filter, and fullscreen
expansion. Parsing is handled in the main process via papaparse and xlsx.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the agent writes a .py file containing marimo markers (`import marimo`,
`@app.cell`, `marimo.App`), the transcript auto-detects it and shows a
MarimoEmbed component with Run/Edit buttons. Clicking Run spawns a local
`marimo run --headless --no-token` server and embeds the live notebook in
an iframe inline in the chat, with fullscreen expansion support.

- marimo-server.ts: manages marimo process lifecycle (launch, stop, cleanup)
- MarimoEmbed.tsx: inline component with run/edit/fullscreen/stop controls
- Detection: content-based (tool input/output) + async disk fallback
- Graceful handling when marimo is not installed (shows install instructions)
- All marimo servers cleaned up on app quit

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…el, lockfile

Integrated main's shutdown refactor (shutdownAppServices) with marimo cleanup,
and merged deriveToolSubtitle with marimo/tabular detection in ToolCallMessage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dimavedenyapin dimavedenyapin marked this pull request as draft April 19, 2026 04:11
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