Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly preview non-text files #1707

Merged
merged 66 commits into from
May 11, 2024

Conversation

plbstl
Copy link
Contributor

@plbstl plbstl commented May 10, 2024

Description

This PR allows CodeEdit to also open non text files correctly.

All the file formats in the related issue #1698 were tested.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

QuickLook doesn't load until the Git branch shows up:

code-edit-view-file1.mov

plbstl added 16 commits May 9, 2024 22:04
…t work around

- the first play click doesn't start the video, but the audio starts playing in the background, even after closing the editor tab
- and everything in-between
- NonTextFileView, OtherFileView, URL+isImage, are not needed anymore
- also added the view to the App Window docs
- `WorkspaceAnyFileView` -> `AnyFileView`
- `WorkspaceLoadingView` -> `LoadingFileView`
- `WorkspaceImageView` -> `ImageFileView`
- `WorkspacePDFView` -> `PDFFileView`
@plbstl plbstl changed the title View non text files correctly Correctly preview non-text files May 10, 2024
@plbstl plbstl force-pushed the view-non-text-files-correctly branch from 8069cbc to dda4d34 Compare May 10, 2024 18:30
- this removes the need to check for GIF images
- this also has a nice add-on of using gestures for zoom
@plbstl plbstl force-pushed the view-non-text-files-correctly branch from dda4d34 to b373bb6 Compare May 10, 2024 18:32
@thecoolwinter
Copy link
Collaborator

Looks like there's an issue with our CI, it might need an update, which would explain the failing test.

@austincondiff
Copy link
Collaborator

Nice work! I can't pull it down now but just so you are aware, images should show full pixels (not scaled up to fit if smaller than window). If it is too big for the window it should scale down to fit. We could later add some small controls to adjust the zoom levels and have buttons for 1x, 2x, and 3x.

@plbstl
Copy link
Contributor Author

plbstl commented May 11, 2024

images should show full pixels (not scaled up to fit if smaller than window). If it is too big for the window it should scale down to fit

Yes, this PR does that. Implementing it was really hard for me and it took the most time, but I'm happy it did so without a really complex logic.

CodeEdit/Features/Editor/Views/ImageFileView.swift

Copy link
Collaborator

@austincondiff austincondiff left a comment

Choose a reason for hiding this comment

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

Perfect! Excellent work!

@austincondiff austincondiff merged commit 86b2780 into CodeEditApp:main May 11, 2024
2 checks passed
@austincondiff
Copy link
Collaborator

@allcontributors add @plbstl for bug

Copy link
Contributor

@austincondiff

I've put up a pull request to add @plbstl! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants