Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Properties Panel Table Columns #661

Open
wants to merge 2 commits into
base: refactor/develop
Choose a base branch
from

Conversation

ianxinnew
Copy link
Contributor

@ianxinnew ianxinnew commented Jul 17, 2024

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

  • New Features

    • Added labelPosition property set to "left" across various UI components for consistent label placement.
    • Introduced new SVG icons and improved button elements for better visual representation in the code editor and list items.
    • Enhanced user interaction by allowing items to be edited directly by clicking on their displayed text.
  • Enhancements

    • Refined font sizes, padding, and color schemes for improved readability and visual consistency.
    • Added title visibility for action items and simplified hover effects for a streamlined user experience.
  • Bug Fixes

    • Corrected cursor behavior on hover for action items to improve user interaction.

Copy link
Contributor

coderabbitai bot commented Jul 17, 2024

Walkthrough

Recent updates enhance the user interface and styling across multiple files. Key changes include the addition of a "labelPosition" property set to "left" in JSON configurations, along with CSS refinements and enhancements to component interactions that improve visual consistency and user interactivity.

Changes

File(s) Change Summary
designer-demo/public/mock/bundle.json Added "labelPosition" property with value "left" to multiple JSON objects for improved layout consistency.
packages/common/component/MetaCodeEditor.vue Enhanced button with an SVG icon, updated CSS for better styling, and adjusted hover properties.
packages/common/component/MetaListActions.vue Introduced a new <span> for action titles, simplified hover effects, and added new styling for improved layout.
packages/configurator/src/array-item-configurator/ArrayItemConfigurator.vue Added click event to a <span> for interactivity and updated action title for clarity.

Poem

In fields of code where changes grow,
Labels swing to the left, a gentle show,
Buttons click with icons bright,
Fonts now whisper, soft and light.
Colors dance in palettes new,
A rabbit's touch in every hue.
Code, refined, to blossom anew.

🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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: 3

Outside diff range, codebase verification and nitpick comments (3)
packages/configurator/src/slot-configurator/SlotConfigurator.vue (1)

Line range hint 15-29: Vue Component Logic Review

The component handles dynamic slot configurations and user interactions effectively. The use of Vue's reactivity system with ref and watchEffect is appropriate for the functionality. However, consider adding error handling or user feedback mechanisms if the operations in toggleSlot (like API calls or state changes) fail or have significant latency.

packages/settings/props/src/composable/useProperties.js (1)

Line range hint 1-123: General Code Review of useProperties.js

The module is well-structured and follows best practices for modularity and reusability. The use of Vue composition API functions like ref and watchEffect is appropriate. Consider adding more detailed JSDoc comments, especially for exported functions, to improve maintainability and developer understanding.

packages/configurator/src/js-slot-configurator/JsSlotConfigurator.vue (1)

Line range hint 33-68: Refactoring and Style Adjustments

The refactoring of imports and the addition of new styles are well-executed. However, ensure that the removal of the Tooltip component does not remove necessary user guidance or information that was previously available.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b140357 and 793c7da.

Files ignored due to path filters (4)
  • packages/design-core/assets/delete.svg is excluded by !**/*.svg
  • packages/design-core/assets/drag.svg is excluded by !**/*.svg
  • packages/design-core/assets/edit-code.svg is excluded by !**/*.svg
  • packages/design-core/assets/edit.svg is excluded by !**/*.svg
Files selected for processing (13)
  • designer-demo/public/mock/bundle.json (67 hunks)
  • packages/common/component/ConfigItem.vue (2 hunks)
  • packages/common/component/MetaCodeEditor.vue (2 hunks)
  • packages/common/component/MetaList.vue (2 hunks)
  • packages/common/component/MetaListActions.vue (2 hunks)
  • packages/common/component/MetaListItem.vue (7 hunks)
  • packages/configurator/src/array-item-configurator/ArrayItemConfigurator.vue (2 hunks)
  • packages/configurator/src/js-slot-configurator/JsSlotConfigurator.vue (8 hunks)
  • packages/configurator/src/slot-configurator/SlotConfigurator.vue (1 hunks)
  • packages/settings/props/src/composable/useProperties.js (3 hunks)
  • packages/theme/common/global.less (1 hunks)
  • packages/theme/light/metaComponent.less (1 hunks)
  • packages/theme/light/variable.less (1 hunks)
