Skip to content

repl: Fix image scaling#48435

Merged
MrSubidubi merged 7 commits intozed-industries:mainfrom
cvanelteren:fix/repl-image-scaling
Mar 4, 2026
Merged

repl: Fix image scaling#48435
MrSubidubi merged 7 commits intozed-industries:mainfrom
cvanelteren:fix/repl-image-scaling

Conversation

@cvanelteren
Copy link
Copy Markdown
Contributor

@cvanelteren cvanelteren commented Feb 5, 2026

Continues #47114

Release Notes:

  • Fixed REPL output width clamping to apply to the content area so images don’t get clipped by controls

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 5, 2026
@cvanelteren
Copy link
Copy Markdown
Contributor Author

This ensures that the image stays in frame -- the other method creates a crop that is not wanted.

@maxdeviant maxdeviant changed the title Fix/repl image scaling repl: Fix image scaling Feb 5, 2026
Copy link
Copy Markdown
Collaborator

@rgbkrk rgbkrk left a comment

Choose a reason for hiding this comment

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

Sorry I left these comments and didn't finish submitting the whole review. The only strange bit to me is the removal of the output max width columns setting.

let image = self.image.clone();

div().h(height).w(width).child(img(image))
img(image).w(width).h(height)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

.overflow_x_scroll()
.when(needs_horizontal_scroll, |this| this.overflow_x_scroll())
.when(!needs_horizontal_scroll, |this| this.overflow_x_hidden())
.items_start()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

At some point we may just want to revisit this to work better across various output types.

/// Set to 0 to disable output width limits.
///
/// Default: 0
pub output_max_width_columns: usize,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Did you mean to take out the setting you introduced in a previous PR?

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.

The intention was to scale the image in the first one too -- we could leave it in but I don't see a good reason to not scale the image and have the overflow, open to suggestions tho.

@cvanelteren
Copy link
Copy Markdown
Contributor Author

Where are we on this @rgbkrk?

@cvanelteren
Copy link
Copy Markdown
Contributor Author

We can either make this fix addititive or revert the previous merge. Would be nice to see my images fit as poorman's notebook.

@rgbkrk
Copy link
Copy Markdown
Collaborator

rgbkrk commented Feb 16, 2026

I can't imagine anyone is using the settings you just introduced so, let's go for it.

@cvanelteren
Copy link
Copy Markdown
Contributor Author

@rgbkrk Kind reminder to merge this

@rgbkrk
Copy link
Copy Markdown
Collaborator

rgbkrk commented Mar 2, 2026

@rgbkrk Kind reminder to merge this

I can't merge anymore. Heck, my own PRs are sitting there waiting for review.

@cvanelteren
Copy link
Copy Markdown
Contributor Author

@rgbkrk what's changed?

@rgbkrk
Copy link
Copy Markdown
Collaborator

rgbkrk commented Mar 2, 2026

I'm not staff and they're working on SOC2 Compliance. I just review PRs and when they've got a chance to look at community contributions within REPL they rely on me. The REPL work is not really on their roadmap. Notebooks is pushed out for post-1.0 and I think they think of the REPL in the same way.

@rgbkrk rgbkrk added the area:repl repl, jupyter, notebooks, etc label Mar 2, 2026
Copy link
Copy Markdown
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

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

Thanks! Apologies for the delay in reviews, need to get back up to speed

@MrSubidubi MrSubidubi enabled auto-merge (squash) March 3, 2026 12:12
@cvanelteren
Copy link
Copy Markdown
Contributor Author

@MrSubidubi The failing test is not caused by this PR; seem to be related to a wiring issue (perhaps on upstream?)

@MrSubidubi MrSubidubi merged commit c0fa025 into zed-industries:main Mar 4, 2026
43 of 45 checks passed
tahayvr pushed a commit to tahayvr/zed that referenced this pull request Mar 4, 2026
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]>
wzulfikar pushed a commit to wzulfikar/zed that referenced this pull request Mar 4, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:repl repl, jupyter, notebooks, etc 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