-
Notifications
You must be signed in to change notification settings - Fork 347
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: variable convergence(block, i18n, bridge, datasource, help, robot) #1078
Conversation
WalkthroughThis pull request updates the styling across multiple plugins and theme files by transitioning CSS variable names from the previous Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (41)
🚧 Files skipped from review as they are similar to previous changes (41)
⏰ Context from checks skipped due to timeout of 90000ms (1)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🧹 Nitpick comments (3)
packages/common/component/PluginBlockList.vue (1)
Line range hint
720-734
: Remove redundant hover state color.The setting menu now uses
--te-common-text-primary
for better visibility. However, the hover state at line 727 redundantly sets the same color, which is unnecessary..list-item { box-sizing: border-box; cursor: pointer; &:hover { - color: var(--te-common-text-primary); } .list-item-icon { font-size: 14px; color: var(--te-common-icon-secondary); } }
packages/plugins/bridge/src/styles/vars.less (1)
2-2
: Consider using English comments for better accessibility.Replace the Chinese comment "资源管理" with its English equivalent "Resource Management" to improve accessibility for international developers.
- // 资源管理 + // Resource Managementpackages/plugins/block/src/styles/vars.less (1)
1-41
: Consider improving variable organization and documentation.The variables are well-structured but could benefit from the following improvements:
- Group all panel-related variables together:
// Panel Header --te-block-panel-header-* // Panel Footer --te-block-panel-footer-* --te-block-panel-footer-btn-*
- Add more descriptive comments in English:
// Alert & Error Messages --te-block-alert-color // Used for general alerts --te-block-error-tip-color // Used for error messages // Panel Components --te-block-panel-header-* // Styling for panel headers --te-block-panel-footer-* // Styling for panel footers
- Consider adding usage examples in comments for complex variables.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (23)
packages/common/component/PluginBlockItemImg.vue
(1 hunks)packages/common/component/PluginBlockList.vue
(4 hunks)packages/plugins/block/index.js
(1 hunks)packages/plugins/block/src/BlockConfig.vue
(2 hunks)packages/plugins/block/src/BlockEvent.vue
(1 hunks)packages/plugins/block/src/BlockEventForm.vue
(1 hunks)packages/plugins/block/src/BlockEventList.vue
(2 hunks)packages/plugins/block/src/BlockGroupArrange.vue
(1 hunks)packages/plugins/block/src/BlockProperty.vue
(1 hunks)packages/plugins/block/src/BlockPropertyForm.vue
(2 hunks)packages/plugins/block/src/BlockPropertyList.vue
(0 hunks)packages/plugins/block/src/BlockSetting.vue
(1 hunks)packages/plugins/block/src/Main.vue
(5 hunks)packages/plugins/block/src/SaveNewBlock.vue
(1 hunks)packages/plugins/block/src/styles/vars.less
(1 hunks)packages/plugins/bridge/index.js
(1 hunks)packages/plugins/bridge/src/BridgeManage.vue
(3 hunks)packages/plugins/bridge/src/BridgeSetting.vue
(4 hunks)packages/plugins/bridge/src/styles/vars.less
(1 hunks)packages/plugins/help/index.js
(1 hunks)packages/plugins/help/src/HelpIcon.vue
(5 hunks)packages/plugins/help/src/styles/vars.less
(1 hunks)packages/theme/base/src/component-common.less
(1 hunks)
💤 Files with no reviewable changes (1)
- packages/plugins/block/src/BlockPropertyList.vue
✅ Files skipped from review due to trivial changes (18)
- packages/plugins/bridge/index.js
- packages/plugins/block/src/BlockEvent.vue
- packages/common/component/PluginBlockItemImg.vue
- packages/plugins/help/index.js
- packages/plugins/block/src/BlockSetting.vue
- packages/plugins/block/src/SaveNewBlock.vue
- packages/plugins/block/src/BlockProperty.vue
- packages/plugins/block/src/BlockEventForm.vue
- packages/plugins/block/index.js
- packages/plugins/block/src/BlockConfig.vue
- packages/plugins/help/src/HelpIcon.vue
- packages/plugins/block/src/BlockGroupArrange.vue
- packages/theme/base/src/component-common.less
- packages/plugins/bridge/src/BridgeSetting.vue
- packages/plugins/block/src/Main.vue
- packages/plugins/bridge/src/BridgeManage.vue
- packages/plugins/block/src/BlockPropertyForm.vue
- packages/plugins/help/src/styles/vars.less
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: push-check
🔇 Additional comments (6)
packages/common/component/PluginBlockList.vue (3)
359-372
: LGTM! Consistent use of new color variables.The changes properly implement the new
--te-common-*
variables for the block shortcut preview panel, maintaining the visual hierarchy with appropriate use of primary/secondary text colors.
514-514
: LGTM! Appropriate use of container background variable.The active state now uses the semantic
--te-common-bg-container
variable, which better represents its purpose.
701-703
: LGTM! Better readability with primary text color.Using
--te-common-text-primary
for the description text improves readability in the small list view.packages/plugins/bridge/src/styles/vars.less (1)
3-6
: Well-organized list-related variables with proper theme integration.Good job on organizing the list-related variables and maintaining theme consistency by properly referencing the common theme variables.
packages/plugins/block/src/BlockEventList.vue (1)
69-69
: LGTM! Variable naming follows the module-specific convention.The color variables have been properly converted to use module-specific variables, aligning with the PR's objective of variable convergence.
Let's verify that these variables are properly defined in the module's vars.less file:
Also applies to: 80-80, 84-84
✅ Verification successful
✓ Variables are properly defined and mapped to common theme variables
All three color variables are correctly defined in vars.less and appropriately mapped to their corresponding common theme variables.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the new variables are properly defined # Expected: All three variables should be defined in vars.less rg --type less "te-block-event-list-(color|btn-border-color|btn-icon-color)" packages/plugins/block/src/styles/Length of output: 452
packages/plugins/block/src/styles/vars.less (1)
2-40
: Verify the existence of referenced common variables.All variables reference
--te-common-*
variables. Let's verify these dependencies exist:✅ Verification successful
All referenced common variables are properly defined ✅
All
--te-common-*
variables referenced invars.less
are correctly defined in the base theme with both light and dark variants.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all referenced --te-common-* variables exist # Expected: All common variables should be defined # Extract all referenced common variables echo "Checking for referenced common variables:" rg --type less "var\(--te-common-[^)]+\)" packages/plugins/block/src/styles/vars.less -o | sort -u | sed 's/var(//;s/)//' > /tmp/referenced_vars.txt # Search for their definitions echo "Searching for variable definitions:" rg --type less "^[^/]*--te-common-" packages/ -lLength of output: 1885
Script:
#!/bin/bash # Get list of referenced common variables echo "Referenced common variables:" rg --type less "var\(--te-common-[^)]+\)" packages/plugins/block/src/styles/vars.less -o | sort -u | sed 's/var(//;s/)//' echo -e "\nSearching for variable definitions in theme files:" # Search for definitions in theme base files first as they're most likely to contain common vars for var in $(rg --type less "var\(--te-common-[^)]+\)" packages/plugins/block/src/styles/vars.less -o | sort -u | sed 's/var(//;s/)//') do echo "Checking $var:" rg --type less "^\s*${var}:" packages/theme/ doneLength of output: 8318
f17d03a
to
6b445b4
Compare
There was a problem hiding this 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 (13)
packages/theme/base/src/base.less (2)
245-245
: LGTM! The new box shadow variable follows the existing pattern.The new variable
--te-base-box-shadow-rgba-4
maintains consistency with the existing box shadow variables while providing a stronger opacity option (0.2) for more prominent shadow effects.However, consider adding a comment to document the intended use case for this specific opacity level, similar to how other sections have descriptive comments.
--te-base-box-shadow-rgba-3: rgba(0, 0, 0, 0.1); + // Used for stronger elevation effects --te-base-box-shadow-rgba-4: rgba(0, 0, 0, 0.2);
242-245
: Add a section comment for box shadow variables.For consistency with other sections in the file, consider adding a descriptive comment for the box shadow variables group.
+ /** + * 1.6 Box Shadows + * RGBA values for creating elevation effects + */ --te-base-box-shadow-rgba-1: rgba(25, 25, 25, 0.15); --te-base-box-shadow-rgba-2: rgba(0, 0, 0, 0.16); --te-base-box-shadow-rgba-3: rgba(0, 0, 0, 0.1); --te-base-box-shadow-rgba-4: rgba(0, 0, 0, 0.2);packages/plugins/datasource/src/DataSourceRecordList.vue (2)
608-608
: LGTM! Consistent module-specific variable naming.The color variable updates follow a consistent pattern of using module-specific prefixes (
--te-datasource-*
), which aligns with the PR objectives.Consider making some variable names more semantically specific:
- color: var(--te-datasource-common-primary-text-color); + color: var(--te-datasource-download-link-color);- color: var(--te-datasource-list-item-icon-color); + color: var(--te-datasource-action-icon-color);Also applies to: 620-620, 626-626, 638-638, 651-651, 655-656, 661-661, 669-669
Line range hint
472-484
: Consider adding loading states and consistent error handling.The component performs several async operations (save, fetch, validate) but doesn't show loading states or handle errors consistently. This might affect user experience during slow network conditions.
Consider:
- Adding loading states during async operations
- Implementing consistent error handling
- Showing appropriate error messages to users
Example implementation:
const saveRecordList = () => { + state.loading = true grid.value.validate((valid) => { if (!valid) { + state.loading = false return } const totalData = state.totalData // ... existing code ... saveRecordFormData(data) + .catch(error => { + useNotify({ + type: 'error', + message: '保存失败,请重试' + }) + }) + .finally(() => { + state.loading = false + }) }) }Also applies to: 507-517
packages/theme/base/src/common.less (5)
57-58
: LGTM! Consider translating comments to English for consistency.The scroll bar color variables are well-defined and follow the established naming convention. The color choices provide good visual contrast between default and hover states.
Consider translating the Chinese comments to English for better international collaboration:
- --te-common-bg-scroll: var(--te-base-gray-40); // 滚动条默认背景色#dbdbdb - --te-common-bg-scroll-hover: var(--te-base-gray-50); // 滚动条默认背景色#c2c2c2 + --te-common-bg-scroll: var(--te-base-gray-40); // Default scrollbar background color #dbdbdb + --te-common-bg-scroll-hover: var(--te-base-gray-50); // Scrollbar hover background color #c2c2c2
60-60
: LGTM! Consider translating the comment to English.The panel shadow variable is well-defined with an appropriate opacity value for subtle depth in light theme.
Consider translating the Chinese comment to English:
- --te-common-shadow-panel: var(--te-base-box-shadow-rgba-3); // 面板阴影 rgba(0, 0, 0, 0.1) + --te-common-shadow-panel: var(--te-base-box-shadow-rgba-3); // Panel shadow rgba(0, 0, 0, 0.1)
120-121
: LGTM! Consider translating comments to English for consistency.The dark theme scroll bar colors are well-chosen with appropriate contrast between states.
Consider translating the Chinese comments to English:
- --te-common-bg-scroll: var(--te-base-gray-110); // 滚动条默认背景色#262626 - --te-common-bg-scroll-hover: var(--te-base-gray-100); // 滚动条默认背景色#333333 + --te-common-bg-scroll: var(--te-base-gray-110); // Default scrollbar background color #262626 + --te-common-bg-scroll-hover: var(--te-base-gray-100); // Scrollbar hover background color #333333
123-123
: LGTM! Consider translating the comment to English.The dark theme panel shadow uses appropriate opacity for better visibility against dark backgrounds.
Consider translating the Chinese comment to English:
- --te-common-shadow-panel: var(--te-base-box-shadow-rgba-4); // 面板阴影 rgba(0, 0, 0, 0.2) + --te-common-shadow-panel: var(--te-base-box-shadow-rgba-4); // Panel shadow rgba(0, 0, 0, 0.2)
Line range hint
57-123
: Well-structured theme variable additions!The new scroll bar and panel shadow variables are:
- Consistently named following the
--te-common-*
pattern- Well-organized within light and dark theme sections
- Using appropriate base tokens for colors and shadows
- Providing good visual feedback through state changes
These changes align well with the PR's objective of improving module variable management.
Consider documenting these new variables in the theme documentation to help other developers understand their intended usage and the reasoning behind the chosen values.
packages/plugins/datasource/src/styles/vars.less (2)
1-37
: Review variable naming patterns and potential optimizationsThe variable definitions look good overall, but there are some opportunities for improvement:
Inconsistent prefix patterns:
- Some use
common-
prefix:--te-datasource-common-border-primary-color
- Others are direct:
--te-datasource-border-color
Potential redundancies:
--te-datasource-border-color
and--te-datasource-common-border-color
both map to border variables--te-datasource-color
seems too generic and could be more specificConsider:
- Standardizing the naming pattern by removing the
common-
prefix where it doesn't add semantic value- Making generic variable names more specific to their usage
- Consolidating similar variables to reduce redundancy
Example consolidation:
- --te-datasource-border-color: var(--te-common-border-default); - --te-datasource-common-border-color: var(--te-common-border-divider); + --te-datasource-border-default: var(--te-common-border-default); + --te-datasource-border-divider: var(--te-common-border-divider);
15-17
: Consider semantic clarity in color variable namesThe following variables could benefit from more descriptive names:
--te-datasource-common-text-color-5
is not semantically clear--te-datasource-common-hover-bg-1
suggests there might be more numbered backgroundsConsider renaming to reflect their purpose:
- --te-datasource-common-text-color-5: var(--te-common-text-weaken); - --te-datasource-common-hover-bg-1: var(--te-common-bg-container); + --te-datasource-text-weaken: var(--te-common-text-weaken); + --te-datasource-hover-bg-container: var(--te-common-bg-container);packages/plugins/i18n/src/styles/vars.less (1)
1-17
: LGTM! Well-structured variable system with clear semantic mapping.The CSS custom properties follow a consistent naming pattern and maintain a clear separation of concerns. They appropriately reference common variables, ensuring design consistency.
Consider adding English comments for better international collaboration.
The Chinese comments are clear, but adding English translations would improve collaboration with non-Chinese speaking developers.
:root { - // 国际化表格加载中字体颜色 + // Loading text color for i18n table (国际化表格加载中字体颜色) --te-i18n-loading-text-color: var(--te-common-text-weaken); - // 国际化表格加载中图标颜色 + // Loading icon color for i18n table (国际化表格加载中图标颜色) --te-i18n-loading-svg-color: var(--te-common-icon-primary); // ... similar changes for other comments }packages/plugins/i18n/src/Main.vue (1)
521-526
: Consider consolidating duplicate color declarations.The download button color is declared twice with the same variable.
.download-btn { cursor: pointer; color: var(--te-i18n-button-color); svg { font-size: 16px; } .tiny-button.tiny-button--text { - color: var(--te-i18n-button-color); + color: inherit; } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (30)
packages/plugins/datasource/index.js
(1 hunks)packages/plugins/datasource/src/DataSourceField.vue
(5 hunks)packages/plugins/datasource/src/DataSourceFieldCheck.vue
(1 hunks)packages/plugins/datasource/src/DataSourceFieldCheckMultipleLine.vue
(1 hunks)packages/plugins/datasource/src/DataSourceFieldCheckRanger.vue
(2 hunks)packages/plugins/datasource/src/DataSourceFieldForm.vue
(4 hunks)packages/plugins/datasource/src/DataSourceFieldList.vue
(2 hunks)packages/plugins/datasource/src/DataSourceFieldType.vue
(4 hunks)packages/plugins/datasource/src/DataSourceForm.vue
(1 hunks)packages/plugins/datasource/src/DataSourceList.vue
(2 hunks)packages/plugins/datasource/src/DataSourceRecordForm.vue
(1 hunks)packages/plugins/datasource/src/DataSourceRecordList.vue
(5 hunks)packages/plugins/datasource/src/DataSourceRecordUpload.vue
(1 hunks)packages/plugins/datasource/src/DataSourceRemoteAutoload.vue
(1 hunks)packages/plugins/datasource/src/DataSourceRemoteDataAdapter.vue
(1 hunks)packages/plugins/datasource/src/DataSourceRemoteDataResult.vue
(3 hunks)packages/plugins/datasource/src/DataSourceRemoteForm.vue
(2 hunks)packages/plugins/datasource/src/DataSourceRemoteMapping.vue
(2 hunks)packages/plugins/datasource/src/DataSourceRemotePanel.vue
(2 hunks)packages/plugins/datasource/src/DataSourceRemoteParameter.vue
(1 hunks)packages/plugins/datasource/src/DataSourceTemplate.vue
(3 hunks)packages/plugins/datasource/src/DataSourceType.vue
(3 hunks)packages/plugins/datasource/src/RemoteDataAdapterForm.vue
(1 hunks)packages/plugins/datasource/src/styles/vars.less
(1 hunks)packages/plugins/i18n/index.js
(1 hunks)packages/plugins/i18n/src/Main.vue
(8 hunks)packages/plugins/i18n/src/styles/vars.less
(1 hunks)packages/theme/base/src/base.less
(1 hunks)packages/theme/base/src/common.less
(2 hunks)packages/theme/base/src/component-common.less
(2 hunks)
✅ Files skipped from review due to trivial changes (22)
- packages/plugins/datasource/index.js
- packages/plugins/i18n/index.js
- packages/plugins/datasource/src/DataSourceFieldCheck.vue
- packages/plugins/datasource/src/DataSourceFieldCheckMultipleLine.vue
- packages/plugins/datasource/src/DataSourceForm.vue
- packages/plugins/datasource/src/DataSourceFieldCheckRanger.vue
- packages/plugins/datasource/src/DataSourceRemoteMapping.vue
- packages/plugins/datasource/src/DataSourceRemoteDataAdapter.vue
- packages/plugins/datasource/src/DataSourceFieldForm.vue
- packages/plugins/datasource/src/DataSourceRemoteAutoload.vue
- packages/plugins/datasource/src/DataSourceRemoteParameter.vue
- packages/plugins/datasource/src/DataSourceField.vue
- packages/plugins/datasource/src/DataSourceRecordUpload.vue
- packages/plugins/datasource/src/DataSourceList.vue
- packages/plugins/datasource/src/DataSourceRemoteForm.vue
- packages/plugins/datasource/src/DataSourceRemotePanel.vue
- packages/plugins/datasource/src/RemoteDataAdapterForm.vue
- packages/plugins/datasource/src/DataSourceFieldList.vue
- packages/plugins/datasource/src/DataSourceRecordForm.vue
- packages/plugins/datasource/src/DataSourceTemplate.vue
- packages/plugins/datasource/src/DataSourceFieldType.vue
- packages/plugins/datasource/src/DataSourceType.vue
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/theme/base/src/component-common.less
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: push-check
🔇 Additional comments (13)
packages/theme/base/src/base.less (1)
Line range hint
1-324
: The naming convention aligns with the PR objectives.The file consistently uses the
--te-base-*
prefix for all variables, which aligns with the PR's goal of transitioning from--ti-*
and--te-common-*
to--te-*
variables.packages/plugins/datasource/src/DataSourceRecordList.vue (1)
310-310
: LGTM! Color variable update aligns with module-specific naming convention.The change from a generic color variable to a module-specific one (
--te-datasource-modal-text-color
) improves the organization of styling variables.packages/plugins/datasource/src/DataSourceRemoteDataResult.vue (4)
96-96
: LGTM: Appropriate semantic mapping for tip text colorThe change from
--te-common-text-weaken
to--te-datasource-common-tip-color
aligns with the PR objective of converting common variables to module-specific ones while maintaining semantic meaning.
99-101
: LGTM: Consistent variable naming for toolbar elementsThe changes properly map toolbar-related styles to datasource-specific variables:
- Breadcrumb color:
--te-datasource-toolbar-breadcrumb-color
- Tab borders:
--te-datasource-tabs-border-color
118-118
: LGTM: Appropriate button styling variableThe change to
--te-datasource-common-btn-border-color
maintains consistent button styling while properly scoping it to the datasource module.
128-128
: LGTM: Consistent border stylingThe change from
--te-common-border-divider
to--te-datasource-common-border-color
appropriately scopes the border styling to the datasource module.packages/plugins/datasource/src/styles/vars.less (1)
2-11
: Verify color contrast accessibilitySeveral text colors are defined using secondary and weaken variants. Ensure these maintain sufficient contrast ratios for accessibility.
✅ Verification successful
Color contrast ratios meet accessibility standards
The color system uses carefully selected combinations that meet or exceed WCAG guidelines:
- Light theme: Secondary text (#595959) maintains AA-level contrast on light backgrounds
- Dark theme: Secondary text (#B3B3B3) maintains AA-level contrast on dark backgrounds
- Primary text colors in both themes exceed AAA-level requirements
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for color contrast related tests or documentation rg -i "contrast|a11y|accessibility" --type mdLength of output: 47
Script:
#!/bin/bash # Search for common theme variable definitions rg -l "te-common-text|te-common-border|te-common-color" --type css --type less # Also check for any theme-related files fd -e less -e css "theme|color|style" -d 3Length of output: 1683
Script:
#!/bin/bash # Check base theme and theme-specific color definitions echo "=== Base Theme Common Variables ===" cat packages/theme/base/src/common.less echo -e "\n=== Dark Theme Variables ===" cat packages/theme/dark/variable.less echo -e "\n=== Light Theme Variables ===" cat packages/theme/light/variable.lessLength of output: 24587
packages/plugins/i18n/src/Main.vue (6)
437-437
: LGTM! Appropriate use of shadow variable.The panel shadow correctly uses the new
--te-i18n-panel-shadow-color
variable.
456-460
: LGTM! Consistent loading state styling.Loading states appropriately use the new loading-specific variables for both SVG and text colors.
Line range hint
486-495
: LGTM! Well-structured button styling.Button and icon colors correctly use their respective variables, maintaining visual hierarchy.
538-544
: LGTM! Consistent table styling.Border and scrollbar colors appropriately use the new grid-specific variables.
563-563
: LGTM! Proper grid operation icon styling.Grid operation icons correctly use the designated variable for consistent styling.
511-511
: Verify loading spinner color contrast.The loading spinner uses
--te-i18n-common-tip-text-color
. Please ensure this provides sufficient contrast for accessibility.✅ Verification successful
Loading spinner color follows design system's accessible color scheme
The spinner uses the design system's secondary text color (
--te-common-text-secondary
), which is specifically designed for UI elements requiring good contrast. It adapts appropriately for both light (#595959) and dark (#B3B3B3) themes, ensuring sufficient contrast in all contexts.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for other uses of loading spinners to compare color contrast implementation rg -l "stroke.*var\(--te.*\)" --type lessLength of output: 43
Script:
#!/bin/bash # Search for the specific color variable definition and usage rg --type-add 'styles:*.{css,less,scss,vue}' -t styles "te-i18n-common-tip-text-color" # Search for loading spinner related code and styles rg --type-add 'styles:*.{css,less,scss,vue}' -t styles "loading.*spinner|spinner.*loading" # Look for theme or accessibility configuration files fd -e js -e ts -e json "theme|color|accessibility|a11y"Length of output: 2419
Script:
#!/bin/bash # Search for the base text color variable rg --type-add 'styles:*.{css,less,scss,vue}' -t styles "te-common-text-secondary" # Look for any theme configuration files specifically fd "theme" -e lessLength of output: 17736
There was a problem hiding this 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)
packages/plugins/robot/src/styles/vars.less (1)
32-35
: Input Field Styling: Clarify Comment for BorderThe input field background (
--te-chat-model-input-bg
) and border (--te-chat-model-input-border
) variables are correctly defined. However, the comment on line 34 mistakenly repeats “输入框背景” instead of indicating that it styles the border. For improved clarity, consider updating the comment as follows:- // chatGPT聊天窗输入框背景 + // chatGPT聊天窗输入框边框
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/plugins/robot/index.js
(1 hunks)packages/plugins/robot/src/Main.vue
(12 hunks)packages/plugins/robot/src/styles/vars.less
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- packages/plugins/robot/index.js
- packages/plugins/robot/src/Main.vue
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: push-check
🔇 Additional comments (12)
packages/plugins/robot/src/styles/vars.less (12)
1-2
: Global Variables Declaration: Proper Use of:root
SelectorThe use of the
:root
selector to encapsulate global CSS variables is appropriate and aligns with best practices for theming and variable management.
2-9
: Text and Icon Color VariablesThe variables for text color (
--te-chat-model-text
), icon color (--te-chat-model-icon
), text border (--te-chat-model-text-border
), and avatar border (--te-chat-model-avatar-border
) are defined clearly with consistent naming conventions.
10-15
: AI Chat Styling VariablesThe definitions for AI chat background (
--te-chat-model-ai-text-bg
), border (--te-chat-model-ai-text-border
), and text color (--te-chat-model-ai-text
) are well structured and clearly commented.
16-21
: AI Failure State Styling VariablesThe variables for styling scenarios where the AI connection fails—namely, background (
--te-chat-model-ai-fail-text-bg
), border (--te-chat-model-ai-fail-text-border
), and text color (--te-chat-model-ai-fail-text
)—are appropriately defined, ensuring consistent feedback in error states.
22-27
: User Chat Styling VariablesThe user-specific chat styling variables (
--te-chat-model-user-text-bg
,--te-chat-model-user-text-border
, and--te-chat-model-user-text
) maintain a consistent design language with the rest of the theme.
28-31
: Title and Common Icon StylingThe chat window title (
--te-chat-model-title
) and the basic icon (--te-chat-model-common-icon
) are declared clearly. Their definitions support a cohesive visual identity for the interface.
36-43
: Chat Send Button StylingThe declarations for the send button’s background gradients (
--te-chat-model-button-bg-1
,--te-chat-model-button-bg-2
,--te-chat-model-button-bg-3
), border (--te-chat-model-button-border
), and text color (--te-chat-model-button-text
) are clearly defined and follow a logical structure.
44-47
: Background Gradient VariablesThe top, middle, and bottom background colors (
--te-chat-bg-top-color
,--te-chat-bg-mid-color
,--te-chat-bg-bottom-color
) are appropriately specified to create smooth background gradients.
48-55
: Chat Window and Tips VariablesVariables covering the chat window background (
--te-chat-model-bg
), helper text (--te-chat-model-helper-text
), and tip styling (--te-chat-model-tips-text
,--te-chat-model-tips-bg
) are well organized and enhance the visual consistency of the interface.
56-60
: Loading Indicator StylingThe properties for the loading indicator (
--te-chat-loading-svg-color
and--te-chat-loading-text-color
) are defined with clear, contrasting colors to ensure visibility during load events.
61-65
: Popover Styling VariablesThe set of popover-related variables (
--te-chat-model-popover-bg
,--te-chat-model-popover-color
,--te-chat-model-popover-active-bg
,--te-chat-model-popover-active-color
) is consistent and well-integrated within the overall theming strategy.
66-67
: Closing the:root
BlockThe closing brace appropriately terminates the CSS variable declarations without any issues.
There was a problem hiding this 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 (2)
packages/plugins/bridge/src/styles/vars.less (1)
1-2
: Translate Chinese comment to English.For better international collaboration, consider translating the Chinese comment "资源管理" to English, e.g., "Resource Management".
.bridge-manage { - // 资源管理 + // Resource Managementpackages/plugins/datasource/src/styles/vars.less (1)
2-2
: Consider grouping similar variables.Several variables reference
--te-common-text-primary
:
--te-datasource-toolbar-icon-color
--te-datasource-toolbar-breadcrumb-color
--te-datasource-common-primary-text-color
--te-datasource-modal-text-color
--te-datasource-color
--te-datasource-list-item-text-color
Consider creating an intermediate variable for commonly used values to improve maintainability.
.datasource { + --te-datasource-text-primary: var(--te-common-text-primary); - --te-datasource-toolbar-icon-color: var(--te-common-text-primary); + --te-datasource-toolbar-icon-color: var(--te-datasource-text-primary); // ... other variables ... - --te-datasource-toolbar-breadcrumb-color: var(--te-common-text-primary); + --te-datasource-toolbar-breadcrumb-color: var(--te-datasource-text-primary); // ... continue updating other variables to use the intermediate variable }Also applies to: 4-4, 19-19, 26-26, 29-29, 32-32
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
packages/plugins/block/src/BlockPropertyForm.vue
(3 hunks)packages/plugins/block/src/styles/vars.less
(1 hunks)packages/plugins/bridge/src/Main.vue
(1 hunks)packages/plugins/bridge/src/styles/vars.less
(1 hunks)packages/plugins/datasource/src/DataSourceRecordList.vue
(5 hunks)packages/plugins/datasource/src/Main.vue
(1 hunks)packages/plugins/datasource/src/styles/vars.less
(1 hunks)packages/plugins/help/src/styles/vars.less
(1 hunks)packages/plugins/i18n/src/styles/vars.less
(1 hunks)packages/plugins/robot/src/Main.vue
(12 hunks)packages/plugins/robot/src/styles/vars.less
(1 hunks)packages/theme/base/src/component-common.less
(3 hunks)
✅ Files skipped from review due to trivial changes (2)
- packages/plugins/datasource/src/Main.vue
- packages/plugins/bridge/src/Main.vue
🚧 Files skipped from review as they are similar to previous changes (8)
- packages/plugins/robot/src/Main.vue
- packages/theme/base/src/component-common.less
- packages/plugins/block/src/BlockPropertyForm.vue
- packages/plugins/help/src/styles/vars.less
- packages/plugins/datasource/src/DataSourceRecordList.vue
- packages/plugins/i18n/src/styles/vars.less
- packages/plugins/robot/src/styles/vars.less
- packages/plugins/block/src/styles/vars.less
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: push-check
🔇 Additional comments (4)
packages/plugins/bridge/src/styles/vars.less (2)
3-6
: LGTM! Well-structured list-related variables.The variables follow consistent naming patterns and properly reference common variables, aligning with the PR's objective of converting color values to module variables.
7-12
: LGTM! Well-structured editor and setting variables.The variables follow consistent naming patterns and properly reference common variables. The previous typo in the prefix has been correctly fixed.
packages/plugins/datasource/src/styles/vars.less (2)
1-37
: Well-structured variable organization and naming!The variables are well-organized with:
- Clear scoping under
.datasource
class- Consistent
--te-datasource-
prefix- Semantic naming that reflects each variable's purpose
1-37
: Implementation aligns perfectly with PR objectives!The changes successfully:
- Convert all color values to module variables
- Properly scope variables under the datasource module
- Reference common variables correctly without direct usage
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
主要修改:国际化,区块管理,资源管理,数据源,帮助与指引,AI对话框
AI对话框亮暗色保持一致,less文件中使用的是色值
a.检查每个模块插件包,用到的色值全都改成模块变量
b.检查模块变量有没有被非该模块的vue文件使用,修改非该模块的vue文件使用的变量
c.将模块变量回归到各个模块里面
d.模块变量回归模块后,再排查一遍该模块有没有直接使用--te-common的,有的话,需要转成模块变量。去保证整个链路是这样的: base/common less -> module less -> vue文件
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Style
Chore