You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Removed ImageFileView as it was redundant after removing the image size restriction.
Adjusted a nested if statement in NonTextFileView after removing ImageFileView.
Some images are small. Filing the space would mean a very pixelated image. Ideally there would be a threshold of some kind so smaller images show actual pixels but still are zoom-able.
Some images are small. Filing the space would mean a very pixelated image. Ideally there would be a threshold of some kind so smaller images show actual pixels but still are zoom-able.
I agree, that's annoying. The issue is we can't control the zoom level. If we could even set the initial zoom level it'd be a different story. I just found that the QLPreviewController takes a delegate that lets us do exactly that. I'll see if I can refactor this to use QLPreviewController instead of QLPreviewView and make the changes to set the initial zoom level.
@austincondiffQLPreviewController is only available on iOS so we're back to where we started here. I think the best UX will be to let QLPreviewView decide the size and allow the user to zoom it correctly.
@austincondiffQLPreviewController is only available on iOS so we're back to where we started here. I think the best UX will be to let QLPreviewView decide the size and allow the user to zoom it correctly.
Working a lot with pixelated images, that would be my preference. If my image is small I expect it to be pixelated and can just zoom out, no big deal!
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
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
ImageFileViewas it was redundant after removing the image size restriction.ifstatement inNonTextFileViewafter 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