Skip to content

feat: support hide builtin material from material list#1537

Merged
hexqi merged 1 commit intoopentiny:developfrom
chilingling:feat/supportHideBuiltinMaterial
Jul 24, 2025
Merged

feat: support hide builtin material from material list#1537
hexqi merged 1 commit intoopentiny:developfrom
chilingling:feat/supportHideBuiltinMaterial

Conversation

@chilingling
Copy link
Member

@chilingling chilingling commented Jul 19, 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?

新增 hiddenBuiltinMaterials 配置项,允许二开用户隐藏内置物料。

配置示例:

// registry.js
export default {
  [META_APP.Materials]: {
    options: {
      hiddenBuiltinMaterials: [
        'Box', // 盒子容器(普通div 容器)
        'CanvasRowColContainer', // 行列容器
        'CanvasFlexBox', // 弹性容器
        'CanvasSection', // 全宽居中容器
        'Text', // 文本
        'Icon', // 图标
        'Img', // 图片
        'Slot', // 插槽(区块插槽需要)
        'RouterView', // 路由视图(子页面需要,不建议隐藏)
        'RouterLink', // 路由链接
        'Navigation', // 导航条
        'NavigationV', // 纵向导航条
        'Collection' // 数据源容器(数据源功能依赖,不建议隐藏)
      ]
    }
  }
}

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 a configuration option to hide specific built-in material components from the material panel.
  • Documentation

    • Updated and expanded API documentation with new configuration details, usage scenarios, improved formatting, and detailed comments for key API methods.
  • Style

    • Improved code formatting and consistency in documentation and component code.
  • Refactor

    • Enhanced type safety and clarity in component logic, including more precise typing and filtering of component lists.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 19, 2025

Walkthrough

The changes introduce a new configuration option, hiddenBuiltinMaterials, to allow hiding specific built-in material components from the material panel. Documentation is updated with usage details, while the plugin logic is modified to filter out hidden materials during initialization. Type safety and filtering logic are improved in the frontend component code.

Changes

File(s) Change Summary
docs/api/frontend-api/material-api.md Enhanced documentation: added hiddenBuiltinMaterials option, improved formatting, added usage examples, and clarified API descriptions.
packages/plugins/materials/index.ts Added hiddenBuiltinMaterials: [] property to the exported plugin options.
packages/plugins/materials/src/composable/useMaterial.ts Added filterBuiltinMaterials function; modified initBuiltinMaterial to filter out hidden materials.
packages/plugins/materials/src/meta/component/src/Main.vue Added TypeScript typings, improved type safety, and filtered components to only those with children.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PluginOptions
    participant MaterialInit
    participant MaterialState

    User->>PluginOptions: Configure hiddenBuiltinMaterials
    MaterialInit->>PluginOptions: Read hiddenBuiltinMaterials
    MaterialInit->>MaterialInit: Filter built-in materials using filterBuiltinMaterials
    MaterialInit->>MaterialState: Add only allowed materials to state
Loading

Poem

In the warren where plugins dwell,
A new option hops in—oh, swell!
Hide built-ins with a single tweak,
Docs now clear for all to seek.
Types are tidy, components neat,
This rabbit’s code is hard to beat! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 19, 2025
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 (1)
docs/api/frontend-api/material-api.md (1)

116-118: Convert emphasized text to proper heading.

The static analysis tool correctly identified that emphasized text is being used instead of a proper heading, which breaks the document's heading hierarchy.

Apply this diff to fix the heading format:

-**使用示例**
+### 使用示例
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 11be39d and 301a452.

