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: Modify the outer class name of the module #1181

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

xuanlid
Copy link
Contributor

@xuanlid xuanlid commented Mar 5, 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

1.修改plugin下模块外层类名
2.复选框选中状态和默认状态大小调整
3.部分模块滚动条修改
4.弹窗关闭图标样式调整

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

  • Style

    • Standardized CSS class names across multiple plugin components for improved visual consistency.
    • Enhanced scrollbar styling and updated selectors (switching from IDs to classes) for a refined user interface.
    • Adjusted dialog close button appearance and removed outdated checkbox styles.
    • Introduced new CSS classes for various components to enhance styling context.
    • Updated existing CSS variables to reflect new class associations.
  • Refactor

    • Streamlined component layouts by introducing new wrapper elements and reorganizing template structures for better maintainability.

Copy link
Contributor

coderabbitai bot commented Mar 5, 2025

Walkthrough

This pull request implements extensive CSS class and template structural updates across multiple Vue components. The changes consist primarily of adding new CSS classes (e.g., lowcode-scrollbar, plugin-block, plugin-datasource) and renaming or augmenting existing ones to standardize styling. Several component templates now include new wrapper <div> elements, and CSS variable scopes have been refined. No functional logic or event-handling modifications were made, with the focus remaining solely on visual and style consistency across plugins.

Changes

File(s) Change Summary
packages/common/component/PluginSetting.vue, packages/plugins/bridge/src/BridgeManage.vue, packages/plugins/datasource/src/DataSourceList.vue Added the lowcode-scrollbar class to <div> elements to enhance scrollbar styling.
packages/plugins/block/src/Main.vue, packages/plugins/datasource/src/Main.vue, packages/plugins/page/src/Main.vue, packages/plugins/tutorial/src/Main.vue Introduced new outer <div> wrappers (with classes like plugin-block, plugin-datasource, plugin-page, and plugin-tutorial) to encapsulate components and adjust layout structure.
packages/plugins/bridge/src/Main.vue, packages/plugins/bridge/src/styles/vars.less, packages/plugins/i18n/src/Main.vue, packages/plugins/i18n/src/styles/vars.less, packages/plugins/help/src/HelpIcon.vue, packages/plugins/help/src/styles/vars.less, packages/plugins/schema/src/Main.vue, packages/plugins/schema/src/styles/vars.less, packages/plugins/script/src/Main.vue, packages/plugins/script/src/styles/vars.less, packages/plugins/state/src/Main.vue, packages/plugins/state/src/styles/vars.less, packages/plugins/tree/src/Main.vue, packages/plugins/tree/src/styles/vars.less, packages/plugins/tutorial/src/styles/vars.less Renamed or augmented CSS classes (e.g., from bridge-manage to plugin-bridge, plugin-panel-i18n to plugin-i18n, adding plugin-help, plugin-schema, plugin-script, plugin-state, plugin-tree, and plugin-tutorial) to improve styling consistency.
packages/plugins/datasource/src/DataSourceFieldList.vue, packages/plugins/block/src/styles/vars.less, packages/plugins/datasource/src/styles/vars.less, packages/plugins/materials/src/styles/vars.less Changed attribute values (e.g., name attribute from text-source-delete to delete) and updated CSS variable scopes including relocating popover custom properties and renaming .block-manage to .plugin-block.
packages/theme/base/src/component-common.less Adjusted dialog styles by modifying the close button’s font size and positioning, and entirely removed the .tiny-checkbox__input style block.

Possibly related PRs

  • fix: improve the style priority of overwriting tinyvue #848: The changes in the main PR, which involve adding a class to a <div> element, are related to the modifications in the retrieved PR that also involve changes to class definitions in a CSS file, specifically affecting the same component styling context.
  • fix some detail styles in the plugins #831: The changes in the main PR, which involve adding a class to a <div> element for styling, are related to the modifications in the retrieved PR that also focus on styling adjustments within various components, including class updates and visual enhancements.
  • fix(refactor/styles): fix property panel styles and common styles #887: The changes in the main PR, which involve adding a class to a <div> element for styling purposes, are related to the retrieved PR, as both involve modifications to class attributes in Vue component templates, specifically enhancing styling with new classes.

Suggested labels

refactor-main

Poem

Hoppin' through the code with glee,
New classes bloom like fresh spring trees.
I’m a rabbit, leaping high,
As styles and wrappers catch my eye.
In a world of CSS so bright,
I celebrate these changes day and night!
🐇🌸


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between aeb8f0d and d97e43c.

📒 Files selected for processing (1)
  • packages/plugins/page/src/Main.vue (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/plugins/page/src/Main.vue
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: push-check

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

@github-actions github-actions bot added the enhancement New feature or request label Mar 5, 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: 0

🧹 Nitpick comments (4)
packages/plugins/help/src/HelpIcon.vue (2)

118-118: Minor typo in class name

There appears to be a typo in the class name lwocode-guide-materials - it should likely be lowcode-guide-materials (note the "w" and "o" are transposed).

-        classes: 'lwocode-guide-materials',
+        classes: 'lowcode-guide-materials',

141-141: Consistent typo in multiple class names

The same typo appears in multiple places: lwocode-guide-* should likely be lowcode-guide-* (note the "w" and "o" are transposed). This appears to be a systematic typo across several class names.

-        classes: 'lwocode-guide-toolbar-right',
+        classes: 'lowcode-guide-toolbar-right',
-        classes: 'lwocode-guide-toolbar-right',
+        classes: 'lowcode-guide-toolbar-right',
-        classes: 'lwocode-guide-nav-panel',
+        classes: 'lowcode-guide-nav-panel',
-  &.lwocode-guide-nav-panel {
+  &.lowcode-guide-nav-panel {

Also applies to: 158-158, 183-183, 244-244

packages/plugins/datasource/src/styles/vars.less (1)

1-37: Good approach to CSS scoping and namespacing

The change from a global :root selector to a more specific .plugin-datasource class enhances CSS encapsulation and prevents variable name collisions across different plugins. This is in line with modern CSS best practices for component-based architectures.

Consider adding a comment at the top of the file that explains the CSS variable naming convention and scoping strategy. For example:

+/* 
+ * Datasource plugin CSS variables - scoped to .plugin-datasource
+ * All variables are prefixed with --te-datasource-* for consistency
+ */
.plugin-datasource {
  --te-datasource-toolbar-icon-color: var(--te-common-text-primary);
  // remaining variables...
}
packages/theme/base/src/component-common.less (1)

294-294: Triple Class Name Repetition in Dialog Selector
The outer selector now reads .tiny-dialog-box.tiny-dialog-box.tiny-dialog-box, which is an unusual repetition. Please confirm that this extra repetition is intentional (perhaps to boost specificity) and consistent with the project’s naming conventions.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9152de2 and 24cc4a3.

📒 Files selected for processing (28)
  • packages/common/component/PluginSetting.vue (1 hunks)
  • packages/plugins/block/src/Main.vue (2 hunks)
  • packages/plugins/block/src/styles/vars.less (2 hunks)
  • packages/plugins/bridge/src/BridgeManage.vue (1 hunks)
  • packages/plugins/bridge/src/Main.vue (1 hunks)
  • packages/plugins/bridge/src/styles/vars.less (1 hunks)
  • packages/plugins/datasource/src/DataSourceFieldList.vue (1 hunks)
  • packages/plugins/datasource/src/DataSourceList.vue (1 hunks)
  • packages/plugins/datasource/src/Main.vue (2 hunks)
  • packages/plugins/datasource/src/styles/vars.less (1 hunks)
  • packages/plugins/help/src/HelpIcon.vue (1 hunks)
  • packages/plugins/help/src/styles/vars.less (1 hunks)
  • packages/plugins/i18n/src/Main.vue (2 hunks)
  • packages/plugins/i18n/src/styles/vars.less (1 hunks)
  • packages/plugins/materials/src/styles/vars.less (1 hunks)
  • packages/plugins/page/src/Main.vue (1 hunks)
  • packages/plugins/page/src/styles/vars.less (1 hunks)
  • packages/plugins/schema/src/Main.vue (1 hunks)
  • packages/plugins/schema/src/styles/vars.less (1 hunks)
  • packages/plugins/script/src/Main.vue (1 hunks)
  • packages/plugins/script/src/styles/vars.less (1 hunks)
  • packages/plugins/state/src/Main.vue (1 hunks)
  • packages/plugins/state/src/styles/vars.less (1 hunks)
  • packages/plugins/tree/src/Main.vue (1 hunks)
  • packages/plugins/tree/src/styles/vars.less (1 hunks)
  • packages/plugins/tutorial/src/Main.vue (2 hunks)
  • packages/plugins/tutorial/src/styles/vars.less (1 hunks)
  • packages/theme/base/src/component-common.less (2 hunks)
✅ Files skipped from review due to trivial changes (17)
  • packages/plugins/datasource/src/DataSourceList.vue
  • packages/plugins/bridge/src/Main.vue
  • packages/plugins/page/src/styles/vars.less
  • packages/plugins/tree/src/Main.vue
  • packages/plugins/bridge/src/BridgeManage.vue
  • packages/plugins/datasource/src/DataSourceFieldList.vue
  • packages/plugins/script/src/Main.vue
  • packages/common/component/PluginSetting.vue
  • packages/plugins/tutorial/src/styles/vars.less
  • packages/plugins/schema/src/Main.vue
  • packages/plugins/script/src/styles/vars.less
  • packages/plugins/tutorial/src/Main.vue
  • packages/plugins/state/src/styles/vars.less
  • packages/plugins/tree/src/styles/vars.less
  • packages/plugins/i18n/src/Main.vue
  • packages/plugins/state/src/Main.vue
  • packages/plugins/page/src/Main.vue
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: push-check
🔇 Additional comments (13)
packages/plugins/bridge/src/styles/vars.less (1)

1-13: CSS Class Renaming Validation

The renaming from .bridge-manage to .plugin-bridge is correctly applied. All CSS custom properties remain unchanged, ensuring consistent styling. Just verify that all component files referencing this style (e.g., Main.vue and BridgeManage.vue) have been updated accordingly.

packages/plugins/i18n/src/styles/vars.less (1)

1-1: Class name standardization is a good practice

The class name has been updated from .plugin-panel-i18n to .plugin-i18n, following a more consistent naming convention across plugins. This change makes the selector more specific to the i18n plugin without the redundant "panel" term.

packages/plugins/help/src/styles/vars.less (1)

1-1: Improved selector from ID to class

Converting from #help-plugin (ID selector) to .plugin-help (class selector) is a good practice. Classes provide better reusability and maintainability compared to IDs, which should ideally be unique. This change also follows the standardized naming convention being applied across plugins.

packages/plugins/schema/src/styles/vars.less (1)

1-1: Better selector with standardized naming

Changed from #source-code (ID selector) to .plugin-schema (class selector), which improves the CSS structure in two ways:

  1. Using a class instead of ID enables better reusability
  2. The name now follows the consistent plugin-[name] pattern used across other plugins

This change aligns with the overall effort to standardize plugin naming conventions.

packages/plugins/help/src/HelpIcon.vue (1)

2-2: Properly added class while maintaining ID for backward compatibility

Good implementation that adds the new .plugin-help class while retaining the #help-plugin ID. This approach ensures backward compatibility while adopting the new class-based styling pattern. The element now correctly references the CSS selector defined in the vars.less file.

packages/plugins/datasource/src/Main.vue (2)

2-43: Appropriate class structure established for CSS scoping

The new wrapper div with the plugin-datasource class provides a container for the scoped CSS variables defined in vars.less. This structural change maintains component functionality while enabling more specific styling.


151-153: LGTM - consistent height styling

Setting height to 100% ensures the component fills its container, which is essential for proper layout and scroll behavior.

packages/plugins/block/src/Main.vue (2)

2-122: Appropriate wrapper div added for consistent plugin styling

The addition of the .plugin-block wrapper div matches the pattern applied to other plugins, creating a consistent structure across the codebase. This encapsulation is good for both styling and component organization.


455-458: Consistent dimension styling applied

Setting both width and height to 100% ensures the component properly fills its container, maintaining consistency with other plugin components.

packages/plugins/block/src/styles/vars.less (2)

1-37: Appropriate class renaming for plugin consistency

The change from .block-manage to .plugin-block aligns with the naming convention used in other plugins. This consistency makes the codebase more maintainable and easier to understand.


39-43:

✅ Verification successful

Good separation of popper-specific styles

Moving the popper-related variables to a dedicated class improves organization and follows the single responsibility principle for CSS. This separation makes styles more maintainable as the codebase grows.


🏁 Script executed:

#!/bin/bash
# Check if other plugins follow the same pattern for popper styling
rg -l "popper-wrapper" --type less

Length of output: 126


Separation of Popper-Specific Styles Confirmed and Consistent

The dedicated .block-category-option-popper-wrapper class in packages/plugins/block/src/styles/vars.less cleanly isolates popper-related variables, aligning with best practices for maintainable CSS. The verification shows a similar implementation in packages/plugins/materials/src/styles/vars.less, confirming consistency across plugins.

packages/plugins/materials/src/styles/vars.less (1)

43-47: Encapsulate CSS Variables in a Dedicated Class

The relocation of the variables
--te-materials-block-group-popper-title-text-color and
--te-materials-block-group-popper-content-text-color
into the new .block-option-popper-wrapper class enhances encapsulation and makes the styling scope more specific. Please ensure that all corresponding component templates are updated to reference this new class so that the applied styles remain consistent.

packages/theme/base/src/component-common.less (1)

304-308: Updated Close Button Styling in Dialog Component
The font size for the close button has been updated to var(--te-base-font-size-2) and its right offset changed to 8px. Verify that these adjustments align with the overall UI design standards and other component styles.

chilingling
chilingling previously approved these changes Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants