Skip to content

Conversation

@kagol
Copy link
Member

@kagol kagol commented Mar 17, 2025

PR

效果如下:
image

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)

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:

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

  • New Features
    • Enhanced many UI components to be visible by default with configurable cloud settings.
    • Expanded the button component with a comprehensive feature list.
    • Added a new route for a "Features" component to display a list of components and their features.
  • Documentation
    • Introduced a new Features overview page on the website that displays component details, counts, and offers filtering options for cloud-based functionality.

@github-actions github-actions bot added the documentation 对文档的改进或补充 label Mar 17, 2025
@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2025

Walkthrough

This update adds two new configuration properties, show and cloud, to almost all component modules under the web documentation directory, allowing control over component visibility and cloud-related behavior. One component (button) gains an enhanced features array detailing its feature set. Additionally, a new route is introduced in the router configuration that dynamically imports and displays a new Vue component, features.vue, which aggregates and displays features data for the TinyVue library.

Changes

File(s) Change Summary
examples/sites/demos/pc/app/**/webdoc/*.js (excluding button.js) Added new properties show and cloud with boolean defaults to exported objects, expanding configuration options.
examples/sites/demos/pc/app/button/webdoc/button.js Added show and cloud properties and introduced a detailed features array with multiple objects describing button functionalities.
examples/sites/src/router.js Introduced a dynamic import for the Features component and added a new route entry for the "Features" view.
examples/sites/src/views/features.vue Added a new Vue component that displays a list of components and their features, including component counts and a cloud filter toggle.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant R as Router
    participant L as Layout
    participant F as FeaturesComponent

    U->>R: Navigate to "/:context/zh-CN/:theme/features"
    R->>L: Load Layout component
    L->>F: Dynamically import and render Features component
    F->>F: Process and display component features data
    F-->>L: Return rendered view
    L-->>U: Display complete Features page
Loading

Suggested labels

enhancement

Suggested reviewers

  • zzcr

Poem

I’m a rabbit, hopping through code today,
Adding show and cloud in a playful way,
A Features route born under moonlit beams,
Where buttons and views merge into dreams,
With each little hop, my joy is true—
Celebrating changes, from me to you! 🐰

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

examples/sites/src/views/features.vue

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-vue@latest --save-dev

The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

@petercat-assistant
Copy link

Walkthrough

此PR为多个组件的文档添加了特性列表,主要包括展示和规范内组件的标识。还引入了一个新的路由和视图来显示组件特性。

Changes

文件 概要
examples/sites/demos/pc/app/*/webdoc/*.js 为多个组件添加了showcloud属性,用于标识是否展示和是否为规范内组件。
examples/sites/src/router.js 添加了一个新的路由,用于组件特性列表的展示。
examples/sites/src/views/features.vue 新增了一个视图,用于展示组件特性列表。

@github-actions
Copy link

[e2e-test-warn]
The component to be tested is missing.

The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug".

Please make sure you've read our contributing guide

if (!arr || arr.length === 0) return
if (arr.length <= step) return [arr]
return arr.reduce((x, y) => {
return Array.isArray(x) ? (x[x.length - 1].push(y) === step ? [...x, []] : x) : [[x, y]]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reduce function here might not work as intended. The logic seems to be trying to group elements, but the condition x[x.length - 1].push(y) === step might not correctly form groups of step size. Consider revising this logic to ensure proper grouping.

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Walkthrough

This PR adds a feature list to the documentation of multiple components, mainly including the identification of components within the display and specification. A new route and view is also introduced to display component features.

Changes

Documents Summary
examples/sites/demos/pc/app/*/webdoc/*.js Added show and cloud properties for multiple components to identify whether they are displayed and whether they are components within the specification.
examples/sites/src/router.js Added a new route for displaying component feature lists.
examples/sites/src/views/features.vue Added a view to showcase the component feature list.

Copy link

@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

🧹 Nitpick comments (1)
examples/sites/src/views/features.vue (1)

73-79: Consider simplifying the group function.

The group function for organizing features is creative but somewhat complex. Consider a more straightforward implementation for better maintainability.

-const group = (arr, step = 3) => {
-  if (!arr || arr.length === 0) return
-  if (arr.length <= step) return [arr]
-  return arr.reduce((x, y) => {
-    return Array.isArray(x) ? (x[x.length - 1].push(y) === step ? [...x, []] : x) : [[x, y]]
-  })
-}
+const group = (arr, step = 3) => {
+  if (!arr || arr.length === 0) return []
+  if (arr.length <= step) return [arr]
+  const result = []
+  for (let i = 0; i < arr.length; i += step) {
+    result.push(arr.slice(i, i + step))
+  }
+  return result
+}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a7632bb and 39a5ce1.

📒 Files selected for processing (92)
  • examples/sites/demos/pc/app/action-menu/webdoc/action-menu.js (1 hunks)
  • examples/sites/demos/pc/app/alert/webdoc/alert.js (1 hunks)
  • examples/sites/demos/pc/app/anchor/webdoc/anchor.js (1 hunks)
  • examples/sites/demos/pc/app/autocomplete/webdoc/autocomplete.js (1 hunks)
  • examples/sites/demos/pc/app/badge/webdoc/badge.js (1 hunks)
  • examples/sites/demos/pc/app/base-select/webdoc/base-select.js (1 hunks)
  • examples/sites/demos/pc/app/breadcrumb/webdoc/breadcrumb.js (1 hunks)
  • examples/sites/demos/pc/app/bulletin-board/webdoc/bulletin-board.js (1 hunks)
  • examples/sites/demos/pc/app/button-group/webdoc/button-group.js (1 hunks)
  • examples/sites/demos/pc/app/button/webdoc/button.js (1 hunks)
  • examples/sites/demos/pc/app/calendar-view/webdoc/calendar-view.js (1 hunks)
  • examples/sites/demos/pc/app/calendar/webdoc/calendar.js (1 hunks)
  • examples/sites/demos/pc/app/card/webdoc/card.js (1 hunks)
  • examples/sites/demos/pc/app/carousel/webdoc/carousel.js (1 hunks)
  • examples/sites/demos/pc/app/cascader-panel/webdoc/cascader-panel.js (1 hunks)
  • examples/sites/demos/pc/app/cascader/webdoc/cascader.js (1 hunks)
  • examples/sites/demos/pc/app/checkbox/webdoc/checkbox.js (1 hunks)
  • examples/sites/demos/pc/app/collapse/webdoc/collapse.js (1 hunks)
  • examples/sites/demos/pc/app/color-picker/webdoc/color-picker.js (1 hunks)
  • examples/sites/demos/pc/app/color-select-panel/webdoc/color-select-panel.js (1 hunks)
  • examples/sites/demos/pc/app/config-provider/webdoc/config-provider.js (1 hunks)
  • examples/sites/demos/pc/app/container/webdoc/container.js (1 hunks)
  • examples/sites/demos/pc/app/crop/webdoc/crop.js (1 hunks)
  • examples/sites/demos/pc/app/date-picker/webdoc/date-picker.js (1 hunks)
  • examples/sites/demos/pc/app/dialog-box/webdoc/dialog-box.js (1 hunks)
  • examples/sites/demos/pc/app/dialog-select/webdoc/dialog-select.js (1 hunks)
  • examples/sites/demos/pc/app/divider/webdoc/divider.js (1 hunks)
  • examples/sites/demos/pc/app/drawer/webdoc/drawer.js (1 hunks)
  • examples/sites/demos/pc/app/drop-times/webdoc/drop-times.js (1 hunks)
  • examples/sites/demos/pc/app/dropdown/webdoc/dropdown.js (1 hunks)
  • examples/sites/demos/pc/app/file-upload/webdoc/file-upload.js (1 hunks)
  • examples/sites/demos/pc/app/filter-panel/webdoc/filter-panel.js (1 hunks)
  • examples/sites/demos/pc/app/floatbar/webdoc/floatbar.js (1 hunks)
  • examples/sites/demos/pc/app/flowchart/webdoc/flowchart.js (1 hunks)
  • examples/sites/demos/pc/app/fluent-editor/webdoc/fluent-editor.js (1 hunks)
  • examples/sites/demos/pc/app/form/webdoc/form.js (1 hunks)
  • examples/sites/demos/pc/app/fullscreen/webdoc/fullscreen.js (1 hunks)
  • examples/sites/demos/pc/app/grid/webdoc/grid.js (1 hunks)
  • examples/sites/demos/pc/app/guide/webdoc/guide.js (1 hunks)
  • examples/sites/demos/pc/app/icon/webdoc/icon.js (1 hunks)
  • examples/sites/demos/pc/app/image/webdoc/image.js (1 hunks)
  • examples/sites/demos/pc/app/infinite-scroll/webdoc/infinite-scroll.js (1 hunks)
  • examples/sites/demos/pc/app/input/webdoc/input.js (1 hunks)
  • examples/sites/demos/pc/app/ip-address/webdoc/ip-address.js (1 hunks)
  • examples/sites/demos/pc/app/layout/webdoc/layout.js (1 hunks)
  • examples/sites/demos/pc/app/link/webdoc/link.js (1 hunks)
  • examples/sites/demos/pc/app/loading/webdoc/loading.js (1 hunks)
  • examples/sites/demos/pc/app/milestone/webdoc/milestone.js (1 hunks)
  • examples/sites/demos/pc/app/mind-map/webdoc/mind-map.js (1 hunks)
  • examples/sites/demos/pc/app/modal/webdoc/modal.js (1 hunks)
  • examples/sites/demos/pc/app/nav-menu/webdoc/nav-menu.js (1 hunks)
  • examples/sites/demos/pc/app/notify/webdoc/notify.js (1 hunks)
  • examples/sites/demos/pc/app/numeric/webdoc/numeric.js (1 hunks)
  • examples/sites/demos/pc/app/pager/webdoc/pager.js (1 hunks)
  • examples/sites/demos/pc/app/pop-upload/webdoc/pop-upload.js (1 hunks)
  • examples/sites/demos/pc/app/popconfirm/webdoc/popconfirm.js (1 hunks)
  • examples/sites/demos/pc/app/popeditor/webdoc/popeditor.js (1 hunks)
  • examples/sites/demos/pc/app/popover/webdoc/popover.js (1 hunks)
  • examples/sites/demos/pc/app/progress/webdoc/progress.js (1 hunks)
  • examples/sites/demos/pc/app/qr-code/webdoc/qr-code.js (1 hunks)
  • examples/sites/demos/pc/app/radio/webdoc/radio.js (1 hunks)
  • examples/sites/demos/pc/app/rate/webdoc/rate.js (1 hunks)
  • examples/sites/demos/pc/app/scroll-text/webdoc/scroll-text.js (1 hunks)
  • examples/sites/demos/pc/app/search/webdoc/search.js (1 hunks)
  • examples/sites/demos/pc/app/select/webdoc/select.js (1 hunks)
  • examples/sites/demos/pc/app/skeleton/webdoc/skeleton.js (1 hunks)
  • examples/sites/demos/pc/app/slider/webdoc/slider.js (1 hunks)
  • examples/sites/demos/pc/app/split/webdoc/split.js (1 hunks)
  • examples/sites/demos/pc/app/statistic/webdoc/statistic.js (1 hunks)
  • examples/sites/demos/pc/app/steps/webdoc/steps.js (1 hunks)
  • examples/sites/demos/pc/app/sticky/webdoc/sticky.js (1 hunks)
  • examples/sites/demos/pc/app/switch/webdoc/switch.js (1 hunks)
  • examples/sites/demos/pc/app/tabs/webdoc/tabs.js (1 hunks)
  • examples/sites/demos/pc/app/tag-group/webdoc/tag-group.js (1 hunks)
  • examples/sites/demos/pc/app/tag/webdoc/tag.js (1 hunks)
  • examples/sites/demos/pc/app/text-popup/webdoc/text-popup.js (1 hunks)
  • examples/sites/demos/pc/app/time-line/webdoc/time-line.js (1 hunks)
  • examples/sites/demos/pc/app/time-picker/webdoc/time-picker.js (1 hunks)
  • examples/sites/demos/pc/app/time-select/webdoc/time-select.js (1 hunks)
  • examples/sites/demos/pc/app/tooltip/webdoc/tooltip.js (1 hunks)
  • examples/sites/demos/pc/app/transfer/webdoc/transfer.js (1 hunks)
  • examples/sites/demos/pc/app/tree-menu/webdoc/tree-menu.js (1 hunks)
  • examples/sites/demos/pc/app/tree-select/webdoc/tree-select.js (1 hunks)
  • examples/sites/demos/pc/app/tree/webdoc/tree.js (1 hunks)
  • examples/sites/demos/pc/app/user-contact/webdoc/user-contact.js (1 hunks)
  • examples/sites/demos/pc/app/user-head/webdoc/user-head.js (1 hunks)
  • examples/sites/demos/pc/app/virtual-scroll-box/webdoc/virtual-scroll-box.js (1 hunks)
  • examples/sites/demos/pc/app/virtual-tree/webdoc/virtual-tree.js (1 hunks)
  • examples/sites/demos/pc/app/watermark/webdoc/watermark.js (1 hunks)
  • examples/sites/demos/pc/app/wizard/webdoc/wizard.js (1 hunks)
  • examples/sites/src/router.js (2 hunks)
  • examples/sites/src/views/features.vue (1 hunks)
🔇 Additional comments (97)
examples/sites/demos/pc/app/calendar/webdoc/calendar.js (1)

4-5: Configuration properties added for component visibility and cloud support

These new properties enhance the configurability of the Calendar component:

  • show: true controls whether the component is visible in documentation or feature lists
  • cloud: false indicates this component doesn't have cloud-related functionality

These changes align with the PR goal of adding feature list capabilities to the TinyVue documentation.

examples/sites/demos/pc/app/container/webdoc/container.js (1)

4-5: Configuration properties added for component visibility and cloud support

These new properties enhance the configurability of the Container component:

  • show: true controls whether the component is visible in documentation or feature lists
  • cloud: false indicates this component doesn't have cloud-related functionality

These changes align with the PR goal of adding feature list capabilities to the TinyVue documentation.

examples/sites/demos/pc/app/nav-menu/webdoc/nav-menu.js (1)

4-5: Configuration properties added for component visibility and cloud support

These new properties enhance the configurability of the NavMenu component:

  • show: true controls whether the component is visible in documentation or feature lists
  • cloud: false indicates this component doesn't have cloud-related functionality

These changes align with the PR goal of adding feature list capabilities to the TinyVue documentation.

examples/sites/demos/pc/app/floatbar/webdoc/floatbar.js (1)

4-5: Configuration properties added for component visibility and cloud support

These new properties enhance the configurability of the Floatbar component:

  • show: true controls whether the component is visible in documentation or feature lists
  • cloud: false indicates this component doesn't have cloud-related functionality

These changes align with the PR goal of adding feature list capabilities to the TinyVue documentation.

examples/sites/demos/pc/app/tag/webdoc/tag.js (1)

4-5: Adding configuration for component visibility and cloud integration

These new properties enhance the component configuration:

  • show: true - Controls whether the tag component should be displayed in documentation/UI
  • cloud: true - Indicates the component is available for cloud environments

This aligns with the PR's goal of adding feature list support to the documentation.

examples/sites/demos/pc/app/dialog-box/webdoc/dialog-box.js (1)

4-5: Adding configuration for component visibility and cloud integration

These new properties enhance the component configuration:

  • show: true - Controls whether the dialog-box component should be displayed in documentation/UI
  • cloud: true - Indicates the component is available for cloud environments

This aligns with the PR's goal of adding feature list support to the documentation.

examples/sites/demos/pc/app/slider/webdoc/slider.js (1)

4-5: Adding configuration for component visibility and cloud integration

These new properties enhance the component configuration:

  • show: true - Controls whether the slider component should be displayed in documentation/UI
  • cloud: true - Indicates the component is available for cloud environments

This aligns with the PR's goal of adding feature list support to the documentation.

examples/sites/demos/pc/app/badge/webdoc/badge.js (1)

4-5: Adding configuration for component visibility and cloud integration

These new properties enhance the component configuration:

  • show: true - Controls whether the badge component should be displayed in documentation/UI
  • cloud: true - Indicates the component is available for cloud environments

This aligns with the PR's goal of adding feature list support to the documentation.

examples/sites/demos/pc/app/tree-menu/webdoc/tree-menu.js (1)

4-5: Adding configuration properties for component display and cloud functionality.

These new properties enhance the component's configurability, allowing control over visibility and cloud-related features.

examples/sites/demos/pc/app/pager/webdoc/pager.js (1)

4-5: Adding configuration properties for component display and cloud functionality.

These new properties enhance the component's configurability by enabling visibility control (show: true) and cloud feature integration (cloud: true).

examples/sites/demos/pc/app/icon/webdoc/icon.js (1)

4-5: Adding configuration properties for component display and cloud functionality.

The new properties show and cloud enable control over the component's visibility and cloud feature integration.

examples/sites/demos/pc/app/card/webdoc/card.js (1)

4-5: Adding configuration properties for component display and cloud functionality.

These new properties align with the pattern added to other components in this PR, providing consistent configuration options for visibility and cloud feature integration across the component library.

examples/sites/demos/pc/app/qr-code/webdoc/qr-code.js (1)

4-5: The show and cloud configuration properties look good.

These new properties (show: true, cloud: false) align with the documentation enhancement by allowing control over component visibility and cloud-related functionality. The QR code component is properly configured to be shown in the documentation but excluded from cloud features.

examples/sites/demos/pc/app/link/webdoc/link.js (1)

4-5: Configuration properties are properly set.

The added properties (show: true, cloud: true) ensure the Link component is displayed in both the documentation and cloud environment, which is consistent with the component's nature as a fundamental UI element.

examples/sites/demos/pc/app/divider/webdoc/divider.js (1)

4-5: Consistent configuration added.

The show and cloud properties are correctly set to true, ensuring this component is visible in both normal and cloud documentation contexts. This maintains consistency with other UI components in the library.

examples/sites/demos/pc/app/date-picker/webdoc/date-picker.js (1)

4-5: Configuration properties properly implemented.

The DatePicker component now correctly includes the standard visibility and cloud-related configuration properties. This is consistent with other components and supports the documentation enhancement purpose of this PR.

examples/sites/demos/pc/app/drawer/webdoc/drawer.js (1)

4-5: LGTM: Configuration properties for component visibility and cloud integration.

Adding the show and cloud properties enables controlling component visibility and cloud-related functionality in the documentation. This change is part of a consistent pattern applied across multiple components to support feature listing.

examples/sites/demos/pc/app/radio/webdoc/radio.js (1)

4-5: LGTM: Consistent configuration properties added.

The show and cloud properties align with the pattern applied to other components, ensuring uniform configuration capabilities across the component library.

examples/sites/demos/pc/app/skeleton/webdoc/skeleton.js (1)

4-5: LGTM: Standard configuration properties maintained.

The addition of show and cloud properties follows the established pattern, enabling this component to be properly included in feature listings and documentation views.

examples/sites/demos/pc/app/carousel/webdoc/carousel.js (1)

4-5: LGTM: Configuration consistent with other components.

The added show and cloud properties maintain consistency with other component configurations, supporting the feature listing functionality described in the PR objectives.

examples/sites/demos/pc/app/tag-group/webdoc/tag-group.js (1)

4-5: Documentation configuration properties added

The addition of show: true and cloud: true enhances the component configuration to control visibility in documentation and indicate cloud compatibility. These properties will likely be used by a feature list component to filter and display components based on these settings.

examples/sites/demos/pc/app/layout/webdoc/layout.js (1)

4-5: Documentation visibility configured with cloud feature disabled

The configuration sets show: true to display this component in the documentation, while cloud: false indicates this component is not available or relevant for cloud-related features. This helps maintain consistency with the documentation feature list being implemented.

examples/sites/demos/pc/app/sticky/webdoc/sticky.js (1)

4-5: Documentation visibility configured with cloud feature disabled

The addition of show: true makes this component visible in the documentation, while cloud: false indicates it's not available for cloud-related features. This configuration supports the new feature list functionality in the documentation.

examples/sites/demos/pc/app/grid/webdoc/grid.js (1)

4-5: Documentation configuration properties added with cloud support

The grid component is configured with both show: true and cloud: true, making it visible in the documentation and indicating it's compatible with cloud features. This aligns with the PR's goal of adding a feature list to the documentation.

examples/sites/demos/pc/app/time-picker/webdoc/time-picker.js (1)

4-5: Configuration added for feature list visibility and cloud support.

The addition of show: true and cloud: true properties enables this component to be displayed in the feature list and marks it as having cloud functionality.

examples/sites/demos/pc/app/input/webdoc/input.js (1)

4-5: Configuration added for feature list visibility and cloud support.

The addition of show: true and cloud: true properties enables this component to be displayed in the feature list and marks it as having cloud functionality.

examples/sites/demos/pc/app/alert/webdoc/alert.js (1)

4-5: Configuration added for feature list visibility and cloud support.

The addition of show: true and cloud: true properties enables this component to be displayed in the feature list and marks it as having cloud functionality.

examples/sites/demos/pc/app/collapse/webdoc/collapse.js (1)

4-5: Configuration added for feature list visibility and cloud support.

The addition of show: true and cloud: true properties enables this component to be displayed in the feature list and marks it as having cloud functionality.

examples/sites/demos/pc/app/guide/webdoc/guide.js (1)

4-5: Component visibility configuration added

The addition of show: true and cloud: true properties appears to be part of a broader documentation enhancement to control component visibility and cloud feature availability in a feature list. These properties will likely be used by the new feature list component mentioned in the PR objectives.

examples/sites/demos/pc/app/wizard/webdoc/wizard.js (1)

4-5: Component visibility configuration added with cloud disabled

The addition of show: true indicates this component should be visible in the feature list, while cloud: false suggests this component doesn't support cloud functionality. This is consistent with the pattern applied across multiple components in this PR.

examples/sites/demos/pc/app/pop-upload/webdoc/pop-upload.js (1)

4-5: Component visibility configuration added with cloud disabled

The visibility configuration (show: true) will include this component in the feature list, while cloud: false indicates this upload component doesn't have cloud-specific functionality. This makes sense for a component that may handle local file uploads.

examples/sites/demos/pc/app/watermark/webdoc/watermark.js (1)

4-5: Component visibility configuration added with cloud disabled

The addition of show: true and cloud: false is consistent with the pattern across other components. This watermark component will be visible in the feature list but doesn't offer cloud-specific functionality, which aligns with the typical use case for watermarks.

examples/sites/demos/pc/app/time-line/webdoc/time-line.js (1)

4-5: Configuration properties added for feature visibility and cloud functionality.

The added show and cloud properties will enable control over component visibility in documentation and cloud-related functionality. This is consistent with similar changes across other components.

examples/sites/demos/pc/app/anchor/webdoc/anchor.js (1)

4-5: Configuration properties added for feature visibility and cloud functionality.

The added show and cloud properties will enable control over component visibility in documentation and cloud-related functionality. This is consistent with similar changes across other components.

examples/sites/demos/pc/app/rate/webdoc/rate.js (1)

4-5: Configuration added with cloud functionality disabled for Rate component.

The added show: true enables visibility in documentation, while cloud: false specifically disables cloud functionality for this component, unlike most other components where it's enabled. This distinction is likely intentional based on component requirements.

examples/sites/demos/pc/app/numeric/webdoc/numeric.js (1)

4-5: Configuration properties added for feature visibility and cloud functionality.

The added show and cloud properties will enable control over component visibility in documentation and cloud-related functionality. This is consistent with similar changes across other components.

examples/sites/demos/pc/app/search/webdoc/search.js (1)

4-5: Added configuration properties to control component visibility and cloud integration.

The addition of show: true and cloud: true properties to the search component configuration aligns with the PR objective to enhance documentation by adding a feature list. These properties will allow the application to control whether this component should be displayed in the feature list and whether it supports cloud functionality.

examples/sites/demos/pc/app/tabs/webdoc/tabs.js (1)

4-5: Added configuration properties to control component visibility and cloud integration.

The addition of show: true and cloud: true properties to the tabs component configuration is consistent with the changes made to other components. These properties will enable the component to be properly categorized and displayed in the feature list being implemented.

examples/sites/demos/pc/app/notify/webdoc/notify.js (1)

4-5: Added configuration properties with cloud set to false for notify component.

Added show: true to include this component in the feature list, but cloud: false indicates that this component doesn't support cloud functionality. This distinction is important for accurately representing component capabilities in the documentation.

examples/sites/demos/pc/app/mind-map/webdoc/mind-map.js (1)

4-5: Added configuration properties with cloud set to false for mind-map component.

The addition of show: true and cloud: false properties properly categorizes the mind-map component for the feature list. Setting cloud: false correctly indicates that this more complex visualization component doesn't have cloud integration support.

examples/sites/demos/pc/app/time-select/webdoc/time-select.js (1)

4-5: Configuration looks good for time-select component

Adding the show and cloud properties to control component visibility and cloud feature flags is consistent with the documentation enhancement for feature listing.

examples/sites/demos/pc/app/crop/webdoc/crop.js (1)

4-5: Configuration looks good for crop component

Adding the show and cloud properties to control component visibility and cloud feature flags is consistent with the documentation enhancement for feature listing.

examples/sites/demos/pc/app/switch/webdoc/switch.js (1)

4-5: Configuration looks good for switch component

Adding the show and cloud properties to control component visibility and cloud feature flags is consistent with the documentation enhancement for feature listing. Note that unlike some other components, switch has cloud: true.

examples/sites/demos/pc/app/flowchart/webdoc/flowchart.js (1)

4-5: Configuration looks good for flowchart component

Adding the show and cloud properties to control component visibility and cloud feature flags is consistent with the documentation enhancement for feature listing.

examples/sites/demos/pc/app/breadcrumb/webdoc/breadcrumb.js (1)

4-5: Good addition of configuration flags.

Adding the show and cloud properties helps with controlling component visibility and indicating cloud compatibility in the documentation feature list.

examples/sites/demos/pc/app/text-popup/webdoc/text-popup.js (1)

4-5: Appropriate configuration for text-popup component.

Setting show: true while keeping cloud: false correctly indicates this component should be displayed in documentation but might not be fully supported in cloud environments.

examples/sites/demos/pc/app/base-select/webdoc/base-select.js (1)

4-5: Correct implementation of display flags.

The configuration for visibility (show: true) and cloud compatibility (cloud: true) aligns with the documentation feature list implementation pattern.

examples/sites/demos/pc/app/checkbox/webdoc/checkbox.js (1)

4-5: Consistent implementation of feature flags.

The addition of show: true and cloud: true maintains consistency with other components and properly configures this component for the documentation feature list.

examples/sites/demos/pc/app/steps/webdoc/steps.js (1)

4-5: Configuration properties added consistently with documentation update

These new configuration properties (show and cloud) align with the PR objective of adding a feature list to the documentation. The show: true property likely controls component visibility in the documentation, while cloud: true indicates cloud functionality support.

examples/sites/demos/pc/app/split/webdoc/split.js (1)

4-5: Configuration properties added for documentation feature list

The addition of show: true and cloud: false properties is consistent with the feature list enhancement mentioned in the PR objectives. Unlike some other components, this one has cloud: false, indicating it doesn't support cloud functionality.

examples/sites/demos/pc/app/popeditor/webdoc/popeditor.js (1)

4-5: Configuration properties added for component visibility and cloud support

The new show: true and cloud: false properties are part of the systematic update to add feature list documentation. This component is marked as visible but without cloud functionality support.

examples/sites/demos/pc/app/autocomplete/webdoc/autocomplete.js (1)

4-5: Configuration properties added for documentation features

The addition of show: true and cloud: true properties aligns with the PR's documentation enhancement goal. This component is configured to be visible and supporting cloud functionality.

examples/sites/demos/pc/app/image/webdoc/image.js (1)

4-5: Standardized component configuration with visibility and cloud flags.

The addition of show and cloud properties enhances the component configuration, providing control over whether this component should be displayed in the documentation and whether it supports cloud functionality.

examples/sites/demos/pc/app/loading/webdoc/loading.js (1)

4-5: Standardized component configuration with visibility and cloud flags.

The addition of show and cloud properties enhances the component configuration, providing control over whether this component should be displayed in the documentation and whether it supports cloud functionality.

examples/sites/demos/pc/app/cascader-panel/webdoc/cascader-panel.js (1)

4-5: Standardized component configuration with visibility and cloud flags.

The addition of show and cloud properties enhances the component configuration, providing control over whether this component should be displayed in the documentation and whether it supports cloud functionality.

examples/sites/demos/pc/app/tree-select/webdoc/tree-select.js (1)

4-5: Standardized component configuration with visibility and cloud flags.

The addition of show and cloud properties enhances the component configuration, providing control over whether this component should be displayed in the documentation and whether it supports cloud functionality.

examples/sites/demos/pc/app/popconfirm/webdoc/popconfirm.js (1)

4-5: Added configuration properties for component visibility and cloud compatibility.

These new properties appear to be part of a systematic update across components to control visibility in documentation and indicate cloud compatibility.

examples/sites/demos/pc/app/bulletin-board/webdoc/bulletin-board.js (1)

4-5: Component flagged as visible but not cloud-compatible.

The show: true property enables visibility in documentation, while cloud: false indicates this component isn't available in cloud environments.

examples/sites/demos/pc/app/drop-times/webdoc/drop-times.js (1)

4-5: Component configured for documentation display but not for cloud.

This configuration matches other time-related components that are visible in documentation but not supported in cloud deployments.

examples/sites/demos/pc/app/dialog-select/webdoc/dialog-select.js (1)

4-5: Dialog-select component marked as visible but not cloud-compatible.

This configuration is consistent with other dialog/selection components in the codebase, maintaining documentation visibility but indicating cloud limitations.

examples/sites/demos/pc/app/form/webdoc/form.js (1)

4-5: Configuration flags added for component visibility and cloud support.

The addition of show: true and cloud: true properties standardizes the configuration for component visibility and cloud functionality support. This aligns with the broader implementation across other components in the documentation.

examples/sites/demos/pc/app/transfer/webdoc/transfer.js (1)

4-5: Configuration flags added for component visibility and cloud support.

The addition of show: true and cloud: true properties standardizes the configuration for component visibility and cloud functionality support. This matches the implementation in other components and enables consistent handling in the documentation system.

examples/sites/demos/pc/app/button-group/webdoc/button-group.js (1)

4-5: Configuration flags added for component visibility and cloud support.

The addition of show: true and cloud: true properties standardizes the configuration for component visibility and cloud functionality support. This matches the implementation in other components and enables consistent handling in the documentation system.

examples/sites/demos/pc/app/user-head/webdoc/user-head.js (1)

4-5: Configuration flags added with cloud functionality disabled.

The addition of show: true and cloud: false properties indicates that this component should be visible in the documentation but is not supported in cloud implementations. This differs from most other components where cloud support is typically enabled.

examples/sites/demos/pc/app/tree/webdoc/tree.js (1)

4-5: Configuration properties added for component visibility and cloud features.

These new properties allow controlling the component's visibility in documentation (show: true) and indicate cloud feature support (cloud: true).

examples/sites/demos/pc/app/dropdown/webdoc/dropdown.js (1)

4-5: Configuration properties added for component visibility and cloud features.

Added consistent properties to control component visibility (show: true) and indicate cloud feature support (cloud: true).

examples/sites/demos/pc/app/color-picker/webdoc/color-picker.js (1)

4-5: Configuration properties added with cloud features disabled.

Added properties to control component visibility (show: true) while specifying that cloud features are not supported for this component (cloud: false).

examples/sites/demos/pc/app/select/webdoc/select.js (1)

4-5: Configuration properties added for component visibility and cloud features.

Added consistent properties to control component visibility (show: true) and indicate cloud feature support (cloud: true).

examples/sites/demos/pc/app/filter-panel/webdoc/filter-panel.js (1)

4-5: Added configuration properties for component visibility and cloud functionality.

These new properties enhance component configuration by indicating whether the component should be displayed (show: true) and whether it has cloud functionality (cloud: false).

examples/sites/demos/pc/app/modal/webdoc/modal.js (1)

4-5: Added display and cloud configuration properties.

The additions of show: true and cloud: true properly configure the modal component for visibility and cloud integration. This aligns with the pattern applied across other components in this PR.

examples/sites/demos/pc/app/milestone/webdoc/milestone.js (1)

4-5: Added component visibility and cloud support configuration.

The addition of show: true enables the component to be visible in the documentation, while cloud: false indicates this component doesn't have cloud functionality.

examples/sites/demos/pc/app/action-menu/webdoc/action-menu.js (1)

4-5: Added display and cloud support configuration properties.

The additions of show: true and cloud: true properly configure this component to be visible in the documentation and indicate it has cloud-related functionality.

examples/sites/demos/pc/app/fluent-editor/webdoc/fluent-editor.js (1)

4-5: Added component configuration flags for documentation visibility.

The new show and cloud properties will control whether this component appears in the feature list documentation and whether it has cloud functionality support.

examples/sites/demos/pc/app/tooltip/webdoc/tooltip.js (1)

4-5: Added component configuration flags for feature list.

The new show and cloud properties are correctly configured to include this component in the feature list documentation with cloud functionality support enabled.

examples/sites/demos/pc/app/scroll-text/webdoc/scroll-text.js (1)

4-5: Added component documentation visibility flags.

The new properties will allow this component to be shown in the feature list documentation (show: true) while indicating it doesn't support cloud functionality (cloud: false).

examples/sites/demos/pc/app/fullscreen/webdoc/fullscreen.js (1)

4-5: Added component documentation configuration flags.

The new show and cloud properties correctly configure this component to appear in the feature list with cloud functionality support enabled.

examples/sites/demos/pc/app/calendar-view/webdoc/calendar-view.js (1)

4-5: Component visibility and cloud integration configuration added.

The addition of show: true and cloud: false properties enables control over component visibility and cloud integration functionality. This is part of a larger effort to standardize component configurations across the TinyVue library, likely to support the new feature list implementation mentioned in the PR.

examples/sites/demos/pc/app/ip-address/webdoc/ip-address.js (1)

4-5: Component visibility and cloud integration configuration added.

The addition of show: true and cloud: true properties enables control over component visibility and cloud integration functionality. Setting cloud: true indicates this component is enabled for cloud-related features, unlike some other components in the codebase.

examples/sites/demos/pc/app/user-contact/webdoc/user-contact.js (1)

4-5: Component visibility and cloud integration configuration added.

The addition of show: true and cloud: false properties enables control over component visibility and disables cloud integration functionality for this component. This configuration is consistent with the standardization effort across the component library to support the new feature list.

examples/sites/demos/pc/app/popover/webdoc/popover.js (1)

4-5: Component visibility and cloud integration configuration added.

The addition of show: true and cloud: true properties enables control over component visibility and cloud integration functionality. This popover component is enabled for cloud features, consistent with the configuration pattern being applied across the component library.

examples/sites/demos/pc/app/virtual-scroll-box/webdoc/virtual-scroll-box.js (1)

4-5: Property additions for component visibility and cloud support

These new properties help control the component's visibility (show: true) in the feature list while indicating it doesn't support cloud functionality (cloud: false). This aligns with the PR objective of adding a feature list.

examples/sites/demos/pc/app/statistic/webdoc/statistic.js (1)

4-5: Property additions for component visibility and cloud support

These new properties help control the component's visibility (show: true) in the feature list while indicating it doesn't support cloud functionality (cloud: false). This aligns with the PR objective of adding a feature list.

examples/sites/demos/pc/app/cascader/webdoc/cascader.js (1)

4-5: Property additions for component visibility and cloud support

These new properties help control the component's visibility (show: true) in the feature list while indicating it supports cloud functionality (cloud: true). This aligns with the PR objective of adding a feature list.

examples/sites/demos/pc/app/file-upload/webdoc/file-upload.js (1)

4-5: Property additions for component visibility and cloud support

These new properties help control the component's visibility (show: true) in the feature list while indicating it supports cloud functionality (cloud: true). This fits with the file-upload component which typically would integrate with cloud storage services.

examples/sites/demos/pc/app/progress/webdoc/progress.js (1)

4-5: Documentation configuration properties added.

These new properties enhance the component's metadata for documentation purposes:

  • show: true indicates this component should be visible in the feature list
  • cloud: true marks this component as having cloud environment support

These additions align with the PR objective of adding a feature list to the documentation.

examples/sites/demos/pc/app/color-select-panel/webdoc/color-select-panel.js (1)

4-5: Documentation configuration properties added.

These new properties enhance the component's metadata for documentation purposes:

  • show: true indicates this component should be visible in the feature list
  • cloud: false explicitly marks this component as not having cloud environment support

The difference in cloud support configuration compared to other components is appropriate for documentation clarity.

examples/sites/demos/pc/app/config-provider/webdoc/config-provider.js (1)

4-5: Documentation configuration properties added.

These new properties enhance the component's metadata for documentation purposes:

  • show: true indicates this component should be visible in the feature list
  • cloud: true marks this component as having cloud environment support

These additions are consistent with the pattern applied to other components in this PR.

examples/sites/demos/pc/app/virtual-tree/webdoc/virtual-tree.js (1)

4-5: Documentation configuration properties added.

These new properties enhance the component's metadata for documentation purposes:

  • show: true indicates this component should be visible in the feature list
  • cloud: false explicitly marks this component as not having cloud environment support

This configuration aligns with the component's capabilities and the PR's documentation objectives.

examples/sites/demos/pc/app/infinite-scroll/webdoc/infinite-scroll.js (1)

4-5: Good addition of configuration properties.

Adding the show and cloud properties provides clear indicators for documentation display and cloud compatibility. This aligns with the overall documentation improvement objectives of the PR.

examples/sites/src/router.js (2)

8-8: Proper import for the new Features component.

The dynamic import is consistent with the pattern used for other view components in the router.


34-40: Well-structured route configuration for the features page.

The route configuration follows the established pattern in the codebase. The comment indicating this is an internal feature is helpful for other developers.

examples/sites/demos/pc/app/button/webdoc/button.js (2)

147-148: Good addition of visibility and compatibility flags.

The show and cloud properties clearly indicate that this component should be visible in documentation and is compliant with cloud specifications.


149-270: Well-structured and comprehensive feature documentation.

The features array provides detailed information about each button feature, including:

  • Clear identification with IDs and names
  • Support status
  • Descriptive explanations
  • Cloud compatibility details with helpful remarks
  • Related API references
  • Demo cross-references

This structured approach will greatly enhance the documentation and make it easier for developers to understand the component's capabilities.

examples/sites/src/views/features.vue (4)

1-37: Well-designed feature list component template.

The template provides a clear and organized view of components and their features:

  • The header shows meaningful metrics (component and feature counts)
  • The filter toggle for cloud components adds useful functionality
  • The component listing with feature counts is visually informative
  • The grid layout for features ensures good organization

The component naming convention transformation to UpperCamelCase improves readability.


39-71: Effective data loading and component initialization.

The script effectively:

  • Imports necessary dependencies
  • Sets up reactive state variables
  • Uses the glob import pattern to dynamically load component documentation
  • Calculates metrics for components and features
  • Properly filters components based on the show property

This implementation supports the PR's goal of adding a feature list while maintaining good performance.


81-85: Good utility function for formatting component names.

The toUpperCamelCase function correctly transforms kebab-case component names to UpperCamelCase format for display purposes, following a common convention in Vue documentation.


88-115: Clean and effective component styling.

The styles are well-organized with appropriate naming conventions. The use of flexbox for alignment and the styling for component count badges creates a visually pleasing interface.

Copy link

@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: 1

♻️ Duplicate comments (1)
examples/sites/src/views/features.vue (1)

73-79: ⚠️ Potential issue

Fix the group function implementation

The reduce function here doesn't work as intended. The logic tries to group elements, but the condition x[x.length - 1].push(y) === step will not correctly form groups of step size because push returns the new array length, not the pushed element.

const group = (arr, step = 3) => {
  if (!arr || arr.length === 0) return
  if (arr.length <= step) return [arr]
-  return arr.reduce((x, y) => {
-    return Array.isArray(x) ? (x[x.length - 1].push(y) === step ? [...x, []] : x) : [[x, y]]
-  })
+  const result = []
+  for (let i = 0; i < arr.length; i += step) {
+    result.push(arr.slice(i, i + step))
+  }
+  return result
}
🧹 Nitpick comments (4)
examples/sites/src/views/features.vue (4)

14-17: Consider using a computed property for filtered components

Moving the filtering logic from the template to a computed property would improve readability and performance by avoiding unnecessary re-computations during renders.

<script setup>
import { TinyLayout, TinyRow, TinyCol, TinySwitch } from '@opentiny/vue'
-import { onMounted, ref } from 'vue'
+import { computed, onMounted, ref } from 'vue'

const componentCount = ref(0)
const featureCount = ref(0)
const components = ref([])
const isCloud = ref(false)

+const filteredComponents = computed(() => {
+  return isCloud.value ? components.value.filter((item) => item.config.cloud) : components.value
+})
</script>

// Then in template
<div
-  v-for="(component, componentIndex) of isCloud ? components.filter((item) => item.config.cloud) : components"
+  v-for="(component, componentIndex) of filteredComponents"
  :key="component.name"
>

48-71: Add error handling for component imports

The current implementation doesn't handle potential errors when importing component documentation, which could cause the entire component to fail silently.

onMounted(async () => {
  const componentDocs = import.meta.glob(`@demos/app/**/webdoc/*.js`)

  for (const item in componentDocs) {
-    const componentName = item.split('/')[4]
-    const componentConfig = (await componentDocs[item]()).default
-
-    if (componentConfig.show) {
-      componentCount.value++
-      components.value.push({
-        name: componentName,
-        config: componentConfig
-      })
-
-      const features = componentConfig.features
-
-      if (features) {
-        for (const feature in features) {
-          featureCount.value++
-        }
-      }
-    }
+    try {
+      const componentName = item.split('/')[4]
+      const componentConfig = (await componentDocs[item]()).default
+
+      if (componentConfig?.show) {
+        componentCount.value++
+        components.value.push({
+          name: componentName,
+          config: componentConfig
+        })
+
+        const features = componentConfig.features
+
+        if (Array.isArray(features)) {
+          featureCount.value += features.length
+        }
+      }
+    } catch (error) {
+      console.error(`Failed to load documentation for component: ${item}`, error)
+    }
  }
})

81-85: Add validation to toUpperCamelCase function

The function doesn't validate input, which could cause errors if str is undefined or null.

-const toUpperCamelCase = (str) =>
+const toUpperCamelCase = (str) => {
+  if (!str) return ''
+  return str
    .split('-')
    .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
    .join('')
+}

10-10: Consider internationalizing the text

If the application supports multiple languages, consider extracting the static text to an internationalization system.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 39a5ce1 and 2d045f1.

📒 Files selected for processing (1)
  • examples/sites/src/views/features.vue (1 hunks)

Comment on lines +64 to +68
if (features) {
for (const feature in features) {
featureCount.value++
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix feature counting logic

The current code uses a for...in loop to iterate over features, which iterates over object keys rather than array elements. If features is an array (as suggested by the usage of features?.length elsewhere), this counting logic is incorrect.

if (features) {
-  for (const feature in features) {
-    featureCount.value++
-  }
+  featureCount.value += features.length
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (features) {
for (const feature in features) {
featureCount.value++
}
}
if (features) {
featureCount.value += features.length
}

@zzcr zzcr merged commit 5f861e1 into dev Mar 17, 2025
9 of 10 checks passed
@kagol kagol deleted the kagol/add-feature-tag branch April 14, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation 对文档的改进或补充

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants