Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.8k
fix(files): restore horizontal scroll in CSV and XLSX preview tables#6550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+55
−4
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
c9e8174
fix(files): restore horizontal scroll in CSV and XLSX preview tables
waleedlatif1 2068d9a
fix(files): scroll preview tables from one container, not two nested …
waleedlatif1 50b75b4
fix(files): correct a stale reference to the removed inner overflow
waleedlatif1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
6 changes: 5 additions & 1 deletion
6 apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/data-table.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
31 changes: 28 additions & 3 deletions
31 apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/document-table.css
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2,8 +2,10 @@ | ||
| * Canonical table chrome for the file viewer. Both surfaces that render a table for a file — the | ||
| * rich markdown editor (`.rich-markdown-prose table`) and the tabular previews CSV/XLSX render | ||
| * through `DataTable` (`.document-table`) — share this one definition so a table looks the same | ||
| * whichever file it came from. Editor-only concerns (prose block margin, fixed layout for column | ||
| * resizing, cell paragraph reset) stay in rich-markdown-editor.css. | ||
| * whichever file it came from. Chrome is shared; *sizing* is not — prose fits the document width | ||
| * while a preview sizes to its data and scrolls (see the two rules below). Editor-only concerns | ||
| * (prose block margin, fixed layout for column resizing, cell paragraph reset) stay in | ||
| * rich-markdown-editor.css. | ||
| */ | ||
| /* `overflow-wrap` matches what `.rich-markdown-prose` sets on its own root: cells hold arbitrary | ||
| @@ -15,11 +17,34 @@ | ||
| .rich-markdown-prose table, | ||
| .document-table table { | ||
| width: 100%; | ||
| border-collapse: collapse; | ||
| overflow: hidden; | ||
| } | ||
| .rich-markdown-prose table { | ||
| width: 100%; | ||
| } | ||
| /* A preview table is data, not prose. A CSV can carry dozens of columns, so sizing the table to the | ||
| frame (`width: 100%`) divides that frame between them and — with `overflow-wrap: anywhere` able to | ||
| break every column down to one character — renders each header a vertical column of letters. | ||
| `max-content` sizes columns to their values and lets the table exceed the frame, which the | ||
| caller's own scroll container then scrolls; `min-width: 100%` keeps a narrow table filling the | ||
| frame rather than hugging the left edge. */ | ||
| .document-table table { | ||
| width: max-content; | ||
| min-width: 100%; | ||
| } | ||
| /* Bounds for a content-sized column: no column collapses to a sliver, and one long value (a URL, a | ||
| pasted paragraph) wraps at `max-width` instead of pushing every other column off-screen. 80px is | ||
| the tables grid's own `COL_WIDTH_MIN`; 320px is the capped content width used across the app. */ | ||
| .document-table th, | ||
| .document-table td { | ||
| min-width: 80px; | ||
| max-width: 320px; | ||
| } | ||
waleedlatif1 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| .rich-markdown-prose th, | ||
| .rich-markdown-prose td, | ||
| .document-table th, | ||
22 changes: 22 additions & 0 deletions
22 apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/document-table.test.ts
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
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.