Add configurable REPL output size limits#47114
Add configurable REPL output size limits#47114miguelraz merged 14 commits intozed-industries:mainfrom
Conversation
crates/repl/src/outputs/plain.rs
Outdated
| let font_id = text_system.resolve_font(&text_style.font()); | ||
| let cell_width = text_system | ||
| .advance(font_id, font_pixels, 'w') | ||
| .unwrap() |
There was a problem hiding this comment.
Have a default come out here instead of unwrapping, if it seems sensible. That or return None as bailing would be worse than falling back to None.
There was a problem hiding this comment.
Implemented, thanks.
| @@ -21,7 +21,4730 @@ As you type in the search box, matching settings appear with descriptions and co | |||
|
|
|||
| ### User Settings | |||
|
|
|||
| Your user settings apply globally across all projects. Open the file with {#kb zed::OpenSettingsFile} or run `zed: open settings file` from the command palette. | |||
There was a problem hiding this comment.
Did you mean to make all these changes to the configuring zed document? I have no opinions on the content but this should not be in this PR.
rgbkrk
left a comment
There was a problem hiding this comment.
This is sensible. Thanks for the contribution. Only two things to address - the unwrap in max_width_for_columns and removing the changes from docs/src/configuring-zed.md.
|
Thanks @rgbkrk -- I had an old version of the zed repo fork hence the weird docs. Should be good now. |
| @@ -1,136 +1,4998 @@ | |||
| # Configuring Zed | |||
There was a problem hiding this comment.
Can you do a git checkout from main for this file so that we don't have any changes in this file?
There was a problem hiding this comment.
Not sure what went wrong there -- it is restored now
crates/repl/src/notebook/cell.rs
Outdated
| .px_5() | ||
| .rounded_lg() | ||
| .border_1() | ||
| // .border_color(cx.theme().colors().border) |
There was a problem hiding this comment.
These comments should be deleted now.
crates/repl/src/notebook/cell.rs
Outdated
| }; | ||
|
|
||
| div() | ||
| // .w_full() |
There was a problem hiding this comment.
These comments also should be deleted if they're not being used
|
@miguelraz is there anything else that needs to change? |
|
@cvanelteren Yes, I think some basic unit tests are indispensable here. The @rgbkrk has approved the implementation changes and I see nothing to change there. |
|
Added some basic tests @miguelraz; ping me if you need more. |
|
LGTM - I don't see any of the float checks going haywire in our pixel-calculating conditions, so they unit tests seem sound. There are some clippy tests you should address @cvanelteren. |
|
Passing locally @miguelraz |
|
Thanks @miguelraz; I am not following the release schedule closely on zed, when would this be released on preview? |
|
@cvanelteren should make it into Preview and Nightly tomorrow :) |
Closes zed-industries#47113 Adds configurable REPL output size limits with two new settings, `repl.output_max_height_lines` and `repl.output_max_width_columns`, so large outputs scroll instead of expanding and images scale down to fit the available space. The output containers in both inline REPL blocks and notebook cells now respect these bounds, and image sizing uses the same text metrics as the terminal output for consistent column-based width calculations. Release Notes: - REPL output now supports configurable max height and width limits, with large outputs scrolling and images scaling to stay within the viewport.
Key changes: - Reduce monomorphizations in GPUI app.rs (zed-industries#48014) - Entities no longer implement Element directly, go through AnyElement (zed-industries#48217) - D3D11 resource upload optimization (zed-industries#48282) - Migrate features.edit_prediction_provider to edit_predictions.provider (zed-industries#48224) - Make mercury and sweep non-experimental (zed-industries#48227) - CompanionView consolidation in block_map (zed-industries#48223) - Show memory used by language servers (zed-industries#48226) - Settings links open sub pages (zed-industries#48212) - Tool security rules that can't be overridden (zed-industries#48209) - Add sweep_ai privacy mode setting (zed-industries#48220) - Configurable REPL output size limits (zed-industries#47114) - Fix .editorconfig files in subdirectories (zed-industries#48203) - Security updates: bytes v1.11.1, jsonwebtoken v10 - Git UI: hide "View on GitHub" for stashes (zed-industries#48271) - Indent guide fix in tree view with collapsed folders (zed-industries#48194) - Edit prediction fixes and improvements Conflict resolution: - collab/completion.rs, collab/rpc.rs: deleted (collab removed) - vim/search.rs: deleted (vim removed) - livekit_api/Cargo.toml: deleted (livekit removed) - GPUI files: deleted from Glass (handled in Obsydian-HQ/gpui) - migrations: combined both ours (m_2026_02_06) and upstream (m_2026_02_02, m_2026_02_03) - project.rs: kept collab functions removed, restored handle_create_file_for_peer for remote dev - lsp_store.rs: removed collab-only set_language_server_statuses_from_proto - proto.rs: kept CreateFileForPeer, removed CreateChannel/CreateChannelResponse - remote_servers.rs: merged import lists (kept native button imports + added Action) Co-Authored-By: Claude Opus 4.6 <[email protected]>
Continues #47114 Release Notes: - Fixed REPL output width clamping to apply to the content area so images don’t get clipped by controls --------- Co-authored-by: MrSubidubi <[email protected]>
Continues zed-industries#47114 Release Notes: - Fixed REPL output width clamping to apply to the content area so images don’t get clipped by controls --------- Co-authored-by: MrSubidubi <[email protected]>
Continues zed-industries#47114 Release Notes: - Fixed REPL output width clamping to apply to the content area so images don’t get clipped by controls --------- Co-authored-by: MrSubidubi <[email protected]>
Closes #47113
Adds configurable REPL output size limits with two new settings,
repl.output_max_height_linesandrepl.output_max_width_columns, so large outputs scroll instead of expanding and images scale down to fit the available space. The output containers in both inline REPL blocks and notebook cells now respect these bounds, and image sizing uses the same text metrics as the terminal output for consistent column-based width calculations.Release Notes: