Skip to content

feat(carousel): add swipeThreshold input and improve swipe navigation #187 - #733

Open
intermetric wants to merge 1 commit into
rcfrom
feat/187-carousel-sliding-threshold-improvement
Open

intermetric wants to merge 1 commit into
rcfrom
feat/187-carousel-sliding-threshold-improvement

Conversation

@intermetric

@intermetric intermetric commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Carousel swipes now settle more predictably, accounting for the release position, reachable stops, and quick flicks.
    • Added a configurable swipe threshold, defaulting to 0.3, to control how far users must drag to advance.
    • Canceled gestures return the carousel to its starting position; very short drags stay on the current stop.
  • Tests

    • Expanded coverage for swipe thresholds, flicks, cancellation, release movement, and fractional endpoints.

@intermetric
intermetric added this pull request to stack #734 September 25, 2026 12:56
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: TEDI-Design-System/angular/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 39ae8b99-1ce9-450d-8f3b-e8121e273556

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main changes: adding the swipeThreshold input and improving carousel swipe navigation.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

♿ Accessibility — ✅ no blocking violations

No accessibility violations in the components changed by this PR.

🔕 Known issues — 19 stories marked todo (warn only)

Stories

@codecov

codecov Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@intermetric intermetric linked an issue Sep 25, 2026 that may be closed by this pull request
@airikej

airikej commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

good change, maybe add swipeThreshold to reacts carousel too in the future?

@intermetric

Copy link
Copy Markdown
Contributor Author

@airikej

good change, maybe add swipeThreshold to reacts carousel too in the future?

Yup, makes sense. Created an issue: TEDI-Design-System/react#941.

@intermetric
intermetric force-pushed the feat/187-carousel-sliding-threshold-improvement branch from 942d905 to 0d82f29 Compare September 29, 2026 07:27
@intermetric
intermetric force-pushed the feat/187-carousel-sliding-threshold-improvement branch from 0d82f29 to ad1639a Compare September 29, 2026 07:33
Base automatically changed from feat/528-carousel-floating-buttons to rc September 29, 2026 07:38
@intermetric
intermetric force-pushed the feat/187-carousel-sliding-threshold-improvement branch from ad1639a to 10089bf Compare September 29, 2026 07:38
const FLICK_WINDOW = 100;

/** Drags shorter than this (px) never move the carousel, so taps and jitter stay put. */
const MIN_SWIPE_DISTANCE = 10;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MIN_SWIPE_DISTANCE is 10px for every input type. It's reasonable as a touch value, but a mouse drag is more precise, so the carousel can feel sticky with a pointer.
onPointerDown gets a PointerEvent, so we could read ev.pointerType and keep 10 only for touch.
Or is the single value intentional?

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

🎨 Chromatic

No visual changes.

Built from 10089bf. Commits pushed after this are not covered; approve again to rebuild.

View the build

This branch was successfully deployed

No deployments
github-pages — 0d82f29e Deployed Sep 29, 2026 by intermetric via Deploy #1190
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.

[Carousel]: Sliding threshold

3 participants