Skip to content

Add CSV file previews - #520

Merged
SawyerHood merged 2 commits into
get-bb:mainfrom
georgecollier-nqu:bb/render-csv-previews-thr_7m3m4z7t83
Jul 7, 2026
Merged

SawyerHood merged 2 commits into
get-bb:mainfrom
georgecollier-nqu:bb/render-csv-previews-thr_7m3m4z7t83

Conversation

@georgecollier-nqu

@georgecollier-nqu georgecollier-nqu commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add CSV detection alongside the existing markdown/image/PDF preview routing
  • render CSV text previews as a scrollable table with row numbers, sticky headers, fixed-width columns, and truncation for long cell values
  • keep the existing Preview/Raw toggle behavior and copy labeling for CSV files
  • add focused unit coverage and a Ladle story for the CSV preview path
CleanShot 2026-07-07 at 15 54 58@2x

@georgecollier-nqu
georgecollier-nqu marked this pull request as ready for review July 7, 2026 14:56
@georgecollier-nqu georgecollier-nqu changed the title [codex] Add CSV file previews Add CSV file previews Jul 7, 2026
- Give the CSV table a single scroll container that owns both axes
  (full-height layout like iframe previews). Fixes the sticky gutter
  painting over the panel header, the unreachable horizontal
  scrollbar, and the header row not sticking on vertical scroll.
- Contain overscroll so panning a wide table past its edge doesn't
  arm the browser back/forward gesture.
- Add a .persistent-scrollbar utility: reset scrollbar-width/color so
  Chromium honors ::-webkit-scrollbar and renders always-visible
  classic scrollbars instead of fading macOS overlay bars.
- Count data rows (not header) in the truncation footnote and only
  name the truncated dimension; stop parsing at the row cap so huge
  files only pay for the previewed prefix.

Co-Authored-By: Claude Fable 5 <[email protected]>
@SawyerHood

Copy link
Copy Markdown
Collaborator

LGTM! There were a few quirks:

  • The left column would break out of the CSV viewer
  • The horizontal scrollbar was very flaky on mac for me

I patched these up and will merge

@SawyerHood
SawyerHood merged commit 72f3c4f into get-bb:main Jul 7, 2026
5 checks passed
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.

2 participants