Files skipped from review due to trivial changes (2)
  • packages/common/component/ConfigItem.vue
  • packages/theme/light/variable.less
Additional comments not posted (24)
packages/common/component/MetaList.vue (1)

11-13: Verify the UI impact of moving the actions div.

The actions div has been moved within the template. Ensure this change aligns with the intended layout and does not disrupt user interactions or accessibility.

packages/configurator/src/slot-configurator/SlotConfigurator.vue (1)

172-172: CSS Property Changes in .e__switch-core

The width of the .e__switch-core class has been reduced from 40px to 38px, and the background color has been changed. These changes are minor but should be verified visually to ensure they align with the desired UI aesthetics and do not affect the usability or visibility of the switch element.

Also applies to: 178-178

packages/settings/props/src/composable/useProperties.js (1)

36-36: Addition of labelPosition Property

The labelPosition property has been uniformly added to several property configurations (className, id, ref). This addition is consistent and should help in aligning labels as per the new UI requirements. Ensure that the consuming components or templates are updated to respect this new property.

Also applies to: 53-53, 70-70

packages/configurator/src/js-slot-configurator/JsSlotConfigurator.vue (1)

25-25: Comprehensive Review of Changes in JsSlotConfigurator.vue

The changes in this file include updates to component imports, adjustments to styling, and modifications to component behavior. The removal of the tooltip and the addition of new styles and properties should be verified to ensure they align with the intended functionality and do not affect other parts of the application adversely.

Also applies to: 33-33, 42-42, 68-68, 168-168, 188-188, 191-194, 213-219, 239-247

Verification successful

Comprehensive Review of Changes in JsSlotConfigurator.vue

The changes in this file include updates to component imports, adjustments to styling, and modifications to component behavior. The removal of the tooltip and the addition of new styles and properties have been verified and do not affect other parts of the application directly, as JsSlotConfigurator is not referenced in other .vue files.

  • No further action is required based on the current context.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if the changes in JsSlotConfigurator.vue affect other components.

# Test: Search for the usage of modified classes and components in other Vue components.
rg --type vue 'JsSlotConfigurator'

Length of output: 62


Script:

#!/bin/bash
# Description: Verify if the changes in JsSlotConfigurator.vue affect other components.

# Test: Search for the usage of modified classes and components in other Vue components.
rg 'JsSlotConfigurator' --glob '*.vue'

Length of output: 38

packages/common/component/MetaListItem.vue (2)

Line range hint 19-47: Adjustments to Popover and Icon Usage

The adjustments to the popover width and the replacement of icons are significant changes. Ensure that these changes enhance the user experience and are consistent with the design guidelines of the application.


5-5: Comprehensive Review of Changes in MetaListItem.vue

The changes in this file include the replacement of icons, adjustments to popover width, and modifications to component behavior and styling. These changes should be verified to ensure they align with the intended functionality and do not affect other parts of the application adversely.

Also applies to: 19-19, 40-40, 46-47, 80-81, 240-254, 286-294

packages/common/component/MetaCodeEditor.vue (1)

9-10: Enhanced button design with new SVG icon and label.

The addition of an SVG icon and a label within the tiny-button component enhances the visual appeal and user experience. Ensure that accessibility features such as aria-labels are considered if not already handled by the svg-icon component.

packages/theme/common/global.less (1)

343-347: Adjusted positioning and styling for .fixed-left.

The changes to the .fixed-left class improve the layout and user experience by adjusting the positioning and overflow handling. Ensure these changes are tested across different screen sizes and devices to maintain responsiveness.

designer-demo/public/mock/bundle.json (12)

2774-2775: Consistent addition of "labelPosition" property.

The addition of "labelPosition": "left" is consistent with the PR's objective to enhance UI elements by specifying label positions. This change is correctly formatted as a JSON property.


