Repository navigation
feat(details): wrap fields, fullscreen image viewer, click-to-copy - #48
Merged
Merged
Conversation
Fix the details panel's field grid and image frame, all rooted in flex items' `min-*: auto` pinning them to min-content size: - Wrap long field values (`min_w_0` on the value cell) instead of overflowing the row horizontally. - Let `ObjectFit::Contain` shrink the photo's width (`min_w_0` on the frame) when the dock narrows. - Span the column divider down full-height wrapped rows (`items_stretch`, not `items_start`). - Inset the fields scrollbar from the dock resize edge (`pr_2`). Add click-to-copy on field values, and a Maximize button that opens the photo in a ~90% viewport dialog overlay with scroll-to-zoom and drag-to-pan (new `ImageViewer` view). Open-in-default-app and reveal-in-folder buttons unchanged.
Address viewer feedback: - Zoom did nothing: the img is a flex child, so sizing it to `relative(zoom)` was cancelled by flex-shrink snapping it back to the container. Pin it with `flex_shrink_0` so it actually scales. - Overlay ran off-screen: the dialog card sat 10% from the top at 90%/85% of the viewport. Strip the card to transparent, `p_0`, `margin_top(0)`, and viewport-sized, and `Contain`-fit the image so it never exceeds the window. - Scroll now zooms for trackpad (pixel deltas) and wheel (line deltas) alike, so ctrl+scroll zooms too; drag still pans. - Show the filename top-left and zoom-out/zoom-in/close controls top-right, in place of the dialog's own title bar and close button.
- Size the viewer overlay to ~80% of the viewport, centered with a ~10% margin all around, instead of the full window — the default `Contain` fit then leaves breathing room rather than filling the screen edge to edge. - Let zoom-out shrink below the initial fit (clamp floor 1.0 -> 0.1), so the image can go smaller than window-width.
Move the viewer out of details.rs into `image_viewer.rs` and stop using a gpui_component dialog for it. A dialog layer occludes the whole window, so it covered the custom title bar and made the window's close/minimize controls unclickable, and its fixed viewport-fraction sizing overflowed the bottom of the window. The viewer is now held in an `ActiveImageViewer` global and mounted by `Workspace` as an overlay over its own content — which already sits below the title bar, so the window controls stay reachable. It fills that area with `size_full` + `overflow_hidden` and `Contain`-fits the image inside a padded box, so it sizes to the actual content area instead of hardcoded fractions and can't overflow. Escape / the close button dismiss it; zoom and pan unchanged.
The overlay painted on top of the dock but registered no hitbox, so gpui dispatched mouse and scroll events to the table behind it. `occlude()` the overlay root so it captures them.
The image frame is a flex item in `resizable_panel`, so its min-content height floored at the photo's intrinsic pixels and a tall image grew the frame past the pane. Add `min_h_0` (the height twin of the existing `min_w_0`) so the frame tracks the pane and `Contain` re-fits the image.
devnull03
marked this pull request as ready for review
July 20, 2026 12:10
Reduce all 44 multi-line inline comment blocks to a single line each, keeping the load-bearing rationale (gpui/flexbox overrides, dependency edges, upstream issue numbers) while dropping the restated mechanics. Delete BarRegistry::add_left/add_right default methods that only forwarded to BarItems' identically-named methods; callers use items_mut() directly. Note the ai crate and log_viewer.rs as deliberate audit exemptions in CLAUDE.md so future bloat passes don't re-flag them.
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
Upgrades the details panel (
crates/workspace/src/panels/details.rs). Four fixes share one root cause — flex items'min-*: autopinning them to min-content size — plus two new features.Fixes
min_w_0on the value cell lets long/unbreakable values (URIs, IDs) wrap instead of overflowing the row and forcing horizontal scroll.Containshrinks image width —min_w_0on the image frame; it was floored at the photo's intrinsic width, so narrowing the dock never re-fit the width.items_stretch(wasitems_start); the one-line label cell'sborder_rpreviously stopped after the first line of a tall wrapped row.pr_2on the fields panel so grabbing the dock edge doesn't catch the scrollbar.Features
write_to_clipboard). Whole-value copy, not partial-select — the only selectable text component parses markdown/html and would mangle raw metadata.ImageViewerview). Open-in-default-app and reveal-in-folder buttons unchanged.Known v1 ceilings on the viewer: pan isn't clamped to image bounds, a drag released outside the overlay can stick, and zoom is center-anchored (not cursor-anchored).
Verification
Run locally against the changed crate (a full cold
--workspacebuild in this fresh worktree runs 30+ min, so the full matrix is left to CI):cargo fmt --all --check— passedcargo clippy -p workspace --all-targets -- -D warnings -A dead_code— passedcargo test -p workspace— passed (6/6, alldetails.rstests)GitHub CI runs the full
--workspacefmt/clippy/test matrix on Windows + macOS.