Skip to content

Add a live-resize handle for the Paste Bar - #87

Open
alvst wants to merge 2 commits into
momenbasel:mainfrom
alvst:alvie/pr-live-resize
Open

Add a live-resize handle for the Paste Bar#87
alvst wants to merge 2 commits into
momenbasel:mainfrom
alvst:alvie/pr-live-resize

Conversation

@alvst

@alvst alvst commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

The bar's height is only meaningful on screen, but the only way to change it was a Settings slider whose feedback was a number — and clicking into Settings dismisses the bar. This adds an optional drag handle on the bar itself, and makes the slider preview the size it's describing.

What changed

  • BarResizeGeometry centralizes the height rules (default/min/max, per-display clamping, macOS 26 glass content-frame math) so the persisted preference and the live drag can't disagree.
  • BarResizeHandle is a compact drag target at the top of the bar, with accessibility increment/decrement. A new "Show resize handle on the Paste Bar" setting gates it, off by default.
  • The bar's key monitor steps aside while the handle holds first responder, so Escape and arrows during a drag reach the handle.
  • Dragging the Settings height slider live-resizes the real bar when it's up. When it isn't, a translucent click-through ghost appears on the display under the pointer — a faded BarView behind a dashed outline with a large "N px" readout — and retires ~1.1s after the last change. Showing the bar clears any lingering outline.
  • The slider's unit label reads "px" instead of "pt".

Screenshots

Before:
00-baseline screenshots bar.png

After:
06-live-resize screenshots bar.png
06-live-resize screenshots settings.png

The resize ghost is deliberately not pictured. It's a click-through window
that retires ~1.1s after the last change, so it can't be selected by macOS's
window capture and won't survive a screenshot — describing it is more honest
than shipping a still of the ordinary bar and calling it the ghost.

Notes for review

  • The ghost is sized through this branch's own BarResizeGeometry, so the outline can't promise a height the display won't actually grant.
  • The handle is off by default; with the setting off this is a no-op on the bar's appearance.
  • No dependencies; merges in any order.
  • Out of scope: no width or position adjustment, only height.

This feature should be bundled into v2.

Part of #80.

alvst added 2 commits August 19, 2026 10:22
- BarResizeGeometry centralizes bar-height sizing rules (default/min/max,
  per-display clamping, and the macOS 26 glass content frame math) shared
  by both the persisted preference and the live drag session.
- BarResizeHandle is a compact AppKit drag target (with accessibility
  increment/decrement support) shown in an optional overlay at the top
  of the bar.
- A new "Show resize handle on the Paste Bar" Settings toggle gates it,
  off by default. The bar's own key monitor steps aside while the handle
  owns first responder, so Escape/arrows during a drag reach it directly.

The height slider in Settings previews the same size. Clicking into
Settings dismisses the bar, so a pixel count was previously the only
feedback for a dimension that is only meaningful on screen. Dragging the
slider now live-resizes the real bar when it happens to be up, and
otherwise raises BarHeightGhostController: a translucent, click-through
panel occupying exactly the frame the bar would take on the display under
the pointer, drawing a faded real BarView behind a dashed outline and a
large "N px" readout, and retiring itself about 1.1s after the last
change. Showing the bar hides any outline still lingering.
Matches Alvie's Pesty's wording exactly - the value is a raw point
count either way, this was just a wording mismatch caught during
visual parity review of the settings redesign.
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