📒 Files selected for processing (4)
  • docs/api/frontend-api/material-api.md (7 hunks)
  • packages/plugins/materials/index.ts (1 hunks)
  • packages/plugins/materials/src/composable/useMaterial.ts (1 hunks)
  • packages/plugins/materials/src/meta/component/src/Main.vue (4 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/material-function/material-getter.ts:66-80
Timestamp: 2025-01-14T04:25:46.281Z
Learning: In the tiny-engine project, styles from block components are processed through Vite's CSS compilation pipeline, and additional style sanitization libraries should be avoided to maintain consistency with this approach.
Learnt from: gene9831
PR: opentiny/tiny-engine#1041
File: packages/plugins/datasource/src/DataSourceList.vue:138-138
Timestamp: 2025-01-14T10:06:25.508Z
Learning: PR #1041 in opentiny/tiny-engine is specifically for reverting Prettier v3 formatting to v2, without any logical code changes or syntax improvements.
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/material-function/support-collection.ts:3-15
Timestamp: 2025-01-14T06:59:02.999Z
Learning: The code in `packages/canvas/render/src/material-function/support-collection.ts` is migrated code that should not be modified at this time to maintain stability during the migration process.
Learnt from: chilingling
PR: opentiny/tiny-engine#817
File: packages/vue-generator/src/plugins/appendElePlusStylePlugin.js:32-44
Timestamp: 2024-09-25T11:13:34.258Z
Learning: In `appendElePlusStylePlugin.js`, it's acceptable to silently return when the user's material doesn't have `element-plus` dependencies.
Learnt from: chilingling
PR: opentiny/tiny-engine#817
File: packages/vue-generator/src/plugins/appendElePlusStylePlugin.js:32-44
Timestamp: 2024-10-09T01:47:35.507Z
Learning: In `appendElePlusStylePlugin.js`, it's acceptable to silently return when the user's material doesn't have `element-plus` dependencies.
Learnt from: chilingling
PR: opentiny/tiny-engine#1389
File: docs/api/frontend-api/material-api.md:84-117
Timestamp: 2025-05-13T06:27:51.334Z
Learning: The `registerBlock` method in the `useMaterial` API is planned for deprecation and should not be documented or recommended.
packages/plugins/materials/index.ts (8)
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/material-function/support-collection.ts:3-15
Timestamp: 2025-01-14T06:59:02.999Z
Learning: The code in `packages/canvas/render/src/material-function/support-collection.ts` is migrated code that should not be modified at this time to maintain stability during the migration process.
Learnt from: yy-wow
PR: opentiny/tiny-engine#940
File: packages/canvas/DesignCanvas/src/importMap.js:51-51
Timestamp: 2025-01-13T03:46:13.817Z
Learning: The `getImportMapData` function in `packages/canvas/DesignCanvas/src/importMap.js` has default parameter handling that initializes `canvasDeps` with empty arrays for `scripts` and `styles`, making additional null checks unnecessary.
Learnt from: chilingling
PR: opentiny/tiny-engine#817
File: packages/vue-generator/src/plugins/appendElePlusStylePlugin.js:46-50
Timestamp: 2024-10-09T01:47:35.507Z
Learning: In `appendElePlusStylePlugin.js`, the code uses `|| {}` to set default values when obtaining files, so additional null checks may not be necessary.
Learnt from: chilingling
PR: opentiny/tiny-engine#817
File: packages/vue-generator/src/plugins/appendElePlusStylePlugin.js:32-44
Timestamp: 2024-10-09T01:47:35.507Z
Learning: In `appendElePlusStylePlugin.js`, it's acceptable to silently return when the user's material doesn't have `element-plus` dependencies.
Learnt from: chilingling
PR: opentiny/tiny-engine#817
File: packages/vue-generator/src/plugins/appendElePlusStylePlugin.js:32-44
Timestamp: 2024-09-25T11:13:34.258Z
Learning: In `appendElePlusStylePlugin.js`, it's acceptable to silently return when the user's material doesn't have `element-plus` dependencies.
Learnt from: chilingling
PR: opentiny/tiny-engine#817
File: packages/vue-generator/src/plugins/appendElePlusStylePlugin.js:46-50
Timestamp: 2024-09-25T11:18:00.771Z
Learning: In `appendElePlusStylePlugin.js`, the code uses `|| {}` to set default values when obtaining files, so additional null checks may not be necessary.
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/material-function/material-getter.ts:66-80
Timestamp: 2025-01-14T04:25:46.281Z
Learning: In the tiny-engine project, styles from block components are processed through Vite's CSS compilation pipeline, and additional style sanitization libraries should be avoided to maintain consistency with this approach.
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/builtin/builtin.json:645-850
Timestamp: 2025-01-14T04:22:02.404Z
Learning: In TinyEngine, components must use inline styles instead of CSS classes because components cannot carry class styles when dragged into the canvas.
packages/plugins/materials/src/composable/useMaterial.ts (3)
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/material-function/support-collection.ts:3-15
Timestamp: 2025-01-14T06:59:02.999Z
Learning: The code in `packages/canvas/render/src/material-function/support-collection.ts` is migrated code that should not be modified at this time to maintain stability during the migration process.
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/application-function/global-state.ts:12-25
Timestamp: 2025-01-14T08:45:57.032Z
Learning: The code in `packages/canvas/render/src/application-function/global-state.ts` is migrated from an existing codebase and should be handled with care when making modifications.
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/data-utils.ts:8-12
Timestamp: 2025-01-14T06:58:38.661Z
Learning: The use of Function constructor in `packages/canvas/render/src/data-utils.ts` is part of migrated code and was intentionally kept as-is during migration, despite potential security concerns.
docs/api/frontend-api/material-api.md (13)
Learnt from: chilingling
PR: opentiny/tiny-engine#1389
File: docs/api/frontend-api/material-api.md:84-117
Timestamp: 2025-05-13T06:27:51.334Z
Learning: The `registerBlock` method in the `useMaterial` API is planned for deprecation and should not be documented or recommended.
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/material-function/support-collection.ts:3-15
Timestamp: 2025-01-14T06:59:02.999Z
Learning: The code in `packages/canvas/render/src/material-function/support-collection.ts` is migrated code that should not be modified at this time to maintain stability during the migration process.
Learnt from: chilingling
PR: opentiny/tiny-engine#817
File: packages/vue-generator/src/plugins/appendElePlusStylePlugin.js:32-44
Timestamp: 2024-10-09T01:47:35.507Z
Learning: In `appendElePlusStylePlugin.js`, it's acceptable to silently return when the user's material doesn't have `element-plus` dependencies.
Learnt from: chilingling
PR: opentiny/tiny-engine#817
File: packages/vue-generator/src/plugins/appendElePlusStylePlugin.js:32-44
Timestamp: 2024-09-25T11:13:34.258Z
Learning: In `appendElePlusStylePlugin.js`, it's acceptable to silently return when the user's material doesn't have `element-plus` dependencies.
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/material-function/material-getter.ts:55-88
Timestamp: 2025-01-14T04:25:08.323Z
Learning: The BlockLoadError component in packages/canvas/render/src/material-function/material-getter.ts requires a `name` prop to display which block failed to load.
Learnt from: yy-wow
PR: opentiny/tiny-engine#886
File: packages/common/composable/defaultGlobalService.js:53-56
Timestamp: 2024-11-06T09:38:05.573Z
Learning: 在 `packages/common/composable/defaultGlobalService.js` 文件中,对于 `fetchAppInfo` 和 `fetchAppList` 等函数,错误处理应由调用者负责,不应在函数内部添加错误处理。
Learnt from: yy-wow
PR: opentiny/tiny-engine#886
File: packages/common/composable/index.js:3-3
Timestamp: 2024-10-30T02:10:38.028Z
Learning: 在 `packages/common/composable` 目录中,`HttpService` 模块位于 `./http/index.js`,而不是 `./http.js`。
Learnt from: hexqi
PR: opentiny/tiny-engine#702
File: packages/common/composable/index.js:1-2
Timestamp: 2024-10-24T03:55:39.020Z
Learning: 文件名不需要包含 `default`,直接使用更简洁的名称即可。例如,将 `defaultGlobalService.js` 修改为 `globalService.js`。
Learnt from: yy-wow
PR: opentiny/tiny-engine#940
File: packages/plugins/materials/src/composable/useMaterial.js:0-0
Timestamp: 2025-01-13T07:49:12.136Z
Learning: In the materials system, componentsDepsMap.scripts in materialState is used as a data store for tracking component dependencies and doesn't require Vue reactivity as changes are handled explicitly through updateCanvasDeps().
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/material-function/page-getter.ts:15-26
Timestamp: 2025-01-14T04:27:05.374Z
Learning: Memory cleanup for style sheets and page schemas in `packages/canvas/render/src/material-function/page-getter.ts` is deferred until a proper loading/unloading mechanism is implemented.
Learnt from: hexqi
PR: opentiny/tiny-engine#850
File: package.json:4-4
Timestamp: 2024-10-10T06:25:05.109Z
Learning: 当遇到与`canvas`包中`"type": "module"`相关的报错时,可以通过将`canvas`包中的`.eslintrc`文件改为`.cjs`后缀来解决,而无需在根目录的`package.json`中添加`"type": "module"`。
Learnt from: yy-wow
PR: opentiny/tiny-engine#940
File: packages/canvas/DesignCanvas/src/importMap.js:51-51
Timestamp: 2025-01-13T03:46:13.817Z
Learning: The `getImportMapData` function in `packages/canvas/DesignCanvas/src/importMap.js` has default parameter handling that initializes `canvasDeps` with empty arrays for `scripts` and `styles`, making additional null checks unnecessary.
Learnt from: gene9831
PR: opentiny/tiny-engine#1011
File: packages/configurator/src/router-select-configurator/RouterSelectConfigurator.vue:63-73
Timestamp: 2025-01-14T06:49:00.797Z
Learning: The SvgIcon component is globally registered and available throughout the application without requiring explicit imports.
packages/plugins/materials/src/meta/component/src/Main.vue (17)
Learnt from: gene9831
PR: opentiny/tiny-engine#830
File: packages/common/component/MetaChildItem.vue:50-56
Timestamp: 2024-10-15T02:45:17.168Z
Learning: In `packages/common/component/MetaChildItem.vue`, when checking if `text` is an object in the computed property `title`, ensure that `text` is not `null` because `typeof null === 'object'` in JavaScript. Use checks like `text && typeof text === 'object'` to safely handle `null` values.
Learnt from: yy-wow
PR: opentiny/tiny-engine#940
File: packages/plugins/materials/src/composable/useMaterial.js:0-0
Timestamp: 2025-01-13T07:49:12.136Z
Learning: In the materials system, componentsDepsMap.scripts in materialState is used as a data store for tracking component dependencies and doesn't require Vue reactivity as changes are handled explicitly through updateCanvasDeps().
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/canvas-function/design-mode.ts:6-13
Timestamp: 2025-01-14T06:55:14.457Z
Learning: The code in `packages/canvas/render/src/canvas-function/design-mode.ts` is migrated code that should be preserved in its current form during the migration process. Refactoring suggestions for type safety and state management improvements should be considered in future PRs.
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/application-function/global-state.ts:12-25
Timestamp: 2025-01-14T08:45:57.032Z
Learning: The code in `packages/canvas/render/src/application-function/global-state.ts` is migrated from an existing codebase and should be handled with care when making modifications.
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/builtin/CanvasRouterView.vue:4-19
Timestamp: 2025-01-14T06:56:11.072Z
Learning: In the tiny-engine project, component implementations should maintain consistency with other components at the same level, even if modernization improvements (like TypeScript and Composition API) are possible.
Learnt from: gene9831
PR: opentiny/tiny-engine#1117
File: packages/canvas/container/src/components/CanvasViewerSwitcher.vue:96-117
Timestamp: 2025-02-17T12:11:22.718Z
Learning: In CanvasViewerSwitcher.vue, `state.usedHoverState.element` is guaranteed to have a value when `handleClick` is called, making additional error handling unnecessary.
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/canvas-function/controller.ts:1-7
Timestamp: 2025-01-14T08:44:09.485Z
Learning: Type safety improvements for the controller in `packages/canvas/render/src/canvas-function/controller.ts` should be deferred until the data structure is finalized.
Learnt from: gene9831
PR: opentiny/tiny-engine#1233
File: packages/canvas/container/src/components/CanvasDivider.vue:184-185
Timestamp: 2025-03-20T07:20:12.221Z
Learning: In CanvasDivider.vue, even though state.verLeft and state.horizontalTop already include 'px' suffix, the CSS properties in state.dividerStyle still need to append 'px' again according to gene9831, suggesting that these state variables might be processed differently than expected when used in style binding.
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/material-function/support-collection.ts:3-15
Timestamp: 2025-01-14T06:59:02.999Z
Learning: The code in `packages/canvas/render/src/material-function/support-collection.ts` is migrated code that should not be modified at this time to maintain stability during the migration process.
Learnt from: rhlin
PR: opentiny/tiny-engine#1011
File: packages/canvas/render/src/canvas-function/custom-renderer.ts:28-32
Timestamp: 2025-01-14T07:11:44.138Z
Learning: The locale and webComponent wrapper in `packages/canvas/render/src/canvas-function/custom-renderer.ts` are part of migrated code and will be improved in a future PR.
Learnt from: gene9831
PR: opentiny/tiny-engine#1011
File: packages/configurator/src/router-select-configurator/RouterSelectConfigurator.vue:63-73
Timestamp: 2025-01-14T06:49:00.797Z
Learning: In the tiny-engine project, the SvgIcon component is globally registered and available throughout Vue components without requiring explicit imports.
Learnt from: yy-wow
PR: opentiny/tiny-engine#940
File: packages/canvas/DesignCanvas/src/DesignCanvas.vue:0-0
Timestamp: 2025-01-15T02:19:06.755Z
Learning: In Vue components using message subscriptions from @opentiny/tiny-engine-meta-register, always clean up subscriptions in the onUnmounted hook using useMessage().unsubscribe() to prevent memory leaks.
Learnt from: gene9831
PR: opentiny/tiny-engine#1011
File: packages/configurator/src/router-select-configurator/RouterSelectConfigurator.vue:63-73
Timestamp: 2025-01-14T06:49:00.797Z
Learning: In the tiny-engine project, the SvgIcon component is globally registered using `app.component('SvgIcon', SvgIcon)` in `packages/svgs/index.js`, making it available throughout Vue components without requiring explicit imports.
Learnt from: gene9831
PR: opentiny/tiny-engine#1011
File: packages/configurator/src/router-select-configurator/RouterSelectConfigurator.vue:95-98
Timestamp: 2025-01-14T06:55:59.692Z
Learning: The tiny-select component from @opentiny/vue library ensures selected options are valid internally, requiring no additional validation in the change handler.
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.
Learnt from: yy-wow
PR: opentiny/tiny-engine#850
File: packages/toolbars/preview/src/Main.vue:16-16
Timestamp: 2024-10-10T02:47:46.239Z
Learning: In `packages/toolbars/preview/src/Main.vue`, within the `preview` function, the `getMergeMeta` method is used at lines 64 and 65 to retrieve `engine.config` configurations.
Learnt from: yy-wow
PR: opentiny/tiny-engine#850
File: packages/toolbars/preview/src/Main.vue:0-0
Timestamp: 2024-10-10T02:48:10.881Z
Learning: 在 `packages/toolbars/preview/src/Main.vue` 文件中,使用 `useNotify` 而不是 `console` 来记录错误日志。
🧬 Code Graph Analysis (1)
packages/plugins/materials/src/composable/useMaterial.ts (2)
packages/plugins/materials/src/composable/types.ts (1)
  • Material (1-6)
packages/register/src/common.ts (1)
  • getOptions (32-34)
🪛 markdownlint-cli2 (0.17.2)
docs/api/frontend-api/material-api.md

116-116: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: push-check
🔇 Additional comments (3)
packages/plugins/materials/index.ts (1)

39-40: LGTM! Clean implementation of the configuration option.

The hiddenBuiltinMaterials property is well-named and follows the existing configuration pattern. Initializing it as an empty array ensures backward compatibility.

packages/plugins/materials/src/composable/useMaterial.ts (1)

407-424: Well-implemented filtering logic with proper immutability handling.

The filterBuiltinMaterials function correctly filters out hidden materials while preserving the original data structure. Good use of optional chaining for defensive programming.

docs/api/frontend-api/material-api.md (1)

30-67: Excellent documentation for the new feature!

The documentation clearly explains the purpose, provides a comprehensive example, and includes important warnings about components that shouldn't be hidden. The usage scenarios help users understand when to use this feature.

@hexqi hexqi added this to the v2.8.0 milestone Jul 22, 2025
@hexqi hexqi merged commit cc45dc9 into opentiny:develop Jul 24, 2025
6 checks passed
chilingling added a commit to chilingling/tiny-engine that referenced this pull request Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants