Skip to content

fix: clear each shortcut with one Delete press - #390

Merged
lzhgus merged 1 commit into
mainfrom
fix/shortcut-recorder-delete
Oct 31, 2026
Merged

lzhgus merged 1 commit into
mainfrom
fix/shortcut-recorder-delete

Conversation

@lzhgus

@lzhgus lzhgus commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Fixes #389.

KeyboardShortcuts 2.2.1 holds the recorder's local key monitor token weakly. On some macOS 26/27 builds the token is released early, so stop() can never remove the monitor and earlier rows keep swallowing Delete presses (sindresorhus/KeyboardShortcuts#241). Upstream fixed it in 3.1.0, but 3.x needs Swift 6.2 tools, which our Xcode 16.4 CI and release builds can't resolve.

So this vendors 2.2.1 into Packages/KeyboardShortcuts (license included, tests and example left out) with one change: the token is held strongly, as in 3.1.0. We can go back to the upstream package once CI moves to Xcode 26.

Tested in the Debug app with a real keyboard: rows in Settings → Shortcuts clear one after another with a single Delete press each. Shortcuts still display and record as before.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CEFcqadVpnqXceY8Ke7Szp

Vendor KeyboardShortcuts 2.2.1 with one change: LocalEventMonitor keeps
its monitor token strongly, as upstream 3.1.0 does. Held weakly, the
recorder's key monitors are never removed on some macOS 26/27 builds,
so earlier rows swallow Delete presses. 3.x needs Swift 6.2 tools, which
our Xcode 16.4 CI and release builds can't resolve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CEFcqadVpnqXceY8Ke7Szp
@lzhgus
lzhgus force-pushed the fix/shortcut-recorder-delete branch from fd87990 to e9abe25 Compare October 31, 2026 06:45
@lzhgus
lzhgus merged commit 30f88a7 into main Oct 31, 2026
5 checks passed
@lzhgus
lzhgus deleted the fix/shortcut-recorder-delete branch October 31, 2026 06:54
lzhgus added a commit that referenced this pull request Oct 31, 2026
CI and release builds move from `macos-15` (Xcode 16.4) to `macos-26`,
with Xcode 26.6 pinned so builds don't drift with the runner default.

With Swift 6.2+ tools available, this goes back to upstream
KeyboardShortcuts 3.1.0 instead of the patched copy of 2.2.1 added in
#390. 3.1.0 includes the same monitor fix for #389. The only API change
is `default:` → `initial:`.

Building against the macOS 26 SDK also turns on the `#if
compiler(>=6.2)` paths (Liquid Glass styling in Settings and elsewhere)
in release builds, which were compiled out with Xcode 16.4.

Checked: Debug build passes locally. A dry run of the release workflow
on this branch (sign, notarize, DMG; no release, tap or appcast changes)
is in progress.

**Also fixed:** `TextRecognizer` called the blocking
`VNImageRequestHandler.perform` on the Swift concurrency thread pool. On
the 2-core `macos-26` runner, OCR tasks left running by annotation
editor tests occupied every cooperative thread and an unrelated async
recording test hung until the 6-hour job limit. `perform` now runs on a
GCD global queue, and the CI job has a 40-minute timeout.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01CEFcqadVpnqXceY8Ke7Szp

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

[Bug] Deleting shortcut keystrokes takes an increasing number of delete key presses

1 participant