-
-
Notifications
You must be signed in to change notification settings - Fork 0
509 swipable carousel block #682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
Warning Rate limit exceeded@ashleyshaw has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 25 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new Swipable Carousel (Slider) block to the Tour Operator plugin, enabling content creators to display inner blocks in a horizontally scrollable, swipe-enabled carousel format. The implementation includes comprehensive editor controls, touch/mouse navigation, responsive breakpoint handling, accessibility features, and support for both manual and dynamic (post-template) content.
Key Changes:
- New
slider-groupblock with full block.json registration and editor/frontend JavaScript - Touch and mouse drag/swipe navigation with horizontal/vertical scroll detection
- Responsive design: configurable slide counts for desktop/tablet/mobile breakpoints
- Accessibility: keyboard navigation, ARIA labels, reduced motion support
- Dynamic slide management and post-template integration
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| src/blocks/slider-group/style.scss | Frontend and shared slider styles including navigation, dots, responsive behavior, and accessibility |
| src/blocks/slider-group/slider.js | Core slider functionality class handling initialization, navigation, touch events, and responsive updates |
| src/blocks/slider-group/index.js | Block registration with Edit/Save components, editor controls, and frontend initialization |
| src/blocks/slider-group/editor.scss | Editor-specific styles for block controls, slide management, and preview mode |
| src/blocks/slider-group/block.json | Block metadata defining attributes, supports, and asset references |
| package.json | Added block editor dependencies for enhanced functionality |
|
|
||
| .wp-block-lsx-tour-operator-slider { | ||
| position: relative; | ||
| //overflow: hidden; |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out code should be removed. If overflow control is intentional at line 95 as a backup, this comment should either be removed or clarified with an explanation of why it's disabled here.
| //overflow: hidden; | |
| /* Overflow is intentionally not set here to allow slider elements to be visible outside the container if needed. | |
| If overflow control is required, uncomment the line below: | |
| overflow: hidden; | |
| */ |
| position: relative; | ||
| width: 100%; | ||
| transition: transform 0.3s ease-in-out; | ||
| flex-direction: row!important; |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space before !important. Should be flex-direction: row !important; per CSS formatting standards.
| flex-direction: row!important; | |
| flex-direction: row !important; |
| border: 2px solid white; | ||
| } | ||
|
|
||
| .slider_dot { |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Class selector uses underscore .slider_dot but the actual class name is .slider-dot (with hyphen) as seen in lines 201-218. This selector will never match any elements.
| .slider_dot { | |
| .slider-dot { |
|
|
||
| console.log(window.innerWidth); | ||
|
|
||
| console.log('Updating slider with visible slides:', visibleSlides); |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug console.log statements should be removed from production code.
| console.log('Updating slider with visible slides:', visibleSlides); |
| slide.style.width = `${slideWidthPx}px`; | ||
| slide.style.minWidth = `${Math.max(slideWidthPx, this.options.itemMinWidth)}px`; | ||
| slide.style.maxWidth = `${Math.min(slideWidthPx, this.options.itemMaxWidth)}px`; | ||
| console.log('slideWidthPx', slideWidthPx, 'minWidth', this.options.itemMinWidth, 'maxWidth', this.options.itemMaxWidth); |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug console.log statement should be removed from production code.
| console.log('slideWidthPx', slideWidthPx, 'minWidth', this.options.itemMinWidth, 'maxWidth', this.options.itemMaxWidth); |
| // slide.style.display = 'none'; | ||
| // slide.style.flex = ''; | ||
| // slide.style.opacity = ''; | ||
| // slide.style.transform = ''; |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out code should be removed. If this logic may be needed later, use version control history instead of leaving commented blocks.
| //display: none; | ||
|
|
||
| // Only show slides with .visible class | ||
| &.visible { | ||
| //display: block; |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out code should be removed or clarified with an explanation of why this display rule is disabled.
| //display: none; | |
| // Only show slides with .visible class | |
| &.visible { | |
| //display: block; | |
| // Only show slides with .visible class | |
| &.visible { |
| //display: none; | ||
|
|
||
| // Only show slides with .visible class | ||
| &.visible { | ||
| //display: block; |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out code should be removed or clarified with an explanation of why this display rule is disabled.
| //display: none; | |
| // Only show slides with .visible class | |
| &.visible { | |
| //display: block; | |
| // Only show slides with .visible class | |
| &.visible { |
| } | ||
|
|
||
| .slider-slide.wp-block-group { | ||
| opacity: 1!important; |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space before !important. Should be opacity: 1 !important; per CSS formatting standards.
| opacity: 1!important; | |
| opacity: 1 !important; |
| } | ||
| }, |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The slidesToScroll attribute is referenced in the JavaScript code (index.js line 42, slider.js line 18) but is missing from the block.json attributes definition. Add the attribute definition for slidesToScroll with type number and default value 1.
| } | |
| }, | |
| }, |
name: "Default PR"
about: "General change; use for features, improvements, refactors when no specific template fits"
title: "change: Swipable Carousel (Slider) Block"
Summary
Linked issues: Relates to #509
This PR introduces a new, highly customizable and responsive Swipable Carousel (Slider) block to the Tour Operator plugin. The block allows content creators to present any inner block content (including dynamic post templates) in a horizontally scrollable, swipe-enabled carousel, improving content presentation and user engagement on both desktop and mobile.
Changes
slider-groupblock with:block.jsonand registration.index.js,slider.js) for block registration and runtime logic.package.jsonto support new block editor features and internal tooling.Screenshots / Before–After (if UI)
Add screenshots or GIFs showing the new block in the editor and frontend, with mobile/desktop responsiveness and swipe controls.
Test Notes
Risk & Rollback
Checklist (Global DoD / PR)