Skip to content

feat: add overflow mode and auto-scroll options to SuggestionPills co… #129

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

Merged
merged 1 commit into from
Jun 28, 2025

Conversation

gene9831
Copy link
Collaborator

@gene9831 gene9831 commented Jun 28, 2025

…mponent

  • Introduced overflowMode prop to control how excess items are displayed: either by expanding or scrolling.
  • Added autoScrollOnHover prop to enable automatic scrolling to visible items when hovered.
  • Updated documentation to reflect new properties and their functionalities.
  • Enhanced event handling in the SuggestionPills component for improved user experience.

Summary by CodeRabbit

  • New Features

    • Added two new options to the Suggestion Pills component: "overflow mode" (choose between expanding all items or enabling horizontal scrolling) and "auto-scroll on hover" (automatically scrolls to hovered items when in scroll mode).
    • Updated the demo and documentation to showcase and explain these new options.
  • Bug Fixes

    • Improved event handling for pill item interactions to ensure smoother and more intuitive user experience.
  • Documentation

    • Enhanced documentation with detailed descriptions of new properties and updated type definitions for improved clarity.

…mponent

- Introduced `overflowMode` prop to control how excess items are displayed: either by expanding or scrolling.
- Added `autoScrollOnHover` prop to enable automatic scrolling to visible items when hovered.
- Updated documentation to reflect new properties and their functionalities.
- Enhanced event handling in the SuggestionPills component for improved user experience.
Copy link

coderabbitai bot commented Jun 28, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The SuggestionPills component and its documentation were updated to support two new props: overflowMode and autoScrollOnHover, enabling configurable overflow behaviors and auto-scrolling on hover. Related event signatures, UI controls, and type definitions were updated accordingly, and supporting styles and logic for horizontal scrolling were added.

Changes

File(s) Change Summary
docs/demos/suggestion/pills-popper-config.vue Added UI controls for overflowMode and autoScrollOnHover; updated prop bindings and layout; removed some styles
docs/src/components/suggestion-pills.md Documented new props and updated type definitions for actions and props
packages/components/src/suggestion-pills/index.type.ts Added overflowMode and autoScrollOnHover to SuggestionPillsProps interface
packages/components/src/suggestion-pills/index.vue Added overflowMode prop and logic for scroll/expand modes; implemented auto-scroll on hover; updated styles
packages/components/src/suggestion-pills/components/PillButtonWrapper.vue Changed event emissions for click/mouseenter; removed unused import
packages/components/src/suggestion-popover/index.vue Changed popover trigger event from pointerup to click

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SuggestionPills
    participant PillButtonWrapper

    User->>SuggestionPills: Hover or click pill
    alt overflowMode = 'scroll' and autoScrollOnHover = true
        PillButtonWrapper->>SuggestionPills: mouseenter event
        SuggestionPills->>SuggestionPills: scrollIntoViewIfPartiallyHidden()
    end
    User->>SuggestionPills: Click "show more" (if overflowMode = 'expand')
    SuggestionPills->>SuggestionPills: Expand and show all pills
Loading

Poem

🐇
New pills now scroll or expand with pride,
On hover, they smoothly glide.
With just a switch or radio tap,
Overflow’s no longer a trap!
Docs and types keep pace in stride—
A bunny’s joy is hard to hide!
🌱

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/components/src/suggestion-pills/components/PillButtonWrapper.vue

Oops! Something went wrong! :(

ESLint: 9.30.0

Error: The 'jiti' library is required for loading TypeScript configuration files. Make sure to install it.
at /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:145:10
at async loadTypeScriptConfigFileWithJiti (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:144:3)
at async loadConfigFile (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:266:11)
at async ConfigLoader.calculateConfigArray (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:589:23)
at async #calculateConfigArray (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:743:23)
at async /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint.js:760:6
at async Promise.all (index 0)
at async ESLint.lintFiles (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint.js:757:19)
at async Object.execute (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli.js:632:14)
at async main (/node_modules/.pnpm/[email protected]/node_modules/eslint/bin/eslint.js:175:19)

docs/demos/suggestion/pills-popper-config.vue

Oops! Something went wrong! :(

ESLint: 9.30.0

Error: The 'jiti' library is required for loading TypeScript configuration files. Make sure to install it.
at /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:145:10
at async loadTypeScriptConfigFileWithJiti (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:144:3)
at async loadConfigFile (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:266:11)
at async ConfigLoader.calculateConfigArray (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:589:23)
at async #calculateConfigArray (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:743:23)
at async /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint.js:760:6
at async Promise.all (index 0)
at async ESLint.lintFiles (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint.js:757:19)
at async Object.execute (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli.js:632:14)
at async main (/node_modules/.pnpm/[email protected]/node_modules/eslint/bin/eslint.js:175:19)

packages/components/src/suggestion-pills/index.type.ts

Oops! Something went wrong! :(

ESLint: 9.30.0

Error: The 'jiti' library is required for loading TypeScript configuration files. Make sure to install it.
at /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:145:10
at async loadTypeScriptConfigFileWithJiti (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:144:3)
at async loadConfigFile (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:266:11)
at async ConfigLoader.calculateConfigArray (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:589:23)
at async #calculateConfigArray (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config-loader.js:743:23)
at async /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint.js:760:6
at async Promise.all (index 0)
at async ESLint.lintFiles (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint.js:757:19)
at async Object.execute (/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli.js:632:14)
at async main (/node_modules/.pnpm/[email protected]/node_modules/eslint/bin/eslint.js:175:19)

  • 2 others

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c19738b and e67a1c2.

📒 Files selected for processing (6)
  • docs/demos/suggestion/pills-popper-config.vue (2 hunks)
  • docs/src/components/suggestion-pills.md (2 hunks)
  • packages/components/src/suggestion-pills/components/PillButtonWrapper.vue (3 hunks)
  • packages/components/src/suggestion-pills/index.type.ts (1 hunks)
  • packages/components/src/suggestion-pills/index.vue (4 hunks)
  • packages/components/src/suggestion-popover/index.vue (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@gene9831
Copy link
Collaborator Author

@coderabbitai review

Copy link

coderabbitai bot commented Jun 28, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@hexqi hexqi merged commit 90dacd8 into opentiny:release/v0.2.x Jun 28, 2025
@gene9831 gene9831 deleted the feat/pills branch June 28, 2025 08:45
gene9831 added a commit to gene9831/tiny-robot that referenced this pull request Jul 3, 2025
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.

2 participants