Conversation
WalkthroughThis update primarily increments the version numbers from 2.5.0 (or 2.6.0-rc.0) to 2.6.0 across numerous Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TreeComponent
participant CollapseMap
participant ParentNode
User->>TreeComponent: Clicks on row or collapse icon
TreeComponent->>TreeComponent: handleClickRow(event, node)
alt Click on collapse icon
TreeComponent-->>TreeComponent: Ignore event
else Click elsewhere
TreeComponent->>TreeComponent: Emit click event
end
User->>TreeComponent: Types in filter input
TreeComponent->>TreeComponent: Watch filter value
TreeComponent->>TreeComponent: Filter nodes by label
TreeComponent->>CollapseMap: Expand ancestors of matched nodes
CollapseMap-->>TreeComponent: Update collapse states
Poem
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
packages/plugins/page/src/Tree.vue (1)
260-274: Add null check before non-null assertion.The non-null assertion on line 265 could cause runtime errors. Add a defensive check:
const handleDragOver = (event: DragEvent, node: TreeNode) => { if (!props.draggable) { return } + if (!draggedNode.value) { + return + } + const isDescendant = getAncestorIds(node.id).includes(draggedNode.value!.id)
🧹 Nitpick comments (1)
packages/plugins/page/src/Tree.vue (1)
162-197: Consider extracting the filtering logic for better maintainability.The dual-watcher approach with different update paths is complex. While the implementation is correct, consider extracting this logic into a composable for better testability and maintainability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (58)
designer-demo/package.json(1 hunks)mockServer/package.json(1 hunks)packages/block-compiler/package.json(1 hunks)packages/blockToWebComponentTemplate/package.json(1 hunks)packages/build/vite-config/package.json(1 hunks)packages/build/vite-plugin-meta-comments/package.json(1 hunks)packages/builtinComponent/package.json(1 hunks)packages/canvas/package.json(1 hunks)packages/common/package.json(1 hunks)packages/configurator/package.json(1 hunks)packages/design-core/package.json(1 hunks)packages/engine-cli/package.json(1 hunks)packages/engine-cli/template/designer/package.json(2 hunks)packages/engine-cli/template/designer/public/mock/bundle.json(12 hunks)packages/engine-cli/template/designer/src/preview.js(1 hunks)packages/i18n/package.json(1 hunks)packages/layout/package.json(1 hunks)packages/plugins/block/package.json(1 hunks)packages/plugins/bridge/package.json(1 hunks)packages/plugins/datasource/package.json(1 hunks)packages/plugins/help/package.json(1 hunks)packages/plugins/i18n/package.json(1 hunks)packages/plugins/materials/package.json(1 hunks)packages/plugins/page/package.json(1 hunks)packages/plugins/page/src/Tree.vue(12 hunks)packages/plugins/robot/package.json(1 hunks)packages/plugins/schema/package.json(1 hunks)packages/plugins/script/package.json(1 hunks)packages/plugins/state/package.json(1 hunks)packages/plugins/tree/package.json(1 hunks)packages/plugins/tutorial/package.json(1 hunks)packages/register/package.json(1 hunks)packages/settings/design/package.json(1 hunks)packages/settings/events/package.json(1 hunks)packages/settings/panel/package.json(1 hunks)packages/settings/props/package.json(1 hunks)packages/settings/styles/package.json(1 hunks)packages/svgs/package.json(1 hunks)packages/theme/base/package.json(1 hunks)packages/toolbars/breadcrumb/package.json(1 hunks)packages/toolbars/clean/package.json(1 hunks)packages/toolbars/collaboration/package.json(1 hunks)packages/toolbars/fullscreen/package.json(1 hunks)packages/toolbars/generate-code/package.json(1 hunks)packages/toolbars/lang/package.json(1 hunks)packages/toolbars/lock/package.json(1 hunks)packages/toolbars/logo/package.json(1 hunks)packages/toolbars/media/package.json(1 hunks)packages/toolbars/preview/package.json(1 hunks)packages/toolbars/redoundo/package.json(1 hunks)packages/toolbars/refresh/package.json(1 hunks)packages/toolbars/save/package.json(1 hunks)packages/toolbars/setting/package.json(1 hunks)packages/toolbars/themeSwitch/package.json(1 hunks)packages/toolbars/view-setting/package.json(1 hunks)packages/utils/package.json(1 hunks)packages/vue-generator/package.json(1 hunks)packages/webcomponent/package.json(1 hunks)
🧰 Additional context used
🧠 Learnings (8)
packages/builtinComponent/package.json (1)
Learnt from: gene9831
PR: opentiny/tiny-engine#917
File: docs/开始/快速上手.md:31-31
Timestamp: 2024-12-14T05:53:28.501Z
Learning: The latest stable version of `@opentiny/tiny-engine-cli` is `2.0.0`, and documentation should reference this version instead of any release candidates.
packages/plugins/help/package.json (1)
Learnt from: gene9831
PR: opentiny/tiny-engine#917
File: docs/开始/快速上手.md:31-31
Timestamp: 2024-12-14T05:53:28.501Z
Learning: The latest stable version of `@opentiny/tiny-engine-cli` is `2.0.0`, and documentation should reference this version instead of any release candidates.
packages/utils/package.json (1)
Learnt from: gene9831
PR: opentiny/tiny-engine#917
File: docs/开始/快速上手.md:31-31
Timestamp: 2024-12-14T05:53:28.501Z
Learning: The latest stable version of `@opentiny/tiny-engine-cli` is `2.0.0`, and documentation should reference this version instead of any release candidates.
packages/configurator/package.json (1)
Learnt from: gene9831
PR: opentiny/tiny-engine#917
File: docs/开始/快速上手.md:31-31
Timestamp: 2024-12-14T05:53:28.501Z
Learning: The latest stable version of `@opentiny/tiny-engine-cli` is `2.0.0`, and documentation should reference this version instead of any release candidates.
packages/common/package.json (1)
Learnt from: gene9831
PR: opentiny/tiny-engine#917
File: docs/开始/快速上手.md:31-31
Timestamp: 2024-12-14T05:53:28.501Z
Learning: The latest stable version of `@opentiny/tiny-engine-cli` is `2.0.0`, and documentation should reference this version instead of any release candidates.
packages/vue-generator/package.json (1)
Learnt from: chilingling
PR: opentiny/tiny-engine#837
File: packages/vue-generator/src/plugins/genDependenciesPlugin.js:66-66
Timestamp: 2024-09-30T07:51:10.036Z
Learning: In the `tiny-engine` project, `@opentiny/tiny-engine-dsl-vue` refers to the current package itself, and importing types from it may cause circular dependencies.
packages/engine-cli/package.json (1)
Learnt from: gene9831
PR: opentiny/tiny-engine#917
File: docs/开始/快速上手.md:31-31
Timestamp: 2024-12-14T05:53:28.501Z
Learning: The latest stable version of `@opentiny/tiny-engine-cli` is `2.0.0`, and documentation should reference this version instead of any release candidates.
packages/plugins/tutorial/package.json (1)
Learnt from: gene9831
PR: opentiny/tiny-engine#917
File: docs/开始/快速上手.md:31-31
Timestamp: 2024-12-14T05:53:28.501Z
Learning: The latest stable version of `@opentiny/tiny-engine-cli` is `2.0.0`, and documentation should reference this version instead of any release candidates.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: push-check
🔇 Additional comments (66)
packages/layout/package.json (1)
3-3: Bump package version
Version updated from 2.5.0 to 2.6.0 and aligned with the coordinated release.packages/register/package.json (1)
3-3: Bump package version
Version updated from 2.5.0 to 2.6.0 as part of the v2.6 release.packages/canvas/package.json (1)
3-3: Bump package version
Version updated from 2.5.0 to 2.6.0 to stay in sync with other packages.packages/toolbars/media/package.json (1)
3-3: Bump package version
Version updated from 2.5.0 to 2.6.0 for the media toolbar package.packages/plugins/i18n/package.json (1)
3-3: Bump package version
Version updated from 2.5.0 to 2.6.0 in the i18n plugin package.packages/plugins/block/package.json (1)
3-3: Coordinated version bump to 2.6.0
The package version has been correctly incremented from 2.5.0 to 2.6.0 as part of the v2.6 release cycle. No other fields were modified.packages/toolbars/fullscreen/package.json (1)
3-3: Coordinated version bump to 2.6.0
The package version has been correctly incremented from 2.5.0 to 2.6.0 as part of the v2.6 release cycle. No other fields were modified.packages/plugins/datasource/package.json (1)
3-3: Coordinated version bump to 2.6.0
The package version has been correctly incremented from 2.5.0 to 2.6.0 as part of the v2.6 release cycle. No other fields were modified.packages/plugins/materials/package.json (1)
3-3: Coordinated version bump to 2.6.0
The package version has been correctly incremented from 2.5.0 to 2.6.0 as part of the v2.6 release cycle. No other fields were modified.packages/toolbars/save/package.json (1)
3-3: Coordinated version bump to 2.6.0
The package version has been correctly incremented from 2.5.0 to 2.6.0 as part of the v2.6 release cycle. No other fields were modified.packages/settings/panel/package.json (1)
3-3: Approve version bump to 2.6.0.
This aligns with the coordinated release across all related packages.packages/toolbars/breadcrumb/package.json (1)
3-3: Approve version bump to 2.6.0.
Consistent with the repository-wide version update for the upcoming release.packages/plugins/state/package.json (1)
3-3: Approve version bump to 2.6.0.
Matches the new release version for the state plugin.packages/toolbars/lang/package.json (1)
3-3: Approve version bump to 2.6.0.
Version update is in sync with other toolbar packages.packages/plugins/tree/package.json (1)
3-3: Approve version bump to 2.6.0.
Ensures the tree plugin is correctly tagged for the v2.6 release.packages/settings/props/package.json (1)
3-3: Version bump to 2.6.0: The package version has been correctly updated to align with the v2.6.0 release.packages/toolbars/redoundo/package.json (1)
3-3: Version bump to 2.6.0: The package version has been correctly updated as part of the coordinated v2.6.0 release.packages/i18n/package.json (1)
3-3: Version bump to 2.6.0: The package version has been updated to match the new release.packages/toolbars/setting/package.json (1)
3-3: Version bump to 2.6.0: The package version is now aligned with the overall v2.6.0 release.packages/builtinComponent/package.json (1)
3-3: Version bump to 2.6.0: The package version has been correctly incremented for the v2.6.0 release.mockServer/package.json (1)
3-3: Bump version to 2.6.0
Updated from 2.5.0 to 2.6.0 as part of the coordinated v2.6.0 release.packages/toolbars/generate-code/package.json (1)
3-3: Bump version to 2.6.0
Consistent version increment for the generate-code toolbar package.packages/common/package.json (1)
3-3: Bump version to 2.6.0
Aligned core common package version with the v2.6.0 release.packages/blockToWebComponentTemplate/package.json (1)
3-3: Bump version to 2.6.0
Version bump for block-to-webcomponent template package.packages/configurator/package.json (1)
3-3: Bump version to 2.6.0
Updated configurator package to v2.6.0 in sync with the release.packages/toolbars/view-setting/package.json (1)
3-3: Version bump to 2.6.0 is correct
The updated version aligns with the coordinated release across packages.packages/vue-generator/package.json (1)
3-3: Version updated to 2.6.0
This bump keeps the DSL Vue package in sync with the release.packages/plugins/help/package.json (1)
3-3: Package version set to 2.6.0
Consistent with the release v2.6.0 across all plugins.packages/svgs/package.json (1)
3-3: Release version bumped to 2.6.0
No other metadata changes—version aligns with the rest of the monorepo.packages/plugins/script/package.json (1)
3-3: Upgraded version to 2.6.0
Matches the global version bump for the v2.6.0 release.packages/plugins/page/package.json (1)
3-3: Version bump to 2.6.0 for@opentiny/tiny-engine-plugin-page
The version was correctly updated from 2.5.0 to 2.6.0 as part of the coordinated release.packages/toolbars/refresh/package.json (1)
3-3: Version bump to 2.6.0 for@opentiny/tiny-engine-toolbar-refresh
The version was correctly updated from 2.5.0 to 2.6.0 as part of the coordinated release.packages/toolbars/logo/package.json (1)
3-3: Version bump to 2.6.0 for@opentiny/tiny-engine-toolbar-logo
The version was correctly updated from 2.5.0 to 2.6.0 as part of the coordinated release.packages/theme/base/package.json (1)
3-3: Version bump to 2.6.0 for@opentiny/tiny-engine-theme-base
The version was correctly updated from 2.5.0 to 2.6.0 as part of the coordinated release.packages/toolbars/clean/package.json (1)
3-3: Version bump to 2.6.0 for@opentiny/tiny-engine-toolbar-clean
The version was correctly updated from 2.5.0 to 2.6.0 as part of the coordinated release.packages/toolbars/preview/package.json (1)
3-3: Version bump to 2.6.0 approved.
The package version has been correctly updated from 2.5.0 to 2.6.0, matching the coordinated release.packages/plugins/bridge/package.json (1)
3-3: Version bump to 2.6.0 approved.
Consistent update from 2.5.0 to 2.6.0, aligning with the PR’s objectives.packages/plugins/robot/package.json (1)
3-3: Version bump to 2.6.0 approved.
The version increment is correct and in sync with other plugins.packages/settings/events/package.json (1)
3-3: Version bump to 2.6.0 approved.
This matches the coordinated update across settings packages.packages/settings/styles/package.json (1)
3-3: Version bump to 2.6.0 approved.
Confirmed the change from 2.5.0 to 2.6.0 is accurate and consistent.packages/plugins/tutorial/package.json (1)
3-3: Version bumped to 2.6.0
The update aligns with the coordinated release across all tiny-engine packages for v2.6.0.packages/webcomponent/package.json (1)
3-3: Version bumped to 2.6.0
Consistent version increment for the webcomponent core package.packages/build/vite-config/package.json (1)
3-3: Version bumped to 2.6.0
Vite config package updated to match the v2.6.0 release.packages/toolbars/lock/package.json (1)
3-3: Version bumped to 2.6.0
Toolbar lock plugin now reflects the v2.6.0 release.packages/block-compiler/package.json (1)
3-3: Version bumped to 2.6.0
Block compiler package updated as part of the global v2.6.0 version bump.packages/toolbars/themeSwitch/package.json (1)
3-3: Align package version with release v2.6.0
Version bump from 2.5.0 to 2.6.0 aligns this toolbar package with the v2.6.0 release.packages/plugins/schema/package.json (1)
3-3: Align package version with release v2.6.0
Version bump from 2.5.0 to 2.6.0 keeps this schema plugin in sync with the release.packages/engine-cli/package.json (1)
3-3: ```shell
#!/bin/bashSearch entire repository for any remaining references to the old CLI version
rg -n '2.5.0'
</details> <details> <summary>packages/settings/design/package.json (1)</summary> `3-3`: **Align package version with release v2.6.0** Version bump from 2.5.0 to 2.6.0 for the design settings package matches the overall release plan. </details> <details> <summary>packages/design-core/package.json (1)</summary> `3-3`: **Align core package version with release v2.6.0** Version bump from 2.5.0 to 2.6.0 ensures the core engine package is correctly updated for v2.6.0. </details> <details> <summary>packages/build/vite-plugin-meta-comments/package.json (1)</summary> `3-3`: **Version bump looks good.** The version increment from 2.5.0 to 2.6.0 aligns with the coordinated release across all packages. </details> <details> <summary>packages/plugins/page/src/Tree.vue (2)</summary> `97-104`: **Excellent TypeScript type definitions.** The `TreeNode` interface provides clear structure and improves type safety throughout the component. --- `238-246`: **Make the collapse icon click detection more robust.** The optional chaining on line 241 could throw if `querySelector` returns null. Consider a safer approach: ```diff - const currentTarget = event.currentTarget as HTMLElement - if (currentTarget.querySelector('div.prefix-icon')?.contains(event.target as Node)) { - return - } + const currentTarget = event.currentTarget as HTMLElement + const prefixIcon = currentTarget.querySelector('div.prefix-icon') + if (prefixIcon && prefixIcon.contains(event.target as Node)) { + return + }Likely an incorrect or invalid review comment.
designer-demo/package.json (1)
4-4: Version bump approved.packages/utils/package.json (1)
3-3: Version increment looks good.packages/toolbars/collaboration/package.json (1)
3-3: Version update approved.packages/engine-cli/template/designer/src/preview.js (1)
28-32: LGTM! Configuration enhancement for material support.The addition of the
configobject with thematerialproperty properly integrates the mock bundle resources, supporting the new ElDatePicker component functionality as described in the summary.packages/engine-cli/template/designer/package.json (2)
14-15: LGTM! Consistent version bump for dependencies.The dependencies are properly updated to version 2.6.0, maintaining consistency with the release objectives.
26-27: LGTM! Consistent version bump for devDependencies.The devDependencies are properly updated to version 2.6.0, maintaining consistency with the release objectives.
packages/engine-cli/template/designer/public/mock/bundle.json (7)
46-47: Typo fix in contextMenu actions across multiple componentsThe
"bindEevent"typo has been corrected to"bindEvent"in context menu actions, ensuring event binding options work as expected.Also applies to: 789-791, 1106-1108, 1557-1559, 1902-1904, 3135-3137
282-748: Ensure unique snippetidvaluesThe new
ElDatePickerentry uses"id": 1, which may collide with existing component IDs. Please verify that all snippet IDs in the mock bundle are unique to avoid registry conflicts.
13053-13056: Optional property correctly markedThe
"controls-position"property is optional and appropriately marked with"required": false.
13801-13802: Verify updated icon identifierThe icon for the “互斥按钮组” snippet has been changed to
"MutexButtons". Ensure this identifier matches an existing icon asset to prevent missing icon errors.
14082-14083: Normalize property keys to kebab-caseThe property key has been consistently renamed from
controlsPositiontocontrols-position, aligning with kebab-case conventions.
14343-14346: Normalize property keys to kebab-caseThe
gridOpkey is nowgrid-op, matching the kebab-case naming standard used across the schema.
14666-14674: Register new component in children listThe
ElDatePickersnippet is added to the component registry’s children with a matchingsnippetName. This integrates the new date picker into the preview environment.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
packages/plugins/page/src/Tree.vue (2)
163-163: Consider simplifying the filtering logic.The change from a computed property to reactive ref with two separate watchers adds significant complexity. While the functionality is correct, this approach may be harder to maintain and understand.
Consider consolidating the filtering logic into a single computed property or use a more straightforward approach:
-const filteredNodes = ref<TreeNode[]>([]) - -// 下面两个 watch 对应的两个重新计算 filteredNodes 的场景。场景2比场景1多了展开匹配到的节点的操作 - -// 场景1. 页面树的结构发生变化,或者有节点收起或者展开,重新计算 filteredNodes -watch(nodes, (nodes) => { - filteredNodes.value = nodes.filter((node) => node.label.toLowerCase().includes(props.filterValue.toLowerCase())) -}) - -// 场景2. 过滤条件发生变化,重新计算 filteredNodes,并且展开匹配到的节点 -watch( - () => props.filterValue, - (filterValue) => { - const filtered = nodes.value.filter((node) => node.label.toLowerCase().includes(filterValue.toLowerCase())) - - let collapseMapChanged = false - - filtered.forEach((node) => { - // 每个节点的祖先节点中,如果存在折叠的节点,则展开 - for (const id of getAncestorIds(node.id)) { - if (collapseMap.value[id]) { - setCollapse(id, false) - collapseMapChanged = true - } - } - }) - - // - 如果 collapseMap 有变化,会自动重新计算 nodes,更新路径: - // props.filterValue -> collapseMap -> nodes -> filteredNodes -> filteredNodesWithAncestors - // - 如果 collapseMap 没有变化,则重新设置 filteredNodes,更新路径: - // props.filterValue -> filteredNodes -> filteredNodesWithAncestors - if (!collapseMapChanged) { - filteredNodes.value = filtered - } - } -) +const filteredNodes = computed(() => { + const filterValue = props.filterValue.toLowerCase() + const filtered = nodes.value.filter((node) => node.label.toLowerCase().includes(filterValue)) + + // Auto-expand ancestors of matched nodes when filtering + if (filterValue) { + filtered.forEach((node) => { + for (const id of getAncestorIds(node.id)) { + if (collapseMap.value[id]) { + setCollapse(id, false) + } + } + }) + } + + return filtered +})Also applies to: 165-198
242-243: Enhance robustness of click target detection.The current logic for detecting clicks on the collapse icon could be more robust and type-safe.
Consider improving the click detection logic:
- const currentTarget = event.currentTarget as HTMLElement - if (currentTarget.querySelector('div.prefix-icon')?.contains(event.target as Node)) { + const target = event.target as HTMLElement + if (target.closest('.prefix-icon')) { return }This approach is more direct and avoids potential issues with event target casting.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
designer-demo/package.json(1 hunks)packages/build/vite-config/package.json(1 hunks)packages/build/vite-plugin-meta-comments/package.json(1 hunks)packages/engine-cli/template/designer/package.json(2 hunks)packages/plugins/materials/src/meta/block/src/BlockDetail.vue(2 hunks)packages/plugins/page/src/Tree.vue(12 hunks)packages/toolbars/fullscreen/package.json(1 hunks)packages/toolbars/lang/package.json(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- packages/toolbars/lang/package.json
- packages/toolbars/fullscreen/package.json
🚧 Files skipped from review as they are similar to previous changes (4)
- designer-demo/package.json
- packages/build/vite-config/package.json
- packages/build/vite-plugin-meta-comments/package.json
- packages/engine-cli/template/designer/package.json
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: push-check
- GitHub Check: push-check
🔇 Additional comments (6)
packages/plugins/materials/src/meta/block/src/BlockDetail.vue (2)
19-26: LGTM! Formatting improvement enhances readability.The multi-line formatting of the div element with multiple attributes improves code readability and maintainability.
27-33: LGTM! Consistent formatting improvement.The multi-line formatting matches the previous div element and maintains consistent code style throughout the template.
packages/plugins/page/src/Tree.vue (4)
98-105: LGTM! Comprehensive TypeScript interface definition.The
TreeNodeinterface provides excellent type safety for the component. The properties are well-defined and cover all necessary node attributes.
85-89: Good TypeScript typing for collapse functionality.The type annotations for
setCollapseandswitchCollapsefunctions properly handle both string and number IDs, which aligns with the TreeNode interface.Also applies to: 96-96
28-28: Enhanced click handling with proper event prevention.The click event handling improvement correctly prevents the
clickRowevent from being emitted when clicking on the collapse icon, allowing for more precise user interactions.Also applies to: 30-30, 239-244
114-114: Excellent TypeScript typing improvements throughout.The comprehensive type annotations for function parameters, return types, and reactive references significantly improve code maintainability and catch potential type-related issues at compile time.
Also applies to: 125-125, 142-142, 146-146, 149-149, 220-220, 249-252, 261-261, 277-277, 298-298, 311-311
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
Bug Fixes
Style
Chores