2794-2795: Consistent addition of "labelPosition" property.

This change is consistent and correctly formatted within the JSON structure.


2825-2826: Consistent addition of "labelPosition" property.

The addition is consistent with other similar changes, enhancing the UI's consistency.


2987-2988: Consistent addition of "labelPosition" property.

The addition is correctly formatted and consistent with the intended UI enhancements.


3018-3019: Consistent addition of "labelPosition" property.

This change is consistent and correctly formatted within the JSON structure.


3038-3039: Consistent addition of "labelPosition" property.

The addition is consistent with other similar changes, enhancing the UI's consistency.


3058-3059: Consistent addition of "labelPosition" property.

This change is consistent and correctly formatted within the JSON structure.


3127-3128: Consistent addition of "labelPosition" property.

The addition is correctly formatted and consistent with the intended UI enhancements.


3162-3163: Consistent addition of "labelPosition" property.

This change is consistent and correctly formatted within the JSON structure.


4689-4690: Consistent addition of "labelPosition" property.

The addition is consistent with other similar changes, enhancing the UI's consistency.


4844-4845: Consistent addition of "labelPosition" property.

This change is consistent and correctly formatted within the JSON structure.


4880-4881: Consistent addition of "labelPosition" property.

The addition is correctly formatted and consistent with the intended UI enhancements.

packages/common/component/MetaListActions.vue (2)

39-49: CSS Enhancements Approved

The changes to the CSS, including the new .actions-title class and modifications to .tiny-svg, are well-implemented. Using CSS variables like var(--ti-lowcode-add-table-column-color) enhances maintainability and theming capabilities.


6-6: Optional chaining usage in template

The use of optional chaining (?.) in <span class="actions-title">{{ actionsItem?.add }}</span> is good for defensive programming. However, ensure that this is consistent with the error handling strategy used throughout the project.

Verification successful

Optional chaining usage in template

The use of optional chaining (?.) in <span class="actions-title">{{ actionsItem?.add }}</span> is consistent with the error handling strategy used throughout the project. The pattern is widely used in various .vue files.

  • Examples of consistent usage:
    • item?.collapsed ? collapseBar.push(item) : rightBar.push(item)
    • props.renderPanel && lastPlugin?.confirm
    • pluginRef.value?.[lastPlugin.confirm](confirmCallback)
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistent use of optional chaining in Vue templates.

# Test: Search for optional chaining usage in Vue templates. Expect: Consistent usage across the project.
rg --type vue '?.'

Length of output: 98


Script:

#!/bin/bash
# Description: Verify the consistent use of optional chaining in Vue templates.

# Test: Search for optional chaining usage in Vue templates. Expect: Consistent usage across the project.
rg --type vue '\?\.'

Length of output: 50


Script:

#!/bin/bash
# Description: Verify the consistent use of optional chaining in Vue templates.

# Find all .vue files and search for optional chaining usage.
fd -e vue -x rg '\?\.' {}

Length of output: 34282

packages/theme/light/metaComponent.less (1)

26-26: Update to color variable

The change in the variable --ti-lowcode-meta-config-item-label-color to var(--ti-lowcode-base-text-color-1) seems appropriate for theming consistency. However, verify that this change does not affect other elements that might be using the same variable.

Verification successful

Update to color variable

The change in the variable --ti-lowcode-meta-config-item-label-color to var(--ti-lowcode-base-text-color-1) is verified to be appropriate for theming consistency. The variable is used in both light and dark themes and in a Vue component, and the change does not introduce any unintended side effects.

  • packages/theme/light/metaComponent.less
  • packages/theme/dark/metaComponent.less
  • packages/common/component/ConfigItem.vue
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of the color variable change on other components.

# Test: Search for the usage of `--ti-lowcode-meta-config-item-label-color`. Expect: No unintended changes in other components.
rg '--ti-lowcode-meta-config-item-label-color' -A 5

Length of output: 495


Script:

#!/bin/bash
# Description: Verify the impact of the color variable change on other components.

