Repository navigation
feat(desktop-gpui): make centring an option under Focus mode, and explain what Focus records - #3511
Conversation
…-in Center on screen, and explains what it records
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| view.set_focus_center(false, cx); | ||
| view.set_focus(true, cx) |
There was a problem hiding this comment.
Saved Focus causes false failures
If Focus was already saved as on, set_focus_center(false) restores the window's original bounds after choose_window_size resizes it. The probe then compares those restored bounds with shaped and reports a failure even though Focus behaves correctly. Set Focus off before resizing so this check starts from a known state.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/picker_probe.rs
Line: 236-237
Comment:
**Saved Focus causes false failures**
If Focus was already saved as on, `set_focus_center(false)` restores the window's original bounds after `choose_window_size` resizes it. The probe then compares those restored bounds with `shaped` and reports a failure even though Focus behaves correctly. Set Focus off before resizing so this check starts from a known state.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| /// Center on screen, under Focus: centre the picked window now (and on | ||
| /// every later pick), or put it back where the picker found it. |
There was a problem hiding this comment.
The new set_focus_center comment only narrates what the method does. AGENTS.md requires comments to explain non-obvious context and explicitly bans comments that describe the current change. Remove this comment and the same kind of new comment on focus_center in store.rs; the pattern also appears in the updated set_focus comment. This repository requirement must be satisfied before merging.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/target_overlay.rs
Line: 2562-2563
Comment:
**Comments repeat the code**
The new `set_focus_center` comment only narrates what the method does. `AGENTS.md` requires comments to explain non-obvious context and explicitly bans comments that describe the current change. Remove this comment and the same kind of new comment on `focus_center` in `store.rs`; the pattern also appears in the updated `set_focus` comment. This repository requirement must be satisfied before merging.
**Context Used:** AGENTS.md ([source](https://github.com/capsoftware/cap/blob/main/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
@greptileai addressed in 5663976: the probe starts from Focus off, and the narrating comments are gone. Please re-review. |
|
@greptileai the set_focus_center and focus_center comments went in 5663976 and the set_focus one in e750cc8; please re-review. |
Summary
Turning on Focus mode in the window picker used to also move the picked window to the middle of the screen. Centring is now a separate option, off by default, and the card explains what Focus records.
focusCenterin the general settings, so it carries over to the next time you pick a window.Test plan
never_covers_a_kept_clear_controltest plus the existing hint tests pass

Confidence Score: 5/5
The PR appears safe to merge, with both previous findings addressed and no new blocking issues found.Summary
Focus and centring are now separate choices, with centring saved in
focusCenter.Reviews (3) · Last reviewed commit: "chore(desktop-gpui): drop the set_focus ..." · Reviewed by Greptile