Skip to content

fix(files): restore horizontal scroll in CSV and XLSX preview tables - #6550

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/csv-viewer-horizontal-scroll
Aug 11, 2026
Merged

fix(files): restore horizontal scroll in CSV and XLSX preview tables#6550
waleedlatif1 merged 3 commits into
stagingfrom
fix/csv-viewer-horizontal-scroll

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • CSV/XLSX previews lost horizontal scroll and compressed every column into a vertical stack of letters
  • improvement(files): match CSV/XLSX preview tables to the markdown table chrome #6125 moved the previews onto the markdown table chrome, which gave both surfaces width: 100%. Right for prose, wrong for data — a CSV with dozens of columns divides the frame between them, and since that change also added overflow-wrap: anywhere, each column could break to a single character. The table never exceeded its frame, so overflow-x-auto had nothing to scroll
  • Split sizing out of the shared rule: prose tables keep width: 100%; preview tables get width: max-content; min-width: 100% and scroll
  • Bounded preview columns (min-width: 80px, max-width: 320px) so no column collapses to a sliver and one long value wraps instead of pushing the rest off-screen. 80px matches the tables grid's COL_WIDTH_MIN; 320px matches the capped content width used elsewhere in the app
  • Chrome (borders, padding, typography, header fill) stays shared — improvement(files): match CSV/XLSX preview tables to the markdown table chrome #6125's actual goal is preserved

Affects all three DataTable consumers: the CSV preview, the inline CSV path in preview-panel, and the XLSX preview.

Type of Change

  • Bug fix

Testing

Two tests added to document-table.test.ts, both confirmed to fail when the CSS is reverted. Full file-viewer suite passes (697 tests).

jsdom does no table layout, so the tests only assert the declarations resolve. Verified the actual layout separately in headless Chromium against a 16-column CSV:

header row heighttable vs framescrolls
before137px1202 / 1202no
after41px2575 / 1217yes
after, 3 columns41px1217 / 1217no (fills frame)

Not yet exercised in the running app against a real uploaded CSV.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

#6125 moved the preview tables onto the markdown table chrome and gave both
surfaces `width: 100%`. That is right for prose and wrong for data: a CSV with
dozens of columns divides the frame between them, and since the same change
added `overflow-wrap: anywhere`, every column was free to break down to a single
character — so headers rendered as vertical columns of letters and the table
never exceeded its frame, leaving `overflow-x-auto` with nothing to scroll.
Split sizing out of the shared rule. Prose tables keep `width: 100%`; preview
tables size to their content and scroll, with column bounds so no column
collapses to a sliver and one long value wraps instead of pushing the rest
off-screen. Chrome (borders, padding, typography, header fill) stays shared.
@vercel

vercelBot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
docsSkippedSkippedAug 11, 2026 7:44pm

Request Review

@cursor

cursorBot commented Aug 11, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Scoped CSS and test updates in the file viewer preview path; no auth, data, or API changes.

Overview
Fixes CSV/XLSX preview tables that stopped scrolling horizontally and crushed wide sheets into single-character columns after shared markdown table styling applied width: 100% to both surfaces.

document-table.css now splits layout from shared chrome: markdown tables still use width: 100%, while .document-table previews use width: max-content and min-width: 100% so the table can grow past the viewer and overflow-x-auto on DataTable can scroll. Preview cells also get min-width: 80px and max-width: 320px so columns do not collapse or let one value dominate the row.

document-table.test.ts adds coverage that prose vs preview width rules differ and that preview column bounds resolve as expected.

Reviewed by Cursor Bugbot for commit c9e8174. Configure here.

@greptile-apps

greptile-appsBot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR restores horizontal scrolling for CSV and XLSX previews while retaining shared visual styling with markdown tables.

  • Separates prose-table and preview-table sizing rules.
  • Sizes preview tables to their content while keeping narrow tables frame-width.
  • Bounds preview column widths and adds declaration-level regression tests.
  • Moves horizontal scrolling responsibility to each preview’s bounded parent container.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

FilenameOverview
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/data-table.tsxRemoves the nested horizontal scroll container so existing bounded preview containers own both-axis scrolling.
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/document-table.cssSeparates prose and preview sizing, using content-width preview tables and bounded columns without changing shared table chrome.
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/document-table.test.tsAdds regression assertions for the distinct table sizing and preview column bounds.

Reviews (4): Last reviewed commit: "fix(files): correct a stale reference to..." | Re-trigger Greptile

@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@greptile

@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@cursor review

…ones
DataTable owned `overflow-x-auto` while its caller owns the vertical scroll, so
now that preview tables are actually wider than the frame the horizontal
scrollbar rendered at the foot of the table rather than at the bottom of the
viewport — up to 1,000 rows below it for the two callers whose container is a
plain block (xlsx-preview, preview-panel). csv-table-preview escaped it only
because its flex column compressed the wrapper to the frame height.
Drop the inner overflow so the caller's bounded container scrolls both axes.
All three callers now place the scrollbar at the viewport bottom.
@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@greptile

@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@cursor review

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2068d9a. Configure here.

The sizing comment still credited `.document-table`'s own `overflow-x-auto`
for the horizontal scroll, which the previous commit removed in favour of the
caller's container.
@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@greptile

@waleedlatif1
waleedlatif1 merged commit bd91ab7 into stagingAug 11, 2026
44 of 49 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/csv-viewer-horizontal-scroll branch August 11, 2026 20:06
Sign up for freeto 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

@waleedlatif1