Skip to content

feat: update search-box#9

Merged
kagol merged 1 commit intomainfrom
kagol/update-search-box
Jul 9, 2025
Merged

feat: update search-box#9
kagol merged 1 commit intomainfrom
kagol/update-search-box

Conversation

@kagol
Copy link
Member

@kagol kagol commented Jul 9, 2025

Summary by CodeRabbit

  • New Features

    • Introduced modular first-level and second-level panel components for the search box, enabling more flexible dropdown panel rendering.
    • Added new events and event handling capabilities, including a clear event and centralized event delegation for the search box.
    • Added new documentation examples and tests for advanced search box features, including combination panels, event handling, and custom default search items.
  • Bug Fixes

    • Improved dropdown visibility control for various user actions, ensuring the dropdown hides or shows at appropriate times during tag, checkbox, and input interactions.
    • Enhanced matching and highlighting logic for search box filters and input values.
  • Refactor

    • Modularized dropdown panel rendering logic and improved state management for checkbox groups.
    • Removed unused or redundant code, streamlined event handling, and improved defensive checks on list accesses.
    • Updated and simplified documentation and example usage for improved clarity.
  • Documentation

    • Updated and expanded documentation with new usage examples, improved style import instructions, and added feature icons and images to the homepage.
    • Added and updated tests to cover new and existing search box features.
  • Chores

    • Updated dependencies and scripts in package configuration files for better maintenance and consistency.
    • Improved and standardized CSS styling, including enhanced scrollbar appearance and consistent use of CSS variables.
  • Style

    • Minor formatting and whitespace adjustments in code and documentation for consistency.

@coderabbitai
Copy link

coderabbitai bot commented Jul 9, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces new modular components for the search box's dropdown panels, refactors dropdown and event handling logic, and adds new Playwright tests and documentation examples. Several Vue components and composables are updated for improved dropdown visibility, event emission, and defensive coding. Styles are enhanced for consistency and accessibility. Some utility code is removed or consolidated.

Changes

