feat(image): add interactive pan/zoom to image viewer#4
Merged
HelgeSverre merged 5 commits intomainfrom Mar 1, 2026
Merged
Conversation
Replace the static image display (TabContent::Image) with a full interactive image viewer using ViewMode::Image: - Pan via click-and-drag with zoom-toward-cursor on scroll wheel - Keyboard shortcuts: Cmd+=/- (zoom), Cmd+0 (fit), Cmd+Shift+0 (1:1) - Status bar shows dimensions, zoom %, file size, format - Checkerboard background with nearest-neighbor scaling - Auto-fit on window resize when user hasn't manually zoomed - Guards against zero-dimension images and u32 pixel index overflow - Content-area-local coordinate math for accurate zoom anchoring
8 tasks
The render function centers small images within the viewport using a center_x/center_y offset, but the zoom handler didn't account for this. This caused zoom to anchor at the wrong point (shifted toward the bottom-right corner) instead of at the cursor position. Also fixes keyboard zoom double-subtracting the content area offset by storing raw window coords in last_mouse_x/y.
tree-sitter-blade has a git submodule (tree-sitter-html) using an SSH URL. Cargo's built-in libgit2 can't authenticate in CI, but the system git CLI is configured with HTTPS credentials by the checkout action.
The previous git-fetch-with-cli fix was incomplete: the checkout action sets persist-credentials: false, which removes the url.insteadOf config after checkout. This means the git CLI still tries SSH URLs for tree-sitter-blade's submodule and fails with Permission denied. Add explicit git config to rewrite git@github.com: URLs to https:// in all CI jobs that run cargo commands.
dist plan validates release.yml against its template and rejects our SSH-to-HTTPS URL rewriting steps. Setting allow-dirty = ["ci"] tells cargo-dist to accept our custom modifications.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
TabContent::Imagedisplay with full interactiveViewMode::ImageviewerTest Plan