feature(web): Clicking an image in the preview modal will open it in a new tab #159
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.
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!)