Skip to content

Pin screenshots to the screen - #4783

Draft
richiemcilroy wants to merge 62 commits into
shots064/basefrom
shots/pin-to-screen
Draft

richiemcilroy wants to merge 62 commits into
shots064/basefrom
shots/pin-to-screen

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Pin a screenshot or any image to the screen in a borderless, always-on-top window (macOS and Windows; hidden on Linux).

  • Opens at the image's point size, clamped to the display. Rounded corners, shadow and border on by default (Settings > Screenshots > Pinned screenshots); each pin can toggle them from its menu.
  • Hover shows close, a zoom badge and lock along the top, and a drag handle at the bottom. Resize by corner drag, pinch, ⌘-scroll or ⌘= / ⌘- / ⌘0. Two-finger scroll or 2 / 5 / 0 set opacity. Arrow keys move 1 pt (⇧ 10 pt). Esc, ⌘W or middle click closes.
  • Lock (⌘L or the lock button): under the pointer the pin fades and lets clicks through, except on its close and lock buttons. Unlock Pins in the menu bar also unlocks.
  • The drag handle drags the file into another app and closes the pin after a drop, unless ⌥ is held (macOS).
  • Right-click menu: Close, Open in Editor, Copy, Save As, Lock, Zoom 50/100/200%, Opacity 20/50/100%, Shadow, Rounded Corners, Border.
  • Menu bar: Pin to the Screen..., Pin Last Screenshot, Hide/Show Pins, Unlock Pins, Close All Pins. Shortcut slots for the four global actions.
  • 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/5RetriggerView in Greptile

The PR appears safe to merge, with two non-blocking toolbar issues.

Findings

  1. P2 Toolbar buttons leave the screen ▶
  2. P2 Hidden pins leave toolbars behind ▶
Fix with agent prompt
### Issue 1
apps/desktop-gpui/src/pinned_screenshots/bar.rs:37-43
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.

### Issue 2
apps/desktop-gpui/src/pinned_screenshots.rs:1496-1501
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.

Summary

Adds floating image pins on macOS and Windows, with zoom, opacity, click-through, shortcuts, settings, and menu bar actions.

  • Pinned images stay visible above other apps and can be adjusted.
  • The menu bar and shortcuts can open and manage pinned images.
  • Pinned images keep their appearance choices across launches.

Reviews (15) · Last reviewed commit: "Pin polls and close run through the pin'..." · Reviewed by Greptile

@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Dec 4, 2026 1:44pm UTC

@vercel
vercel Bot temporarily deployed to Preview – cap-status December 2, 2026 16:55 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cap-status December 2, 2026 17:31 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please review the PR

@vercel
vercel Bot temporarily deployed to Preview – cap-status December 2, 2026 17:37 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cap-status December 2, 2026 17:56 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cap-status December 2, 2026 17:59 Inactive
@richiemcilroy richiemcilroy reopened this Dec 2, 2026
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please review the PR

@vercel
vercel Bot temporarily deployed to Preview – cap-status December 2, 2026 18:38 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please review the PR

@vercel
vercel Bot temporarily deployed to Preview – cap-status December 2, 2026 20:41 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cap-status December 2, 2026 20:43 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cap-status December 2, 2026 22:20 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cap-status December 3, 2026 04:10 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member Author

@greptileai please review the PR

@richiemcilroy

Copy link
Copy Markdown
Member Author

@greptileai please review the PR

@vercel
vercel Bot temporarily deployed to Preview – cap-status December 3, 2026 06:23 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member Author

@greptileai please review the PR

@vercel
vercel Bot temporarily deployed to Preview – cap-status December 3, 2026 07:27 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member Author

@greptileai please review the PR

@vercel
vercel Bot temporarily deployed to Preview – cap-status December 3, 2026 07:27 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member Author

@greptileai please review the PR

@vercel
vercel Bot temporarily deployed to Preview – cap-status December 3, 2026 17:00 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member Author

@greptileai please review the PR

@vercel
vercel Bot temporarily deployed to Preview – cap-status December 4, 2026 12:43 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cap-status December 4, 2026 12:49 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cap-status December 4, 2026 12:53 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cap-status December 4, 2026 13:28 Inactive
@blacksmith-sh

blacksmith-sh Bot commented Dec 4, 2026

Copy link
Copy Markdown

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
cap-verify::export/prepare_recorded_fixtures View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@richiemcilroy

Copy link
Copy Markdown
Member Author

@greptileai review

@vercel
vercel Bot temporarily deployed to Preview – cap-status December 4, 2026 13:44 Inactive
Comment on lines +37 to +43
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 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.

Comment on lines +1496 to +1501
let shown = !self.closing
&& !capture_overlay_up(cx)
&& ((!self.locked && self.hovered)
|| (self.locked && self.locked_hover)
|| self.bar_hovered
|| self.leave_grace);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 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.

This branch was previously deployed

1 inactive deployment
Preview – cap-status — 67a555af Deployed Dec 4, 2026 by vercel[bot]
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.

1 participant