Repository navigation
Conversation
The resize handle could hold first responder outside a drag. The bar's key monitor then handed every key to the handle, which handled none of them, so arrows, Escape, Return and typing all just beeped while the bar looked focused. Hiding the bar did not help because the panel keeps its first responder across orderOut; only relaunching the app cleared it. Gate the key monitor's early return on isTrackingDrag, make the handle focusable only while a drag is in progress, never restore focus to the handle itself in finishTracking, and clear a stale handle first responder when the bar is shown. Fixes momenbasel#112.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@momenbasel Friendly ping — the fix for #112 is ready for review (Codex review passed); could you take a look when you have a moment, thanks! |
Fixes #112.
Problem
When the Paste Bar's resize handle holds first responder outside an active drag, the bar's local key monitor handed every key to the handle, and the handle handled none of them. The bar was visible and focused-looking, but:
Escapedid not close the bar,The bad state survived hiding/reopening the bar (the panel keeps its first responder across
orderOut) and only an app relaunch cleared it. It could also be entered without an interrupted drag by moving keyboard focus onto the handle.Root cause
Four things combined:
AppController.handleKeystepped aside whenever the first responder was aBarResizeHandleResponder— the condition added in Add a live-resize handle for the Paste Bar #87 was missing the "while dragging" part.BarResizeHandleView.acceptsFirstResponderwas alwaystrue, so the handle could hold focus any time.finishTracking()restoredpreviousFirstResponder; if the handle already owned focus before the drag, that "restore" handed focus back to the handle itself.BarWindowController.show()never cleared a stale handle first responder, so a stuck state persisted across presentations.Changes
AppController.swift— only yield the bar's keys to the handle while it is actively dragging (handle.isTrackingDrag).BarResizeHandle.swift— the handle is focusable only for the duration of a drag (acceptsFirstRespondergated onisTrackingDrag, whichmouseDownsets before asking the window for first responder), andfinishTracking()never restores focus to the handle itself.BarWindowController.swift— opening the bar clears a stale handle first responder, so an already-stuck state heals on the next presentation.Verification
swift buildsucceeds; the patch adds no warnings (the only build warnings are pre-existingCombine-import warnings inSettingsView.swift, unrelated to this change).swift test: 7/7 tests pass.VERSION=0.0.0 BUILD=ci ./scripts/build_app.sh(CI's bundle step) succeeds; universalarm64 + x86_64binary.NSEvents), withEscclosing the bar and typing opening search.Visual change
None — no visual delta. The strip, the handle and its drag behavior look and behave exactly as before; the only difference is where keyboard focus goes when a drag is not in progress.
Behavior note: while not dragging, the handle no longer takes first responder, so it is not reachable through Full Keyboard Access / key-view traversal. That never gave a working keyboard-adjust path (keys were swallowed) and VoiceOver increment/decrement actions still work; the handle's purpose is mouse dragging.