Skip to content

Fix swipe recording after a provisional long press - #1413

Merged
lujjjh merged 2 commits into
mainfrom
fix/button-recorder-delayed-swipe
Oct 3, 2026
Merged

lujjjh merged 2 commits into
mainfrom
fix/button-recorder-delayed-swipe

Conversation

@lujjjh

@lujjjh lujjjh commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Allow swipes to replace the recorder’s provisional long press while all participating buttons remain held. Releasing any participating button prevents further swipe reclassification. Runtime recognition is unchanged.

Supersedes #1392 by @lamhoangtung and addresses its review feedback on partially released button combinations.

Closes #1391.

Validation: all 972 tests pass, including coverage for ordered and simultaneous combinations in both release orders. SwiftFormat and SwiftLint pass.

Co-authored-by: lamhoangtung [email protected]

Summary by CodeRabbit

  • Bug Fixes
    • Improved swipe and long-press recognition in button mappings. A swipe can now take precedence over a provisional long press while the participating buttons remain held; releasing a button before the swipe is recognized preserves the long press.
    • Swipes continue to trigger when no long-press action is configured or the setting is Auto. Once a long press or swipe is recognized, later movement no longer changes the result.

Allow swipe reclassification only while all participating buttons remain held.

Co-authored-by: lamhoangtung <[email protected]>
@lujjjh lujjjh added the bug Something isn't working label Oct 3, 2026
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a10cfc2e-03e2-4f23-82ce-284966f94285
📥 Commits

Reviewing files that changed from the base of the PR and between 90b896a and 47b8937.

📒 Files selected for processing (4)
  • LinearMouse.xcodeproj/project.pbxproj
  • LinearMouse/UI/ButtonsSettings/ButtonMappingsSection/ButtonMappingRecordingEngine.swift
  • LinearMouseUnitTests/EventTransformer/ButtonMappingEngineTests.swift
  • LinearMouseUnitTests/UI/ButtonMappingRecordingEngineTests.swift

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The recorder now accepts movement during a provisional long press while participating buttons remain pressed. Tests cover swipe recognition, button releases, combined inputs, and delayed swipe actions. The project file also reorders the HIDPP package dependency.

Changes

Button mapping swipe recording

Layer / File(s) Summary
Provisional long-press reclassification
LinearMouse/UI/ButtonsSettings/ButtonMappingsSection/ButtonMappingRecordingEngine.swift, LinearMouseUnitTests/UI/ButtonMappingRecordingEngineTests.swift, LinearMouseUnitTests/EventTransformer/ButtonMappingEngineTests.swift
The recorder accepts movement during provisional long-press recognition while all participating buttons remain pressed. Tests cover swipe thresholds, completed recognitions, button releases, combined inputs, and delayed swipe actions.

Package dependency ordering

Layer / File(s) Summary
HIDPP dependency ordering
LinearMouse.xcodeproj/project.pbxproj
The HIDPP framework build-file entry and package product dependency declaration are reordered after LRUCache. The product reference remains unchanged.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 47b89

No merge-blocking issue is identified for the recorder change or dependency reorder; the PR is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning LinearMouse.xcodeproj/project.pbxproj only reorders the HIDPP build-file entry and package product dependency. This declaration-order change does not support the recorder change in #1391 and has no … Remove the unrelated HIDPP declaration reordering from LinearMouse.xcodeproj/project.pbxproj.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 3 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: allowing swipe recording to replace a provisional long press.
Linked Issues check ✅ Passed #1391 requires movement to replace a provisional long press in the recorder while preserving completed outcomes and runtime recognition. pointerMoved now accepts movement for a provisional `.longPre…
Full details: Out of Scope Changes check

Explanation

LinearMouse.xcodeproj/project.pbxproj only reorders the HIDPP build-file entry and package product dependency. This declaration-order change does not support the recorder change in #1391 and has no demonstrated functional connection to it.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@lujjjh
lujjjh merged commit b5c65eb into main Oct 3, 2026
2 checks passed
@lujjjh
lujjjh deleted the fix/button-recorder-delayed-swipe branch October 3, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Button Mappings recorder cannot record swipes after provisional long press

1 participant