Skip to content

Release v2.6 merge#1487

Merged
chilingling merged 6 commits intodevelopfrom
release-v2.6-merge
Jun 23, 2025
Merged

Release v2.6 merge#1487
chilingling merged 6 commits intodevelopfrom
release-v2.6-merge

Conversation

@hexqi
Copy link
Collaborator

@hexqi hexqi commented Jun 23, 2025

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?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • Bug Fixes

    • Improved the tree component's event handling and filtering, ensuring clicks on collapse icons are ignored and filtering auto-expands ancestor nodes for better usability.
    • Enhanced type safety and drag-and-drop logic in the tree component for more reliable interactions.
  • Style

    • Reformatted certain UI templates for improved readability.
  • Chores

    • Updated version numbers across all packages to 2.6.0, including dependencies in template projects. No functional changes were made.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 23, 2025

Walkthrough

This update primarily increments the version numbers from 2.5.0 (or 2.6.0-rc.0) to 2.6.0 across numerous package.json files throughout the repository. Additionally, it introduces significant TypeScript typing and event handling improvements to the Tree.vue component and minor formatting adjustments to BlockDetail.vue.

Changes

File(s) Change Summary
All package.json files in root, mockServer, packages/ Version updated from 2.5.0 or 2.6.0-rc.0 to 2.6.0. No other changes made.
packages/engine-cli/template/designer/package.json Updated dependencies and devDependencies from 2.6.0-rc.0 to 2.6.0.
packages/plugins/tree/src/Tree.vue Added TypeScript typings, refined event handling, improved filtering logic, and auto-expand of ancestor nodes on filter.
packages/plugins/materials/src/meta/block/src/BlockDetail.vue Reformatted template for readability and adjusted default value for detail prop to concise arrow function.

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
Loading

Poem

🐇
Versions hop from five to six,
With numbers changed, the code now clicks.
Trees grow strong with types anew,
And filters show what’s truly true.
A tidy block, a stable core—
This bunny cheers for 2.6.0 galore!
🌱✨


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 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.

Copy link
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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9ee36c1 and f303532.

📒 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/bash

Search 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 config object with the material property 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 components

The "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 snippet id values

The new ElDatePicker entry 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 marked

The "controls-position" property is optional and appropriately marked with "required": false.


13801-13802: Verify updated icon identifier

The 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-case

The property key has been consistently renamed from controlsPosition to controls-position, aligning with kebab-case conventions.


14343-14346: Normalize property keys to kebab-case

The gridOp key is now grid-op, matching the kebab-case naming standard used across the schema.


14666-14674: Register new component in children list

The ElDatePicker snippet is added to the component registry’s children with a matching snippetName. This integrates the new date picker into the preview environment.

Copy link
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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between f303532 and 28bbdd9.

📒 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 TreeNode interface 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 setCollapse and switchCollapse functions 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 clickRow event 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

@chilingling chilingling merged commit 1638fc1 into develop Jun 23, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants