Skip to content

feat: add allowed swipe directions - #10

Merged
saseungmin merged 2 commits into
mainfrom
feat/allowed-directions
Jun 17, 2026
Merged

saseungmin merged 2 commits into
mainfrom
feat/allowed-directions

Conversation

@saseungmin

Copy link
Copy Markdown
Member

Add a Root-level allowedDirections policy so decks can accept only left, only right, both, or no dismiss directions while preserving drag and snap-back behavior.

The policy is normalized into left/right booleans and synchronized into separate JS and UI-runtime carriers. This lets programmatic actions and release gestures both gate dismisses without routing policy changes through deckStore.attach.

Add a Root-level allowedDirections policy so decks can accept only left,
only right, both, or no dismiss directions while preserving drag and
snap-back behavior.

The policy is normalized into left/right booleans and synchronized into
separate JS and UI-runtime carriers. This lets programmatic actions and
release gestures both gate dismisses without routing policy changes
through deckStore.attach.

Constraint: Gesture release must stay UI-thread safe
Constraint: Programmatic actions need synchronous JS boolean returns
Constraint: Policy rerenders must not detach Root or clear event snapshots
Rejected: Direction predicate callback | worklet/JS boundary ambiguity
Rejected: Single carrier | JS coupling or attach churn risk
Confidence: high
Scope-risk: moderate
Directive: Future dismiss paths must use the same direction policy helper
Directive: Keep JS/UI policy carriers synchronized
Tested: yarn typecheck; yarn lint; yarn format:check
Tested: targeted jest for windowing, deckState, SwipeDeck integration
Tested: earlier full jest and build before readability-only helper refactor
Not-tested: Manual device verification for allowedDirections onboarding flows
@changeset-bot

changeset-bot Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4fc5516

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@react-native-motion-kit/swipe-deck Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Document the new Root-level allowedDirections API in the changeset with
a small JSX example and short behavior notes.

Constraint: Keep the release note focused on the public API surface
Confidence: high
Scope-risk: narrow
Tested: yarn format .changeset/allowed-directions.md
Not-tested: Full test suite; documentation-only changeset update
@saseungmin
saseungmin merged commit 0a9615b into main Jun 17, 2026
3 checks passed
@saseungmin
saseungmin deleted the feat/allowed-directions branch June 17, 2026 14:14
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