# Test: Search for the usage of `--ti-lowcode-meta-config-item-label-color`. Expect: No unintended changes in other components.
rg '--ti-lowcode-meta-config-item-label-color' -A 5

Length of output: 495


Script:

#!/bin/bash
# Description: Verify the impact of the color variable change on other components.

# Test: Search for the usage of `--ti-lowcode-meta-config-item-label-color`. Expect: No unintended changes in other components.
rg -e '--ti-lowcode-meta-config-item-label-color' -A 5

Length of output: 1778

packages/configurator/src/array-item-configurator/ArrayItemConfigurator.vue (1)

29-29: Enhancements in ArrayItemConfigurator

The addition of the click event handler in <span @click="editItem({ index })"> is a good UX improvement, allowing users to interact directly with items. The addition of the add property ('新增一列') to the actions array enhances functionality by providing descriptive text for UI elements.

Also applies to: 91-91

packages/common/component/MetaCodeEditor.vue Outdated Show resolved Hide resolved
designer-demo/public/mock/bundle.json Outdated Show resolved Hide resolved
designer-demo/public/mock/bundle.json Outdated Show resolved Hide resolved
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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 793c7da and f286a64.

Files selected for processing (4)
  • designer-demo/public/mock/bundle.json (67 hunks)
  • packages/common/component/MetaCodeEditor.vue (2 hunks)
  • packages/common/component/MetaListActions.vue (2 hunks)
  • packages/configurator/src/array-item-configurator/ArrayItemConfigurator.vue (2 hunks)
Additional comments not posted (45)
packages/common/component/MetaListActions.vue (3)

6-6: Good addition of the title display with optional chaining.

The addition of the <span> element to display the title of actionsItem is a good enhancement. The use of optional chaining ensures safety.


39-40: Simplified hover effect improves interaction design.

The simplification of the hover effect for the .actionsItem class improves the interaction design by removing unnecessary border styling.


43-49: Good use of CSS variables and addition of .actions-title class.

The use of CSS variables for colors in the .tiny-svg class ensures consistency with the visual theme. The addition of the .actions-title class integrates well with the existing layout.

packages/configurator/src/array-item-configurator/ArrayItemConfigurator.vue (2)

29-29: Enhanced user interactivity with click event handler.

The addition of the click event handler to the span element enhances user interactivity by allowing users to directly edit an item by clicking on its displayed text.


88-88: Improved clarity with updated action title.

The update to the title of an action within the actionsOptions object provides a more descriptive label, improving clarity for users regarding the action's purpose.

packages/common/component/MetaCodeEditor.vue (3)

9-10: Enhanced visual representation with SVG icon.

The addition of the SVG icon (edit-code) to the tiny-button element enhances the visual representation of the button, providing a clearer indication of its function.


266-270: Improved alignment and visual appeal with updated icon styles.

The updates to the .icon-edit-code class, including new margin and font size properties, improve the alignment and visual appeal of the icon.


259-273: Consistent styling with CSS variables and full-width button.

The use of CSS variables for colors in the .edit-btn class ensures consistency across the application. Setting the button's width to 100% may affect its layout within the parent container.

However, verify the impact of the full-width button on the layout.

designer-demo/public/mock/bundle.json (37)

2774-2775: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


2794-2795: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


2825-2826: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


2926-2927: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


2987-2988: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


3018-3019: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


3038-3039: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


3058-3059: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


3127-3128: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


3162-3163: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


4689-4690: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


4844-4845: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


4880-4881: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5042-5043: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5077-5078: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5105-5106: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5476-5477: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5499-5500: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5521-5522: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5544-5545: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5567-5568: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5590-5591: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5613-5614: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5636-5637: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5659-5660: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5747-5748: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5789-5790: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


5924-5925: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


6118-6119: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


6133-6134: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


6227-6228: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


6505-6506: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


6524-6525: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


6544-6545: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


6612-6613: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


6632-6633: LGTM!

The addition of the labelPosition property is correctly formatted and consistent.


7177-7178: LGTM!

The addition of the `labelPosition

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.

None yet

3 participants