Skip to content

Fix delayed clipboard card selection - #108

Open
loudsun1997 wants to merge 2 commits into
momenbasel:mainfrom
loudsun1997:codex/immediate-card-selection
Open

loudsun1997 wants to merge 2 commits into
momenbasel:mainfrom
loudsun1997:codex/immediate-card-selection

Conversation

@loudsun1997

@loudsun1997 loudsun1997 commented Oct 28, 2026 •

Copy link
Copy Markdown

Single-clicking a clipboard card waits for the double-click recognizer before updating selection. Native event comparisons measured about 359–361 ms before the selection callback. Selecting on the first click is valid for both a single click and the first half of a double-click, so selection can happen immediately and the second click can still paste.

Implementation and justification

  • Use Apple's built-in simultaneous gesture composition to let selection complete while double-click recognition continues. macOS supplies click counts; no custom click-counting timer is introduced.
  • Preserve ordinary double-click paste, Shift range selection, Command toggle selection, Command precedence when both modifiers are held, and modified double-clicks that do not paste.
  • Keep a clicked card under the pointer so immediate selection cannot scroll it away before the second click. This is an intentional behavior change, including for partially visible cards. Keyboard and programmatic selection continue to use the configured center/right-edge position.
  • Give store tests a temporary directory so they do not touch the user's clipboard history.

Reproducible validation

  • swift test: all 10 unit tests pass, including three selection regressions. These assert selected IDs and the flag controlling scrolling.
  • bash scripts/check_card_interactions.sh: all 13 native gesture scenarios pass, including original-handler comparisons and quick Shift/Command release. The checked-in probe measured 360.7 ms for the original single click versus 2.4–4.8 ms for updated selection callbacks; earlier runs measured about 359 ms versus 2–18 ms.
  • bash scripts/check_bar_navigation.sh: all 10 integration checks pass using the real strip, cards, and store with disposable fixture history. It verifies actual scroll offsets stay unchanged after a click, navigation reveals an offscreen card, right-edge alignment works, and the native context menu opens and dismisses without changing selection.
  • Universal release app built for arm64 and x86_64. Runtime checks ran on Apple Silicon, macOS 15.7.5 (24G624), Swift 6.2.4. The installed app's improved responsiveness was confirmed by the user.

Both GUI probes open their own windows and exit on failure. The gesture probe uses recording callbacks; the strip probe redirects its home/application-support directory and does not start clipboard polling, the app delegate, or global hotkeys.

Coverage boundaries and manual review

The native probes post synthetic events with explicit click counts and measure callbacks/scroll positions, not physical mouse classification or total frame-rendering latency. Strip navigation invokes the same store method used by the key handler, without exercising physical key routing. The integration probe opens and dismisses context menus without invoking their actions.

Physical text/image/file drag-and-drop, context-menu actions, external-app paste, physical key routing, macOS 14/26 runtime behavior, and Intel runtime behavior still need separate checks. Intel compilation does not establish Intel interaction behavior. The integration probe covers the strip rather than the complete production window/hotkey/paste pipeline.

The checked-in rationale, reproduction commands, results, and full-app checklist capture these distinctions. No visual styling changes; the UI changes affect interaction timing and scrolling.

@loudsun1997 loudsun1997 reopened this Oct 28, 2026

This branch has not been deployed

No deployments
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