Skip to content

fix(settings): Alt-drag no longer moves the window from a label or textarea - #793

Merged
omesser merged 1 commit into
mainfrom
fix/settings-label-drag
Sep 17, 2026
Merged

omesser merged 1 commit into
mainfrom
fix/settings-label-drag

Conversation

@omesser

@omesser omesser commented Sep 16, 2026

Copy link
Copy Markdown
Owner

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:

  • a checkbox row is a <label> wrapping its input (settings.js:153)
  • a Multiline row is a <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 textarea is a text field.

Neither is possible natively, which is the standard #774 was porting to: move_drag.rs says "macOS uses the same gate after an NSControl hit-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 exported CONTROL_SELECTOR with textarea and label added. shouldBeginDrag is otherwise untouched.

tests/settings-drag-gate.test.js — four tests over the real selector. A fake closest matches 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

  • Node tests — 241 of 241, and 3 of the 8 drag-gate tests fail when the selector is reverted to the old value, which is the mutation test for them
  • Live on macOS, measured before and after — with AI_BUDDY_SETTINGS_WEBVIEW=1, driven through the Accessibility API rather than by hand

The checkbox's accessibility frame is 678,278,547,15, the full row width, which is the <label>. Alt-dragging it:

centre of the row over its title text background control
before moved 660,140 → 720,180 moved → 780,220 moved, so drags work
after stayed at 660,140 stayed at 660,140 moved, so drags still work

Each 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's ax-driven descent, because a stock ax-settings.swift sees 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

…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>
@omesser
omesser merged commit cf90c7f into main Sep 17, 2026
5 checks passed
@omesser
omesser deleted the fix/settings-label-drag branch September 17, 2026 11:07
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