Skip to content

csv_preview: #7 Add single-line row displaying mode - #61127

Merged
Anthony-Eid merged 5 commits into
zed-industries:mainfrom
HalavicH:feat/csv-preview/add-single-line-mode
Jul 16, 2026
Merged

csv_preview: #7 Add single-line row displaying mode#61127
Anthony-Eid merged 5 commits into
zed-industries:mainfrom
HalavicH:feat/csv-preview/add-single-line-mode

Conversation

@HalavicH

@HalavicH HalavicH commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Changes

Adds a checkbox to toggle between multiline cells (current behavior) and single-line rows that clip overflow, so wide CSVs stay compact when full cell content isn't needed at a glance.

Demo

Before After
No single line mode image
image image

Testing

  • Toggle "Display multiline rows" off: cells clip to one line with ellipsis instead of wrapping
  • Toggle it back on: cells wrap and grow to show full content
  • Resize the window / change font size: single-line clip height tracks the actual text line height instead of a stale hardcoded value

Release Notes:

  • N/A

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jul 16, 2026
@HalavicH
HalavicH marked this pull request as ready for review July 16, 2026 17:46

@Anthony-Eid Anthony-Eid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Design wise I wonder if we want a context menu similar to editor's top right button here, specially if we start adding a lot of different options

Image

Note: this could/should be a follow up PR once we decide what we want

@Anthony-Eid Anthony-Eid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall this looks good to me, we just need to fix the initial row height calculation to get this mergable

Comment thread crates/csv_preview/src/csv_preview.rs Outdated
@HalavicH

Copy link
Copy Markdown
Contributor Author

Design wise I wonder if we want a context menu similar to editor's top right button here, specially if we start adding a lot of different options

Image Note: this could/should be a follow up PR once we decide what we want

Regarding context menu. I already covered that in future PRs where I moved it into the first row first column cell.

image image

fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
let theme = cx.theme();

let row_height = window.pixel_snap(window.line_height());

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

window.pixel_snap(window.line_height()) is functionally identical to git_graph's row_height()

@SomeoneToIgnore SomeoneToIgnore added the area:preview/csv Feedback for Zed's CSV support label Jul 16, 2026
@Anthony-Eid
Anthony-Eid added this pull request to the merge queue Jul 16, 2026
Merged via the queue into zed-industries:main with commit f688bee Jul 16, 2026
34 checks passed
@HalavicH HalavicH changed the title csv_preview: Add single-line row displaying mode csv_preview: #7 Add single-line row displaying mode Jul 28, 2026
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
### Changes

Adds a checkbox to toggle between multiline cells (current behavior) and
single-line rows that clip overflow, so wide CSVs stay compact when full
cell content isn't needed at a glance.

#### Demo
| Before | After |
| --- | --- |
| No single line mode | <img width="662" height="316" alt="image"
src="https://github.com/user-attachments/assets/3f2a9673-557c-4539-b755-9ff2633de2d7"
/> |
| <img width="666" height="287" alt="image"
src="https://github.com/user-attachments/assets/703f7214-a722-4fa5-9125-f043439e21b2"
/> | <img width="660" height="317" alt="image"
src="https://github.com/user-attachments/assets/be6ca912-e686-44da-90eb-58f09fab51f1"
/> |

### Testing

- Toggle "Display multiline rows" off: cells clip to one line with
ellipsis instead of wrapping
- Toggle it back on: cells wrap and grow to show full content
- Resize the window / change font size: single-line clip height tracks
the actual text line height instead of a stale hardcoded value

Release Notes:

-  N/A
playdohface pushed a commit to playdohface/zed that referenced this pull request Aug 29, 2026
### Changes

Adds a checkbox to toggle between multiline cells (current behavior) and
single-line rows that clip overflow, so wide CSVs stay compact when full
cell content isn't needed at a glance.

#### Demo
| Before | After |
| --- | --- |
| No single line mode | <img width="662" height="316" alt="image"
src="https://github.com/user-attachments/assets/3f2a9673-557c-4539-b755-9ff2633de2d7"
/> |
| <img width="666" height="287" alt="image"
src="https://github.com/user-attachments/assets/703f7214-a722-4fa5-9125-f043439e21b2"
/> | <img width="660" height="317" alt="image"
src="https://github.com/user-attachments/assets/be6ca912-e686-44da-90eb-58f09fab51f1"
/> |

### Testing

- Toggle "Display multiline rows" off: cells clip to one line with
ellipsis instead of wrapping
- Toggle it back on: cells wrap and grow to show full content
- Resize the window / change font size: single-line clip height tracks
the actual text line height instead of a stale hardcoded value

Release Notes:

-  N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:preview/csv Feedback for Zed's CSV support cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants