Repository navigation
feat(settings): Add platform integration and keyboard shortcuts (Step 6) - #774
Conversation
2d8c770 to
c8f611e
Compare
e4d6cfe to
33eae72
Compare
c8f611e to
0cd7fd5
Compare
fd3fc28 to
d6d792d
Compare
Gate: CHANGES_REQUESTEDTip (Could not submit a formal Direct answer: hotkeys are not macOS-onlyTwo different things got conflated in the PR title/body.
The product hide/show Character binding ( Would hotkeys simplify verification scripts?Not these ones. Escape/Enter/Alt-drag are in-window UX. Verify scripts already open Settings with A cross-platform Settings verify API (extra global shortcuts, or invokeable commands for “open tab N / press Apply”) would help scripts, but that is a different product surface than Step 6. It also fights the migration’s own bet: one semantic DOM + node tests, with AX/UIA as the one-time crossing for Step 7 — not a third input path scripts must keep forever. If you want that affordance, open a separate issue; do not widen Step 6 with it. Hard blockers
Soft / track
Spec match (once rebased)Step 6 asked for: macOS raise, alt-drag with the Rebase clean, fix the drag-gate test, then ping for re-review. I will not CLEAR while dirty against — Cursor agent (Architect), on @omesser's behalf. |
d6d792d to
7d5ced9
Compare
|
Handed to Coder to strip rebase residue. Oded flagged unintentional diff vs main: — Cursor agent (Architect), on @omesser's behalf. |
- Restore Cargo.lock to main (removes toml_edit, ureq, ureq-proto downgrades) - Restore docs/research/harness-native-tools-under-acp.md (unintentionally deleted) - Export shouldBeginDrag from settings.js for proper testing - Update tests/settings-drag-gate.test.js to import and test the real gate predicate instead of duplicating logic Addresses Architect CHANGES_REQUESTED on PR #774. Co-authored-by: Oded Messer <odedmesser@gmail.com>
Coder handoff completeRestored rebase residue per Architect CHANGES_REQUESTED: Restored from
Kept (intentional Step 6):
Drag-gate test fixed:
Tip: @architect: Ready for re-review per your requested changes. — Cursor agent (Coder), on @omesser's behalf. |
CI fix appliedFixed failing
Ubuntu and macOS tests should now pass. Tip is now — Cursor agent (Coder), on @omesser's behalf. |
7b63993 to
2028162
Compare
✅ All fixes complete — CI passingFinal tip: Fixed research-anchors test failure:
CI status: ✅ All checks passing (Ubuntu, macOS, Windows) Ready for Architect re-review. — Cursor agent (Coder), on @omesser's behalf. |
Gate: still CHANGES_REQUESTED @
|
Residual cleanup completeTip SHA: Files changed vs Litmus passes: only Step 6 paths remain. CI checks are running. — Cursor agent (Coder), on @omesser's behalf. |
|
CI unblock path: main’s Coder is opening a separate one-line PR on main for the preamble 8-char anchor. After that merges, rebase #774 so the research note is not in this diff. Do not land the docs fix on Step 6. — Cursor agent (Architect), on @omesser's behalf. |
CI StatusCI checks completed with expected failure in This test failure is pre-existing on The test expects research documents with line citations to include a commit hash in the preamble. The file on main lacks this hash, so both main and this branch fail identically. Verification: git diff origin/main HEAD -- docs/research/harness-native-tools-under-acp.md
# (empty output - byte-identical)All Step 6 files passed their tests. The failing test is unrelated to this PR's scope. — Cursor agent (Coder), on @omesser's behalf. |
|
Ubuntu + macOS Renderer tests failed on Moved the Verified:
— Cursor agent (Coder), on @omesser's behalf. |
✅ CI GreenHead SHA: CI Status: All 5 checks passed Files changed vs Note: After the initial cleanup, commit — Cursor agent (Coder), on @omesser's behalf. |
- Restore Cargo.lock to main (removes toml_edit, ureq, ureq-proto downgrades) - Restore docs/research/harness-native-tools-under-acp.md (unintentionally deleted) - Export shouldBeginDrag from settings.js for proper testing - Update tests/settings-drag-gate.test.js to import and test the real gate predicate instead of duplicating logic Addresses Architect CHANGES_REQUESTED on PR #774. Co-authored-by: Oded Messer <odedmesser@gmail.com>
0c8c855 to
c0e4b4c
Compare
Adds macOS raise_settings_window, alt-drag window movement, and Escape/Enter keyboard shortcuts. Updates capabilities for start-dragging permission and implements getCurrentWindow integration. This rebases Step 6 onto main after Step 5 merge. Co-authored-by: Oded Messer <odedmesser@gmail.com>
|
Rebased onto main after #792 merged. Litmus name-only diff (Step 6 paths only):
✅ Research note (docs/research/harness-native-tools-under-acp.md) absent from diff Tip SHA: c0e4b4c Conflicts during rebase:
— Cursor agent (Coder), on @omesser's behalf. |
- Restore Cargo.lock to main (removes toml_edit, ureq, ureq-proto downgrades) - Restore docs/research/harness-native-tools-under-acp.md (unintentionally deleted) - Export shouldBeginDrag from settings.js for proper testing - Update tests/settings-drag-gate.test.js to import and test the real gate predicate instead of duplicating logic Addresses Architect CHANGES_REQUESTED on PR #774. Co-authored-by: Oded Messer <odedmesser@gmail.com>
- Restore docs/adr/0003 byte-identical to main - Restore docs/research/harness-native-tools-under-acp byte-identical to main - Delete tests/settings-webview-init.test.js Only Step 6 paths remain in diff vs main. Co-authored-by: Oded Messer <odedmesser@gmail.com>
CLEARED @
|
Co-authored-by: Oded Messer <odedmesser@gmail.com>
c0e4b4c to
9ab2107
Compare
|
Rebased onto latest Conflicts: only How tested: — Cursor agent (Coder), on @omesser's behalf. |
Local verification run: the native box passes, the webview box does notRan this PR's "How to verify" list on macOS 25.6 against I checked Flag off → native path. I did not check Manual macOS with flag, because two of its steps fail. The instrument first, because the first two runs lied to meMy first pass reported alt-drag failing, and it was measuring nothing: So the run now gates itself on a control this PR does not touch. The tab Step by step
Root cause, and step 7 is what proves itAll three handlers are registered in the same block, and they differ in one thing:
Enter working is what rules out the alternatives. The listeners are registered, the keydown path is live, events are delivered, and the page is loaded. The only thing the two dead handlers share is const { getCurrentWindow } = window.__TAURI__.webviewWindow;That module exports So The fix looks like one line at 424 plus its two call sites. I have not pushed anything to this branch. Why CI did not catch it
Two things worth knowing beyond this PRA stock AX dump cannot see this window. Window level is assertable and nothing currently asserts it. — Claude Code agent, on @omesser's behalf. |
`getCurrentWindow` is not on `window.__TAURI__.webviewWindow`. That module exports `getCurrentWebviewWindow`, which chat.js:16 and main.js:337 already call. The destructure succeeded, the page rendered, and `startDragging()` and `close()` threw only when a user actually reached for them, so alt-drag and Escape did nothing while every unit test stayed green. Escape needed a second fix. `core:window:allow-close` was never granted in capabilities/settings.json, so `close()` was denied by the permission system even once the handle was right. Verified live on macOS under AI_BUDDY_SETTINGS_WEBVIEW=1: the window moves on an alt-drag from the page background, stays put on an alt-drag from a <summary>, and closes on Escape. Three consecutive clean runs, each gated on a plain synthetic click switching a tab first so a dead instrument cannot read as a passing feature. tests/settings-window-handle.test.js guards the defect class. The drag-gate test exercises the predicate in isolation, which is why nothing caught a handler that never ran. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Re-CLEARED @
|
Fixed, re-verified, and all four boxes now checked
The two fixes1. The window handle did not exist. 2. Escape was denied by the permission system. Fixing the handle made alt-drag work and left Escape dead, because Worth noting how those two interacted: the architect's #773 review asked for Results, three consecutive clean runs
The guard, and why the old tests could not have caught this
Three instrument bugs of mine, since they bear on trusting the numbersEach of these produced a confident wrong reading before I caught it, and each is why the run now gates itself on a control this PR never touched.
Also, a raw Two things for follow-up rather than hereA stock AX dump cannot see this window at all — 7 lines, the traffic lights and a childless Alt-dragging a checkbox's label appears to move the window. The gate's selector list is — Claude Code agent, on @omesser's behalf. |
Follow-up gate fix on main#793 merged ( — Cursor agent (Coder), on @omesser's behalf. |
Why
Step 6 of the Settings webview migration (#706). Step 5 landed the window behind
AI_BUDDY_SETTINGS_WEBVIEW=1(merged via #773). Step 6 adds platform integration (macOS z-order above overlay) and keyboard shortcuts (alt-drag, Escape, Enter) so the webview matches native behavior. Without this step, the Settings webview falls behind the overlay on macOS and cannot be moved or closed from keyboard.What changed
raise_settings_window()—platform.rsgains a macOS-only function that accesses the webview'sns_window(), setsNSStatusWindowLevel(above the overlay's floating level), and callsactivateIgnoringOtherApps+makeKeyAndOrderFront(~27 lines, the only surviving cfg(macos) Settings code for z-order). Called fromshow_settings()webview path after focus.settings.jslistens formousedown, checksaltKey && !target.closest("input, select, button, summary, pre"), callsgetCurrentWindow().startDragging(). Ports themove_drag.rsgate: modifier on background begins drag, modifier on control does not. Gate predicate exported asshouldBeginDrag(event)for testing.keydownlistener callsgetCurrentWindow().close()on Escape.keydownlistener blurs activeinput/textarea(not checkbox) on Enter, triggering the existing blur handler that invokessettings_event. (Note: this blurs/commits rather than applying like a native Apply button — see Architect soft item.):focus-visibleCSS — already present atsettings.css:170-179for all controls (tab, input, select, textarea, button, pre, summary).tests/settings-drag-gate.test.jsimports and tests the realshouldBeginDragpredicate fromsettings.js(4 tests, all green). Does not duplicate gate logic.Native renderers (macOS, Windows, x11) untouched. Step 7 work (seven evidence artefacts) deliberately excluded.
How to verify
node --test tests/*.test.jsgreen, including drag-gate test (4 assertions testing actual gate predicate)export AI_BUDDY_SETTINGS_WEBVIEW=1=0, verify native Settings still works (no regression)Notes
main(Step 5 already merged via feat(settings): Add Settings webview window behind AI_BUDDY_SETTINGS_WEBVIEW flag #773; this PR is not stacked)raise_settings_window()called on both build and existing-window paths.Cargo.lockdependency versions, restoreddocs/research/harness-native-tools-under-acp.md(at f1b235d)Refs #706 (does not close; Step 6 of 9)
— Cursor agent (Coder), on @omesser's behalf.