Skip to content

Feat:Add action menu component#1798

Merged
hexqi merged 2 commits intoopentiny:developfrom
lichunn:feat/add-actionMenu
Mar 31, 2026
Merged

Feat:Add action menu component#1798
hexqi merged 2 commits intoopentiny:developfrom
lichunn:feat/add-actionMenu

Conversation

@lichunn
Copy link
Copy Markdown
Collaborator

@lichunn lichunn 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

What is the current behavior?

Issue Number: N/A

What is the new behavior?

4bb89ae13c3331d2ba47e10cfa128a3c ad9d96df3580d273181a6a0a4a856bb2

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Added TinyActionMenu (Action Menu) component with configurable properties (options, display mode, placement, icon/text fields, spacing), event hooks, slots and an example snippet.
  • Chores

    • Updated component registry to use TinyActionMenu in place of the previous dropdown mapping.
    • Refreshed mock/schema data and data-source entries, reformatting and expanding list, query and utility configurations.

@github-actions github-actions bot added the enhancement New feature or request label Mar 31, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a3bbe331-18a8-45ae-a710-56e66d1caf8d

📥 Commits

Reviewing files that changed from the base of the PR and between 4d69716 and 0dbecf6.

📒 Files selected for processing (2)
  • mockServer/src/mock/get/app-center/v1/apps/schema/1.json
  • mockServer/src/mock/get/app-center/v1/apps/schema/16.json
✅ Files skipped from review due to trivial changes (1)
  • mockServer/src/mock/get/app-center/v1/apps/schema/1.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • mockServer/src/mock/get/app-center/v1/apps/schema/16.json

Walkthrough

Added a TinyActionMenu component entry and snippet to the designer bundle, updated the app-center schema mapping to export ActionMenu, and substantially restructured/expanded a mock application schema with richer dataSource entries, utils, componentsMap, and bridge configuration.

Changes

Cohort / File(s) Summary
Designer bundle
designer-demo/public/mock/bundle.json
Added TinyActionMenu component metadata and a snippet (动作菜单) including full schema: props (options, maxShowNum, mode, moreText, placement, showIcon, textField, spacing), events, slots, and container/modal/nesting flags.
App-center component map
mockServer/src/mock/get/app-center/v1/apps/schema/1.json
Replaced TinyDropdown mapping with a TinyActionMenu entry mapping to @opentiny/vue export ActionMenu (destructuring: true, version changed).
Mock app schema expansion
mockServer/src/mock/get/app-center/v1/apps/schema/16.json
Large reformat and content expansion: normalized top-level structure, extended data.dataSource.list items (new fields, timestamps, data.columns, data rows, JS hooks), added/updated items (getAllMaterialList, componentList, selectedComponents, treedata), and updated utils, componentsTree, componentsMap, and bridge sections.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

I nibble bytes beneath the moonlit view,
TinyActionMenu hops into the crew. 🐇
JSON leaves rustle, new fields take flight,
Mock trees grow branches in the soft night,
A rabbit cheers — the bundle looks just right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feat:Add action menu component' directly and clearly summarizes the main change—adding a new TinyActionMenu component across multiple configuration files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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

🧹 Nitpick comments (2)
designer-demo/public/mock/bundle.json (1)

68-73: Consider changing step to 1 for maxShowNum.

A step of 2 restricts input to even numbers only (0, 2, 4, 6...). Users who want to display exactly 1 or 3 menu items cannot easily set this value via the stepper. Unless this is intentional, consider:

♻️ Suggested fix
                     "widget": {
                       "props": {
-                        "step": 2
+                        "step": 1
                       },
                       "component": "NumberConfigurator"
                     },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@designer-demo/public/mock/bundle.json` around lines 68 - 73, The
NumberConfigurator widget currently sets props.step to 2 which limits the
maxShowNum stepper to even numbers; change the step value from 2 to 1 for the
widget that controls maxShowNum so the stepper allows every integer (1,2,3...),
locate the widget object with "component": "NumberConfigurator" and update its
props.step accordingly.
mockServer/src/mock/get/app-center/v1/apps/schema/16.json (1)

577-580: Localhost URI reference in mock data.

The componentList data source references http://localhost:9090/assets/json/bundle.json. This is acceptable for local mock server usage, but verify this doesn't affect any environments expecting real endpoints.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mockServer/src/mock/get/app-center/v1/apps/schema/16.json` around lines 577 -
580, The mock data's componentList data source currently hardcodes "options.uri"
to "http://localhost:9090/assets/json/bundle.json"; change this to a
non-environment-specific reference (e.g. a relative path
"/assets/json/bundle.json") or wire it to a configurable base URL (e.g.
BASE_MOCK_URL) so that componentList.options.uri doesn't break non-local
environments; update any loader/init that consumes componentList to read the env
var fallback and document the new config key.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@mockServer/src/mock/get/app-center/v1/apps/schema/16.json`:
- Around line 1347-1358: The JSON entry for the Modal package has trailing
spaces in the "name" and "exportName" fields which will break lookups; edit the
object where "name": "Modal " and "content"."exportName": "Modal " and remove
the trailing spaces so both read "Modal", and scan nearby entries for similar
stray whitespace to avoid future lookup failures.
- Around line 1188-1194: The componentsMap contains duplicate entries for
componentName "TinyDropdown" (one with exportName "Dropdown" version "0.1.20"
and another with exportName "TinyDropdown" version "3.22.0"); remove or
consolidate them so only a single authoritative mapping exists in
componentsMap—choose the correct package/exportName/version (e.g., keep the
desired exportName and version) and ensure destructuring and package fields are
consistent for that single entry to avoid conflicting imports.
- Around line 1324-1370: The entries for utils named "Button", "Menu", "Modal ",
and "Pager" are marked type: "npm" but lack the required content.cdnLink so the
runtime filter (item.type === 'npm' && item.content.cdnLink) will skip them; fix
by either adding a valid content.cdnLink URL for each npm entry (matching the
pattern used for the "axios" entry), or change/remove the entry or its type to
the appropriate resolver; ensure you update the objects that include exportName
("Button", "NavMenu", "Modal ", "Pager") and add the cdnLink field inside their
content objects.

---

Nitpick comments:
In `@designer-demo/public/mock/bundle.json`:
- Around line 68-73: The NumberConfigurator widget currently sets props.step to
2 which limits the maxShowNum stepper to even numbers; change the step value
from 2 to 1 for the widget that controls maxShowNum so the stepper allows every
integer (1,2,3...), locate the widget object with "component":
"NumberConfigurator" and update its props.step accordingly.

In `@mockServer/src/mock/get/app-center/v1/apps/schema/16.json`:
- Around line 577-580: The mock data's componentList data source currently
hardcodes "options.uri" to "http://localhost:9090/assets/json/bundle.json";
change this to a non-environment-specific reference (e.g. a relative path
"/assets/json/bundle.json") or wire it to a configurable base URL (e.g.
BASE_MOCK_URL) so that componentList.options.uri doesn't break non-local
environments; update any loader/init that consumes componentList to read the env
var fallback and document the new config key.
🪄 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: 6caba6da-b3f3-4f4c-ab60-3709a1e55196

📥 Commits

Reviewing files that changed from the base of the PR and between 06b9cd8 and 4d69716.

📒 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 21cb852 into opentiny:develop Mar 31, 2026
2 checks 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.

2 participants