Repository navigation
fix(settings): Alt-drag no longer moves the window from a label or textarea - #793
Merged
Merged
Conversation
…xtarea The webview gate listed `input, select, button, summary, pre`. This page renders two controls that are neither: a checkbox row is a `<label>` wrapping its input (settings.js:153), and a Multiline row is a `<textarea>` (settings.js:187). So an alt-drag starting on a checkbox's row moved the window, and one starting in a multiline field moved it instead of selecting text - which the settings capability's own description says it avoids. Neither can happen natively: move_drag.rs gates macOS on an NSControl hit-test, and an AppKit checkbox's title is part of the control. Measured before and after on macOS with AI_BUDDY_SETTINGS_WEBVIEW=1. The checkbox's accessibility frame is 547x15, the whole row. An alt-drag at its centre and again over its title text moved the window 660,140 -> 720,180 -> 780,220 before, and leaves it at 660,140 after. A background drag moves it in the same run, so the gesture is reaching the page either way. The selector is now an exported constant with behavioral tests over it: a fake `closest` matches a tag against the real selector list, so the tests fail on the old value. Three of the eight fail when it is reverted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Follow-up to #774, found while verifying its manual checklist live. Step 6's alt-drag gate lists
input, select, button, summary, pre, and this page renders two controls that are none of those:<label>wrapping its input (settings.js:153)<textarea>(settings.js:187)So an alt-drag starting anywhere on a checkbox's row moved the window, and one starting in a multiline field moved it rather than selecting text. The settings capability's own description says the gate exists so "a drag from a text field still selects", and a
textareais a text field.Neither is possible natively, which is the standard #774 was porting to:
move_drag.rssays "macOS uses the same gate after anNSControlhit-test", and an AppKit checkbox's title is part of the control rather than a sibling element.What changed
src/settings.js— the selector becomes an exportedCONTROL_SELECTORwithtextareaandlabeladded.shouldBeginDragis otherwise untouched.tests/settings-drag-gate.test.js— four tests over the real selector. A fakeclosestmatches a tag name against the actual list, so these fail on the old value rather than passing whatever it says. The existing four predicate tests are unchanged.How to verify
AI_BUDDY_SETTINGS_WEBVIEW=1, driven through the Accessibility API rather than by handThe checkbox's accessibility frame is
678,278,547,15, the full row width, which is the<label>. Alt-dragging it:660,140→720,180780,220660,140660,140Each run re-checks that a background alt-drag does move the window, so a gate that "held" because nothing was reaching the page would fail instead of passing. #774's full checklist still passes 6 of 6 afterwards.
Notes
The live driving used a scratchpad Swift probe plus
#779'sax-drivendescent, because a stockax-settings.swiftsees only 7 lines of this window. Those scripts are not in this PR. They are the natural shape of a step 7 artefact for #706 and I would rather offer them than assume that step's owner wants mine.Refs #774, #706 (step 6 follow-up, closes nothing)
🤖 Generated with Claude Code