Skip to content

feat(renderer): inline CSV table rendering #485

@nesquena-hermes

Description

@nesquena-hermes

Summary

Data analysis tasks frequently produce CSV output — query results, exported data, computed tables. Rendering CSV inline as a styled, scrollable HTML table is far more readable than raw comma-separated text and more useful than a file download.

Proposed behavior

Two triggers:

1. MEDIA: CSV filesMEDIA:/tmp/results.csv renders as a table instead of a download link.

2. Fenced csv blocks```csv fenced blocks render as tables inline.

Rendered table features:

  • First row treated as header (<th>)
  • Horizontally scrollable container (handles wide tables)
  • Compact row height
  • Numbers right-aligned, text left-aligned (auto-detected)
  • Row count shown in header: "results.csv · 142 rows"
  • "Download CSV" button in the header
  • Rows truncated at 50 with a "Show all" toggle for large files

Security

CSV content is parsed with a simple splitter (handling quoted fields), not innerHTML'd — all cell values pass through esc(). No XSS surface.

Files involved

  • static/ui.js — CSV parser (~30 lines), table renderer, MEDIA restore block
  • static/style.css.msg-csv-table styles

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrendererIssues related to the markdown/content renderersprint-candidateStrong candidate for next sprintuxUser experience / visual polish

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions