-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
feat: add left and right scroll buttons to Tabs bar #4161 #4162
Conversation
|
WalkthroughThe recent changes enhance the tab components in the UI kit, focusing on accessibility and usability. Key updates include the addition of an Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TabBar
participant ScrollBar
User->>TabBar: Scroll left/right
TabBar->>ScrollBar: Trigger scroll action
ScrollBar-->>TabBar: Update view
TabBar->>User: Display updated tabs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
Files selected for processing (4)
- packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue (1 hunks)
- packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue (1 hunks)
- packages/effects/layouts/package.json (1 hunks)
- packages/effects/layouts/src/basic/tabbar/tabbar.vue (4 hunks)
Files skipped from review due to trivial changes (2)
- packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue
- packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue
Additional comments not posted (4)
packages/effects/layouts/package.json (1)
23-23
: Dependency Addition:@radix-icons/vue
.The addition of the
@radix-icons/vue
package is appropriate given the new icon usage in thetabbar.vue
component. Ensure that the package is correctly installed and used across the project.packages/effects/layouts/src/basic/tabbar/tabbar.vue (3)
Line range hint
2-17
:
New Imports for Scrolling and Icons.The imports for
onMounted
,ChevronLeftIcon
,ChevronRightIcon
, anduseTabViewScroll
are appropriate for the new scrolling functionality and icon usage in the tab bar. Ensure these are correctly integrated and utilized throughout the component.
59-68
: Scroll Elements Initialization.The
onMounted
hook correctly initializes the scroll elements by querying the DOM and setting them withsetScrollBarEl
andsetScrollViewEl
. Ensure that the element selectors are accurate and that the elements exist in the DOM when this code runs.
Line range hint
72-94
:
Template Enhancements for Scrolling.The addition of
ChevronLeftIcon
andChevronRightIcon
in the template provides intuitive controls for scrolling through tabs. The@click
events are appropriately set to callscrollDirection
with the correct parameters. Ensure that thescrollDirection
method is implemented correctly to handle these actions.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
Files selected for processing (5)
- packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue (1 hunks)
- packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue (1 hunks)
- packages/effects/layouts/package.json (1 hunks)
- packages/effects/layouts/src/basic/tabbar/tabbar.vue (4 hunks)
- packages/effects/layouts/src/basic/tabbar/use-tab-view-scroll.ts (1 hunks)
Files skipped from review as they are similar to previous changes (4)
- packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue
- packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue
- packages/effects/layouts/package.json
- packages/effects/layouts/src/basic/tabbar/tabbar.vue
Additional comments not posted (4)
packages/effects/layouts/src/basic/tabbar/use-tab-view-scroll.ts (4)
9-11
: LGTM!The
setScrollBarEl
function is straightforward and correctly assigns the element to the reactive reference.
13-15
: LGTM!The
setScrollViewEl
function is straightforward and correctly assigns the element to the reactive reference.
17-27
: LGTM!The
getScrollClientWidth
function correctly calculates and returns the client widths of the scrollbar and viewport elements, handling null cases appropriately.
29-43
: LGTM!The
scrollDirection
function correctly handles scrolling logic with smooth behavior, ensuring checks for element existence and appropriate conditions for scrolling.
Description
Type of change
Please delete options that are not relevant.
pnpm-lock.yaml
unless you introduce a new test example.Checklist
pnpm run docs:dev
command.pnpm test
.feat:
,fix:
,perf:
,docs:
, orchore:
.Summary by CodeRabbit
New Features
Improvements
id
attribute to the scrollbar components for better accessibility and targeting in styling.