Skip to content

Add GesturePhaseQueue and RingBuffer implementation#14

Merged
Kyle-Ye merged 2 commits into
mainfrom
feature/gesture_queue
Apr 18, 2026
Merged

Add GesturePhaseQueue and RingBuffer implementation#14
Kyle-Ye merged 2 commits into
mainfrom
feature/gesture_queue

Conversation

@Kyle-Ye
Copy link
Copy Markdown
Contributor

@Kyle-Ye Kyle-Ye commented Apr 18, 2026

Summary

Replace the old ConflictResolution/GesturePhaseQueue (untyped entry queue) with a generic GesturePhaseQueue<Value> backed by a fixed-capacity RingBuffer.

  • RingBuffer<Element> — generic circular buffer with Collection, BidirectionalCollection, Sequence, and CustomStringConvertible conformances. Default capacity verified from binary as 5 (mov w0, #0x5 at 0x852E4).
  • GesturePhaseQueue<Value> — holds timeSource, currentPhase, and pendingPhases: RingBuffer<GesturePhase<Value>>. Includes InvalidTransition error type with NestedCustomStringConvertible.
  • GestureNode<Value>.phaseQueue replaces the old phase / latestPhase stored properties.
  • Adds 23 new tests: 17 for RingBuffer (init, append, overflow/wrap-around, removeFirst, Collection, Iterator, description) and 6 for GesturePhaseQueue (init, properties, InvalidTransition).

Test plan

  • swift test --filter OpenGesturesTests — 48 tests in 8 suites pass
  • OPENGESTURES_COMPATIBILITY_TEST=0 swift test --filter OpenGesturesCompatibilityTests

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 18, 2026

Codecov Report

❌ Patch coverage is 92.23744% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.62%. Comparing base (7ed2c4a) to head (cd8e182).

Files with missing lines Patch % Lines
Sources/OpenGestures/GestureNode/GestureNode.swift 0.00% 17 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #14      +/-   ##
==========================================
+ Coverage   74.19%   77.62%   +3.43%     
==========================================
  Files          62       65       +3     
  Lines        1519     1712     +193     
==========================================
+ Hits         1127     1329     +202     
+ Misses        392      383       -9     
Flag Coverage Δ
ios 71.82% <75.71%> (+1.63%) ⬆️
macos 77.62% <92.23%> (+3.43%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye Kyle-Ye marked this pull request as ready for review April 18, 2026 16:54
@Kyle-Ye Kyle-Ye merged commit 368d33c into main Apr 18, 2026
4 checks passed
@Kyle-Ye Kyle-Ye deleted the feature/gesture_queue branch April 18, 2026 16:56
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.

2 participants