Repository navigation
feat(desktop-gpui): pick an area's aspect ratio from chips and a menu, with fill and reset - #3450
richiemcilroy wants to merge 7 commits into
Conversation
… menu, with fill and reset
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
hey @greptileai, please re-review the PR |
|
hey @greptileai, please re-review the PR |
|
hey @greptileai, please re-review the PR |
| if let (Some(crop), Some((from, started))) = (self.crop, self.reshape.take()) { | ||
| self.crop = Some(area_between( | ||
| from, | ||
| crop, | ||
| started.elapsed().as_secs_f32() / AREA_RESHAPE.as_secs_f32(), | ||
| )); |
There was a problem hiding this comment.
Moving during a reshape leaves the crop outside its locked ratio
Medium Severity
Change a 640×360 selection to 1:1, then grab inside it before the 240 ms animation completes. This freezes an intermediate, non-square rectangle into self.crop. The AreaDrag::Move branch preserves those dimensions, mouse-up only clamps them, and target() sends them directly to capture, so the resulting recording can remain non-square while 1:1 is selected. Preserve hit testing against the displayed rectangle, but reconcile the crop with the locked ratio when interrupting or completing a move.
| if let Some(menu) = &mut this.aspect_menu { | ||
| match menu.on_key(&event.keystroke.key) { | ||
| crate::ui::MenuKey::Commit(index) => this.choose_aspect(index, cx), | ||
| crate::ui::MenuKey::Dismiss => { | ||
| this.aspect_menu = None; | ||
| cx.notify(); |
There was a problem hiding this comment.
Escape dismisses the whole picker instead of the aspect menu on macOS
Medium Severity
The unchanged global Escape receiver in app_windows.rs unconditionally calls dismiss_target_overlays(). While the picker is open on macOS, platform::escape_hotkey::escape_pressed consumes Escape through Carbon and sends it to that receiver, bypassing this new local menu handler. Opening More and pressing Escape therefore closes the entire picker and loses the selection rather than merely closing the menu. Route the global Escape through open-menu dismissal before falling back to dismissing the overlays.
|
hey @greptileai, please re-review the PR |
Stacked on #3441.
Problem
The area picker could lock its selection to an aspect ratio, but the only control was a chip that cycled through all nine ratios one click at a time. There was no way to see the choices, jump straight to one, fill the display, or start the selection over.
Change
gpui_area_selection.aspectRatio).The toolbar keeps today's surface styling; the glass restyle lands separately.
Test
target_overlay).Picker smoke (real app)now saves a screenshot of every picker mode on macOS, Windows and Linux.

Confidence Score: 5/5
The reviewed changes appear safe to merge.Summary
Adds aspect-ratio chips and a More menu, Fill and Reset controls, animated selection changes, and picker screenshots.
Reviews (5) · Last reviewed commit: "fix(desktop-gpui): colour the area toolb..." · Reviewed by Greptile