Fix: Image Previews Have Constant Size #2079
Draft
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.
Description
Right now, CodeEdit attempts to display image previews at image's native resolution. This is done by restricting the view's size to the image's size. However, the preview view is scrollable and zoomable. This leads to issues like brought up in #2066 where the image is small.
This change removes the restricted size for image previews. This means they now fill the available editor space by default. They can still be zoomed, and their resolution is still listed in the status bar.
Detailed Changes
ImageFileView
as it was redundant after removing the image size restriction.if
statement inNonTextFileView
after removingImageFileView
.Related Issues
Checklist
Screenshots
Before, image is displayed at native resolution but has inset scroll bars and doesn't correctly zoom:
Screen.Recording.2025-07-07.at.3.02.01.PM.mov
With change, image is zoomed to fit width but has correct scrolling and zooming UI and UX:
Screen.Recording.2025-07-07.at.3.02.20.PM.mov