Files/Groups Change Summary
packages/search-box/src/components/first-level-panel.vue, second-level-panel.vue Added new modular Vue components for first- and second-level dropdown panels.
packages/search-box/src/index.vue Refactored to use new panel components, reworked dropdown/event logic, added clear event, exposed handleEvents.
packages/search-box/src/composables/use-*.ts (checkbox, custom, datepicker, dropdown, edit, init, match, num-range, placeholder, tag) Refined dropdown visibility logic, improved event emission, added defensive checks, introduced selectInputValue, removed/updated computed properties and flags.
packages/search-box/src/utils/dropdown.ts Refactored dropdown visibility control to use timer-based state instead of direct DOM manipulation.
packages/search-box/src/utils/tag.ts Adjusted event emission flow, removed direct dropdown manipulation, improved popover handling.
packages/search-box/src/index.less Enhanced styles: added CSS variables, improved scrollbar, dropdown, and checkbox styling, standardized selectors.
packages/search-box/package.json Added @opentiny/utils as a dependency.
packages/search-box/src/utils/date.ts Removed comprehensive date/time utility module and all its exports.
packages/docs/search-box/combination-panel.vue, settings.vue Added new Vue documentation examples for custom/combination panels and default field setting.
packages/docs/search-box/auto-match.vue, custom-panel.vue, events.vue, item-placeholder.vue, max-length.vue, etc. Updated examples: improved imports, event handling, async options, UI feedback, and minor code cleanups.
packages/docs/search-box/auto-match.spec.ts, combination-panel.spec.ts, events.spec.ts, settings.spec.ts, max-time-length.spec.ts Added/updated Playwright tests: expanded coverage for matching, events, combination panels, settings, and date range.
packages/docs/search-box/data-source.ts Removed regexps from data source, renamed some option labels.
packages/docs/package.json, README.md, README.zh-CN.md Updated dependencies, style import paths, and documentation.
packages/docs/index.md, examples/*.md Improved homepage hero section, icons, and example references.
packages/docs/.vitepress/theme/index.ts Removed import of a historical module version.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SearchBox
    participant FirstLevelPanel
    participant SecondLevelPanel
    participant ParentComponent

    User->>SearchBox: Focuses or types input
    SearchBox->>FirstLevelPanel: Render with state & potentialOptions
    User->>FirstLevelPanel: Selects input/attribute
    FirstLevelPanel-->>SearchBox: Emits select event
    SearchBox->>SecondLevelPanel: (If needed) Render with state & pickerOptions
    User->>SecondLevelPanel: Selects value(s), confirms
    SecondLevelPanel-->>SearchBox: Emits select/confirm event
    SearchBox-->>ParentComponent: Emits change/search/clear event(s)
Loading

Poem

In the warren where code does hop,
New panels bloom and dropdowns pop!
Events now leap with bunny grace,
While scrollbars show a polished face.
Out with old dates, in with new,
Search Box shines with features true!
🐇✨


📜 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 c7edf02 and 5e13bdd.

📒 Files selected for processing (50)
  • README.md (1 hunks)
  • README.zh-CN.md (1 hunks)
  • package.json (1 hunks)
  • packages/docs/.vitepress/theme/index.ts (0 hunks)
  • packages/docs/examples/basic-usage.md (1 hunks)
  • packages/docs/examples/custom-panel.md (1 hunks)
  • packages/docs/examples/editable.md (1 hunks)
  • packages/docs/examples/split-input-value.md (1 hunks)
  • packages/docs/index.md (2 hunks)
  • packages/docs/package.json (1 hunks)
  • packages/docs/search-box/auto-match.spec.ts (1 hunks)
  • packages/docs/search-box/auto-match.vue (1 hunks)
  • packages/docs/search-box/combination-panel.spec.ts (1 hunks)
  • packages/docs/search-box/combination-panel.vue (1 hunks)
  • packages/docs/search-box/custom-panel.vue (2 hunks)
  • packages/docs/search-box/data-source.ts (1 hunks)
  • packages/docs/search-box/default-field.vue (0 hunks)
  • packages/docs/search-box/editable.vue (0 hunks)
  • packages/docs/search-box/empty-placeholder.vue (0 hunks)
  • packages/docs/search-box/events.spec.ts (1 hunks)
  • packages/docs/search-box/events.vue (1 hunks)
  • packages/docs/search-box/group-key.vue (0 hunks)
  • packages/docs/search-box/help.vue (0 hunks)
  • packages/docs/search-box/item-placeholder.vue (2 hunks)
  • packages/docs/search-box/max-length.vue (2 hunks)
  • packages/docs/search-box/max-time-length.spec.ts (2 hunks)
  • packages/docs/search-box/panel-max-height.vue (0 hunks)
  • packages/docs/search-box/potential-match.vue (1 hunks)
  • packages/docs/search-box/settings.spec.ts (1 hunks)
  • packages/docs/search-box/settings.vue (1 hunks)
  • packages/docs/search-box/split-input-value.vue (0 hunks)
  • packages/docs/search-box/v-model.vue (0 hunks)
  • packages/search-box/package.json (1 hunks)
  • packages/search-box/src/components/first-level-panel.vue (1 hunks)
  • packages/search-box/src/components/second-level-panel.vue (1 hunks)
  • packages/search-box/src/composables/use-checkbox.ts (3 hunks)
  • packages/search-box/src/composables/use-custom.ts (1 hunks)
  • packages/search-box/src/composables/use-datepicker.ts (1 hunks)
  • packages/search-box/src/composables/use-dropdown.ts (8 hunks)
  • packages/search-box/src/composables/use-edit.ts (2 hunks)
  • packages/search-box/src/composables/use-init.ts (4 hunks)
  • packages/search-box/src/composables/use-match.ts (7 hunks)
  • packages/search-box/src/composables/use-num-range.ts (1 hunks)
  • packages/search-box/src/composables/use-placeholder.ts (1 hunks)
  • packages/search-box/src/composables/use-tag.ts (2 hunks)
  • packages/search-box/src/index.less (12 hunks)
  • packages/search-box/src/index.vue (17 hunks)
  • packages/search-box/src/utils/date.ts (0 hunks)
  • packages/search-box/src/utils/dropdown.ts (1 hunks)
  • packages/search-box/src/utils/tag.ts (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kagol/update-search-box

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.

@github-actions github-actions bot added the enhancement New feature or request label Jul 9, 2025
@kagol kagol merged commit 8949adf into main Jul 9, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant