Skip to content

Shortcuts: remove dead paste-last and Hands-Free shortcut code - #2033

Merged
r3dbars merged 1 commit into
mainfrom
claude/remove-dead-shortcut-code
Oct 8, 2026
Merged

r3dbars merged 1 commit into
mainfrom
claude/remove-dead-shortcut-code

Conversation

@r3dbars

@r3dbars r3dbars commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Why

1.1.70 made dictation one key (Right Option) with a behavior picker and removed the separate Hands-Free and paste-last shortcuts from the UI, but their code stayed: an action no binding could produce, event-tap routing for it, stored bindings nothing read, and writers nothing called. That's confusing for the next reader and an easy place for an agent to "fix" the wrong thing.

Product Impact

  • Affects: dictation (no behavior change)
  • Lane: dictation reliability
  • Why this matters: less dead shortcut code next to the live dictation key path.

What changed

Removed (unreachable):

  • PhysicalShortcutAction.pasteLastDictation and its debounce bucket. configuredBindings() never registered it.
  • Its routing in ContextCaptureEngine: the keyDown and flagsChanged arms, the handlePhysicalShortcut arms, handlePhysicalPasteLastDictationPress, and onPasteLastDictation. Also its assignment in TranscriptedApp.
  • PhysicalDictationTriggerPreferences: defaultPasteLastDictationBinding, pasteLastDictationBinding, savePasteLastDictation, their storage keys, and saveHandsFree. handsFreeBinding and defaultHandsFreeBinding are now private and used only by the migration.
  • DictationShortcutMode: title, summary, CaseIterable and Identifiable; HotkeyPreferences.setDictationShortcutMode and defaultDictationShortcutMode.
  • Tests that only covered removed code. Tests that covered live behavior through removed names were retargeted. Migration tests now seed the legacy UserDefaults keys directly.

Kept on purpose (live):

  • DictationShortcutMode.handsFree. It models a take that keeps listening: Tap to toggle, or a Hold or tap take kept by a tap. About a dozen Speech/UI policies branch on it. Its raw value hands_free is the shortcut_mode telemetry tag and is in the Sentry allowlist. It isn't renamed, because that would touch about 15 files with no behavior gain; its doc comment now explains it.
  • .dictationHandsFree routing and HandsFreeModifierComboTracker, used by Tap to toggle.
  • PasteLastDictationFeedback and NotchIslandController.onPasteLastDictation. The island's "Paste again" chip still uses them.
  • The legacy mode read, now legacyDictationShortcutMode(), used only by migrateToOneDictationKeyIfNeeded. A missing or unknown value still maps to .handsFree, so upgraders migrate exactly as before.

Telemetry: the only value that can no longer be emitted is hotkey_id paste_last_dictation_physical_trigger, which was already unreachable. shortcut_mode, dictation_hands_free and the DictationTrigger raw values are unchanged.

Follow-ups:

  • Docs: Capture, Speech, UI and MenuBar AGENTS.md still mention the paste-last binding. I'll fix that after Agent docs: refresh every AGENTS.md and add six missing ones #2030 (the AGENTS.md refresh) merges, to avoid conflicts.
  • File-size baselines: check-file-size.py --shrink can now lower the baselines for ContextCaptureEngine.swift and TranscriptedApp.swift.

How I checked it

The work ran as a workflow: a read-only reachability map, then removal in two sequential passes, then two adversarial reviewers (live behavior; contracts and upgrades). Both reviewers found no regressions.

  • bash check.sh: Deterministic proof PASS
  • bash build.sh --no-open
  • bash run-tests.sh: 42,105 passed, 0 failed
  • check-source-pins.py --changed-only and --count-baseline (198 pins, none new), check-module-boundaries, check-telemetry-keys, check-test-shape, check-build-source-lists, concurrency-census
  • Manual check: Right Option in all three behaviors (hold or tap, hold only, tap to toggle), Esc cancel, meeting key, and the island's "Paste again" chip

Checks I could not run, and why:

  • The manual key checks above: they need a person at the keyboard on a real Mac.
  • The migration on a real upgrade: not run. It's covered by tests that seed the legacy keys directly.

🤖 Generated with Claude Code

1.1.70 made dictation one key with a behavior picker, but the old
paste-last shortcut and separate Hands-Free binding stayed in the tree.
Remove the paste-last action, its event-tap routing, callback and stored
binding, plus the unused Hands-Free binding writer and the
DictationShortcutMode title/summary/writer. The legacy mode read stays,
renamed legacyDictationShortcutMode, for the one-key migration.

Kept on purpose: DictationShortcutMode.handsFree (models tap-kept and
Tap to toggle takes; raw value is the shortcut_mode telemetry tag),
.dictationHandsFree routing, and PasteLastDictationFeedback (the island's
"Paste again" chip still uses it).
@r3dbars

r3dbars commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T11:40:33.423826Z 9347cef Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 9347ceffeb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@r3dbars r3dbars closed this Oct 8, 2026
@r3dbars r3dbars reopened this Oct 8, 2026
@r3dbars r3dbars closed this Oct 8, 2026
@r3dbars r3dbars reopened this Oct 8, 2026
@r3dbars
r3dbars merged commit a4d882c into main Oct 8, 2026
26 of 36 checks passed
@r3dbars
r3dbars deleted the claude/remove-dead-shortcut-code branch October 8, 2026 18:34
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