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

feature(web): Clicking an image in the preview modal will open it in a new tab #159

Merged
merged 1 commit into from
May 16, 2024

Conversation

lilacpixel
Copy link
Contributor

My husband gave me the idea for this PR 😉 As part of his illustration work, he saves a lot of images for drawing reference, and it's helpful to be able to open them in a split view on his iPad so he can have his reference right next to the canvas. Unfortunately, the pinch-to-zoom gesture doesn't work on images when Hoarder is added to the Home Screen as a web app. This tweak just links the image in the preview modal to the original file, so clicking it will open it in a new tab that can be zoomed, panned, etc.

(Side note: I originally had a much more complicated implementation for this, with a toggle for fullscreen mode and a pinch-pan-zoom library for manipulating the image when fullscreened. But, as it turns out, Apple hasn't made the Fullscreen API available for browsers other than iPad Safari. I couldn't figure out an alternative solution for unsupported browsers, so I ended up scrapping the whole thing. Opening the original image into a new tab is what Raindrop.io does, and that's what we're aiming to replace with Hoarder, so that's the change I ended up making. Hopefully it works well enough, but I'd be curious to hear your thoughts!)

Copy link

vercel bot commented May 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hoarder-app-docs ❌ Failed (Inspect) May 16, 2024 9:26pm
hoarder-app-landing ❌ Failed (Inspect) May 16, 2024 9:26pm

Copy link
Collaborator

@MohamedBassem MohamedBassem left a comment

Choose a reason for hiding this comment

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

Opening the image in a new tab sounds simple enough and looks good to me! Thank you (and your husband)!

@MohamedBassem MohamedBassem merged commit c0aa6d5 into hoarder-app:main May 16, 2024
4 of 6 checks passed
@lilacpixel lilacpixel deleted the image-popout branch May 16, 2024 21:57
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.

2 participants