Skip to content

fix: add tiny-dropdown component#1796

Merged
hexqi merged 1 commit intoopentiny:developfrom
xuanlid:fix/add-component
Mar 31, 2026
Merged

fix: add tiny-dropdown component#1796
hexqi merged 1 commit intoopentiny:developfrom
xuanlid:fix/add-component

Conversation

@xuanlid
Copy link
Copy Markdown
Contributor

@xuanlid xuanlid commented Mar 31, 2026

English | 简体中文

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Built its own designer, fully self-validated

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Background and solution

新增下拉菜单组件
image

image

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features
    • Added new TinyDropdown component (v3.22.0) to the UI library with customizable trigger modes (hover/click), configurable size options, split-button functionality, lazy-loading capabilities for menu options, text field mapping, comprehensive event handlers for item and button interactions, and flexible slot support for custom menu content composition.

@github-actions github-actions bot added the bug Something isn't working label Mar 31, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

Walkthrough

This pull request introduces the TinyDropdown component (version 3.22.0) to the mock configuration system across three JSON files. The component definition includes comprehensive schema metadata with properties, events, slots, and configuration details for integration within the design system.

Changes

Cohort / File(s) Summary
TinyDropdown Component Schema
designer-demo/public/mock/bundle.json
Added complete component definition for TinyDropdown including property schema (trigger, visible, split-button, size, menu-options), event handlers (onItemClick, onButtonClick, onVisibleChange), slot definitions (default, dropdown), and UI metadata with Chinese localization and icon configuration.
Component Mapping Configuration
mockServer/src/mock/get/app-center/v1/apps/schema/1.json, mockServer/src/mock/get/app-center/v1/apps/schema/16.json
Added TinyDropdown entries to componentsMap with package mapping (@opentiny/vue), export configuration (destructuring: true), and version specification (3.22.0) across two schema files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A dropdown of joy, now configured with care,
With options and schemas floating in air,
Three files now bloom with the menu's delight,
TinyDropdown dances—a component so bright! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'fix: add tiny-dropdown component' directly describes the main change: adding a TinyDropdown component to the codebase with configuration in multiple schema files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@designer-demo/public/mock/bundle.json`:
- Around line 634-635: The Chinese translation string under the "zh_CN" key in
the bundle.json contains a duplicated word ("或者或者组件"); update the value for
"zh_CN" to remove the duplicate so it reads "...必须是一个元素或者组件" (i.e., replace the
duplicated "或者" with a single "或者"). Ensure you only modify the string value
associated with the "zh_CN" entry in the JSON.

In `@mockServer/src/mock/get/app-center/v1/apps/schema/1.json`:
- Around line 2151-2157: There is a duplicate mapping object for componentName
"TinyDropdown" with package "@opentiny/vue" and exportName "TinyDropdown" that
is dead because the lookup uses .find() and the earlier mapping with exportName
"Dropdown" will always match first; remove the duplicate object (the one where
exportName is "TinyDropdown") so only the correct mapping (exportName:
"Dropdown") remains, or alternatively change its exportName to "Dropdown" to
match the established Tiny→unprefixed export pattern.

In `@mockServer/src/mock/get/app-center/v1/apps/schema/16.json`:
- Around line 1181-1187: Remove the duplicate entry that declares componentName
"TinyDropdown" with exportName "TinyDropdown" and instead update the existing
entry where componentName is "TinyDropdown" and exportName is "Dropdown" to the
intended version (match the new version value) so there is only one mapping for
TinyDropdown; delete the new block and change the version field on the existing
TinyDropdown/Dropdown object.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: eefac2de-06d6-4f12-84d9-f7b3fb8e5ce8

📥 Commits

Reviewing files that changed from the base of the PR and between e0821bc and ecc4e82.

📒 Files selected for processing (3)
  • designer-demo/public/mock/bundle.json
  • mockServer/src/mock/get/app-center/v1/apps/schema/1.json
  • mockServer/src/mock/get/app-center/v1/apps/schema/16.json

@hexqi hexqi merged commit afb0d79 into opentiny:develop Mar 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants