Repository navigation
Pin screenshots to the screen - #4783
richiemcilroy wants to merge 62 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
hey @greptileai, please review the PR |
|
hey @greptileai, please review the PR |
…tings write order, shadow on macOS only
|
hey @greptileai, please review the PR |
|
@greptileai please review the PR |
|
@greptileai please review the PR |
|
@greptileai please review the PR |
|
@greptileai please review the PR |
|
@greptileai please review the PR |
|
@greptileai please review the PR |
|
Found 1 test failure on Blacksmith runners: Failure
|
|
@greptileai review |
| let (area_x, area_y, area_width, _) = area; | ||
| let x = (pin_x + (pin_width - width) / 2.).clamp(area_x, (area_x + area_width - width).max(area_x)); | ||
| let above = pin_y - BAR_GAP - BAR_HEIGHT; | ||
| let y = if above >= area_y { | ||
| above | ||
| } else { | ||
| pin_y + pin_height + BAR_GAP |
There was a problem hiding this comment.
Toolbar buttons leave the screen
When a pin fills the display height and sits at the top, bar_origin finds no room above it and puts the toolbar below the display. Close and Click-through now live in that toolbar, so those buttons become unreachable. Check the bottom edge too, and use an on-screen fallback when neither side has room.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/pinned_screenshots/bar.rs
Line: 37-43
Comment:
**Toolbar buttons leave the screen**
When a pin fills the display height and sits at the top, `bar_origin` finds no room above it and puts the toolbar below the display. Close and Click-through now live in that toolbar, so those buttons become unreachable. Check the bottom edge too, and use an on-screen fallback when neither side has room.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| let shown = !self.closing | ||
| && !capture_overlay_up(cx) | ||
| && ((!self.locked && self.hovered) | ||
| || (self.locked && self.locked_hover) | ||
| || self.bar_hovered | ||
| || self.leave_grace); |
There was a problem hiding this comment.
Hidden pins leave toolbars behind
On Windows, Hide Pins hides only the image window. The separate toolbar can stay shown through bar_hovered. A locked hidden pin can also show its toolbar again when the pointer enters its old bounds, because poll_locked_pointer ignores pins.hidden. Hide the toolbar with its pin and prevent it from reopening while pins are hidden.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/pinned_screenshots.rs
Line: 1496-1501
Comment:
**Hidden pins leave toolbars behind**
On Windows, Hide Pins hides only the image window. The separate toolbar can stay shown through `bar_hovered`. A locked hidden pin can also show its toolbar again when the pointer enters its old bounds, because `poll_locked_pointer` ignores `pins.hidden`. Hide the toolbar with its pin and prevent it from reopening while pins are hidden.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-v2-3x.png)
Pin a screenshot or any image to the screen in a borderless, always-on-top window (macOS and Windows; hidden on Linux).
pinned_screenshots::pin_screenshot(path)/pin_screenshot_at(path, origin)for other capture flows.Testing: unit tests for zoom and opacity limits, nudge, corner resize anchoring, opening size, lock hit areas, menu layout and keys, settings defaults and migration, tray rows. Real-app proof on macOS to follow.
Confidence Score: 5/5

The PR appears safe to merge, with two non-blocking toolbar issues.Findings
Fix with agent prompt
Summary
Adds floating image pins on macOS and Windows, with zoom, opacity, click-through, shortcuts, settings, and menu bar actions.
Reviews (15) · Last reviewed commit: "Pin polls and close run through the pin'..." · Reviewed by Greptile