Feat:Add action menu component#1798
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdded 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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
designer-demo/public/mock/bundle.json (1)
68-73: Consider changingstepto 1 formaxShowNum.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
componentListdata source referenceshttp://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
📒 Files selected for processing (3)
designer-demo/public/mock/bundle.jsonmockServer/src/mock/get/app-center/v1/apps/schema/1.jsonmockServer/src/mock/get/app-center/v1/apps/schema/16.json
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
New Features
Chores