-
Notifications
You must be signed in to change notification settings - Fork 292
fix: add direction tracking to carousel component #1574
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: main
Are you sure you want to change the base?
fix: add direction tracking to carousel component #1574
Conversation
@maj0rika is attempting to deploy a commit to the Themesberg Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe changes update the Carousel component to explicitly track the direction of slide transitions. In the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CarouselComponent
User->>CarouselComponent: Clicks "Next"
CarouselComponent->>CarouselComponent: Update slide index
CarouselComponent->>CarouselComponent: Set _state.forward = true
User->>CarouselComponent: Clicks "Previous"
CarouselComponent->>CarouselComponent: Update slide index
CarouselComponent->>CarouselComponent: Set _state.forward = false
Assessment against linked issues
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/lib/carousel/Carousel.svelteOops! Something went wrong! :( ESLint: 9.24.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from /eslint.config.js Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (4)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
07972c3
to
7942bd1
Compare
Closes #1551
📑 Description
Fixes an issue with carousel animations where the transition looked the same whether moving forward or backward.
This update introduces a
forward
state to track navigation direction —true
when moving to the next slide,false
for the previous one.Now the carousel correctly animates in the appropriate direction based on user interaction.
Status
✅ Checks
ℹ Additional Information
This PR fixes the issue reported in #1551 where the carousel animation was the same when moving backward as when moving forward. By tracking the direction with a
forward
state property (set totrue
for next slide andfalse
for previous slide), we enable the carousel to use appropriate transition animations for each direction.Commit message:
fix: add direction tracking to carousel transitions
Summary by CodeRabbit