Skip to content

Conversation

@wuyiping0628
Copy link
Collaborator

@wuyiping0628 wuyiping0628 commented Mar 27, 2025

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)

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

  • Style
    • Updated component titles to use dynamic theming via CSS variables.
    • Removed fixed inline coloring from empty data messages for a more cohesive look.
    • Enhanced SVG icon colors and hover effects in operation columns.
    • Refreshed background colors and icon styling for grids, including expanded rows, checkboxes, and radio buttons.
    • Introduced new variables to standardize component theming across the application.

@wuyiping0628 wuyiping0628 added the enhancement New feature or request (功能增强) label Mar 27, 2025
@coderabbitai
Copy link

coderabbitai bot commented Mar 27, 2025

Walkthrough

This pull request updates the styling of various Vue and LESS files to improve theme flexibility. Hardcoded color values have been replaced with CSS variables, allowing dynamic theming across grid components. The changes affect title elements, empty data tips, SVG icons in operation columns, and background colors in validation components. Additionally, updates to theme LESS files introduce new styling rules for disabled states and define new CSS variables for expanded rows and input backgrounds.

Changes

File(s) Change Summary
examples/.../grid/edit/status-of-editing(.vue) Updated the .title class color from #444 to var(--tv-color-text-secondary, #191919) in both Composition API and regular Vue components.
examples/.../grid/empty/empty-data-tip(.vue) Removed inline styling (color: #ff8800) from <span> elements in the empty data tip templates.
examples/.../grid/operation-column/custom-operation-column(.vue) Modified SVG styling by replacing fill values to use var(--tv-color-icon) and adjusting hover state to var(--tv-color-icon-hover).
examples/.../grid/validation/bubbling(.vue) Changed the background color for .demo-body from #e5edbc to var(--tv-color-warn-bg-light, #ffebd1) in both Composition API and regular Vue components.
packages/theme/.../grid/(checkbox.less, radio.less, table.less, vars.less) Added and updated CSS rules: defined new rules for disabled state SVG paths; updated grid background and icon colors; and introduced a new variable --tv-Grid-expanded-row-bg-color along with an update to --tv-Grid-input-bg-color.

Possibly related PRs

Suggested reviewers

  • zzcr

Poem

I'm a little rabbit, hopping through the code,
Changing colors, brightening themes on every node.
CSS variables now lead the way,
In grids and views where styles will play.
With a hop and a skip, the UI's aglow—
Celebrate new hues, as our projects grow!
🐰✨

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.

 ERR_PNPM_FETCH_404  GET http://10.0.0.28:4873/@volar-plugins%2Fprettier: Not Found - 404

This error happened while installing a direct dependency of /tmp/eslint

@volar-plugins/prettier is not in the npm registry, or you have no permission to fetch it.

No authorization header was set for the request.


📜 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 9cba45f and 09bcbfd.

📒 Files selected for processing (1)
  • examples/sites/demos/pc/app/grid/validation/bubbling-composition-api.vue (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/sites/demos/pc/app/grid/validation/bubbling-composition-api.vue
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: PR E2E Test (pnpm test:e2e3)

🪧 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 plan to trigger planning for file edits and PR creation.
  • @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 bug Something isn't working label Mar 27, 2025
@petercat-assistant
Copy link

Walkthrough

This pull request updates the dark theme for the grid component in the Tiny Vue project. The changes primarily involve replacing hardcoded color values with CSS variables to enhance theme customization and consistency across the application.

Changes

Files Summary
examples/sites/demos/pc/app/grid/edit/status-of-editing-composition-api.vue, examples/sites/demos/pc/app/grid/edit/status-of-editing.vue Updated text color to use CSS variable --tv-color-text-secondary.
examples/sites/demos/pc/app/grid/empty/empty-data-tip-composition-api.vue, examples/sites/demos/pc/app/grid/empty/empty-data-tip.vue Removed hardcoded color from empty data tip text.
examples/sites/demos/pc/app/grid/operation-column/custom-operation-column-composition-api.vue, examples/sites/demos/pc/app/grid/operation-column/custom-operation-column.vue Changed SVG fill colors to use CSS variables --tv-color-icon and --tv-color-icon-hover.
examples/sites/demos/pc/app/grid/validation/bubbling-composition-api.vue, examples/sites/demos/pc/app/grid/validation/bubbling.vue Updated background color to use CSS variable --tv-color-warn-bg-light.
packages/theme/src/grid/checkbox.less, packages/theme/src/grid/radio.less Added path fill color using CSS variable --tv-Grid-icon-color-disabled.
packages/theme/src/grid/table.less Updated expanded row background color and added SVG fill color using CSS variables.
packages/theme/src/grid/vars.less Added new CSS variables for expanded row background color and updated input background color variable.

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1a05bd6 and 9cba45f.

📒 Files selected for processing (12)
  • examples/sites/demos/pc/app/grid/edit/status-of-editing-composition-api.vue (1 hunks)
  • examples/sites/demos/pc/app/grid/edit/status-of-editing.vue (1 hunks)
  • examples/sites/demos/pc/app/grid/empty/empty-data-tip-composition-api.vue (1 hunks)
  • examples/sites/demos/pc/app/grid/empty/empty-data-tip.vue (1 hunks)
  • examples/sites/demos/pc/app/grid/operation-column/custom-operation-column-composition-api.vue (1 hunks)
  • examples/sites/demos/pc/app/grid/operation-column/custom-operation-column.vue (1 hunks)
  • examples/sites/demos/pc/app/grid/validation/bubbling-composition-api.vue (1 hunks)
  • examples/sites/demos/pc/app/grid/validation/bubbling.vue (1 hunks)
  • packages/theme/src/grid/checkbox.less (1 hunks)
  • packages/theme/src/grid/radio.less (1 hunks)
  • packages/theme/src/grid/table.less (3 hunks)
  • packages/theme/src/grid/vars.less (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: PR E2E Test (pnpm test:e2e3)
🔇 Additional comments (16)
examples/sites/demos/pc/app/grid/empty/empty-data-tip.vue (1)

10-10: LGTM: Improved theme compatibility

Removing the inline styling from the empty data message allows it to inherit colors from the theme system, enhancing compatibility with both light and dark themes. This change aligns well with the PR objective to update the dark theme support.

examples/sites/demos/pc/app/grid/edit/status-of-editing.vue (1)

108-108: LGTM: Enhanced theming with CSS variables

Replacing the hardcoded color with the CSS variable --tv-color-text-secondary improves theme flexibility. The fallback value ensures backward compatibility while enabling proper dark theme support. This change effectively contributes to the PR's goal of updating the dark theme for grid components.

examples/sites/demos/pc/app/grid/validation/bubbling.vue (1)

115-115: LGTM: Better dark theme support for validation components

Replacing the hardcoded background color with --tv-color-warn-bg-light improves dark theme compatibility for validation bubbling. The fallback color ensures the component looks appropriate even if theme variables aren't available. This change is well-aligned with the PR's objective.

examples/sites/demos/pc/app/grid/empty/empty-data-tip-composition-api.vue (1)

10-10: LGTM: Consistent theming across API styles

This change maintains consistency with the Options API version by removing hardcoded styling. It ensures that empty data messages receive proper theme styling regardless of which Vue API style is used. The change properly contributes to the dark theme update for grid components.

examples/sites/demos/pc/app/grid/edit/status-of-editing-composition-api.vue (1)

99-99: Improved theming support for title elements

The change from a hardcoded color value to a CSS variable with fallback (var(--tv-color-text-secondary, #191919)) enhances the component's dark theme compatibility. This modification allows the title color to dynamically adjust based on the active theme while maintaining backward compatibility.

packages/theme/src/grid/radio.less (1)

106-108: Enhanced disabled state styling for radio buttons

This change improves the visual representation of disabled radio buttons by ensuring all SVG paths receive the appropriate disabled styling, not just the last child element. This creates a more consistent appearance in dark theme mode.

examples/sites/demos/pc/app/grid/operation-column/custom-operation-column-composition-api.vue (2)

83-83: Updated icon color to use theme variables

Replacing the hardcoded fill color with a CSS variable (var(--tv-color-icon)) enhances dark theme compatibility for SVG icons in the operation column.


86-86: Updated hover state to use theme variables

The hover state now uses a theme variable (var(--tv-color-icon-hover)) instead of a hardcoded color value, ensuring consistent styling with the dark theme.

examples/sites/demos/pc/app/grid/operation-column/custom-operation-column.vue (2)

92-92: Improved theming with CSS variables

Replacing the hard-coded variable var(--ti-common-color-line-active) with var(--tv-color-icon) provides better theme consistency across the grid component, especially for dark theme support.


95-95: Enhanced hover state with themeable variable

Replacing the hard-coded hex color #40a9ff with var(--tv-color-icon-hover) allows proper styling of icon hover states in different themes, including dark mode.

packages/theme/src/grid/checkbox.less (1)

113-115: Improved disabled state visualization

Adding specific styling for the SVG path elements in disabled checkboxes ensures proper visual representation in different themes. This properly applies the disabled state color to all parts of the checkbox icon.

packages/theme/src/grid/vars.less (2)

56-57: Added new variable for expanded row background

Adding a dedicated CSS variable for expanded row backgrounds improves theme flexibility. This separation from the generic gray background color allows for more precise theming control in various display modes.


204-204: Updated input background variable reference

Changing the input background color variable to reference var(--tv-color-bg-secondary) instead of var(--tv-color-bg-3) improves semantic clarity while maintaining the same fallback value. This promotes better theming organization.

packages/theme/src/grid/table.less (3)

33-33: Updated expanded row background to use new variable

Using the new dedicated variable var(--tv-Grid-expanded-row-bg-color) for expanded rows provides better theming flexibility and visual consistency, especially important for dark theme support.


486-488: Added consistent icon styling for header columns

Adding specific styling for SVG elements in header columns ensures visual consistency across the grid component. This change standardizes the icon color to match the design system.


840-844: Enhanced tree node icon styling with hover state

Updated the SVG fill color to use theme variables and added a hover state for better user interaction feedback. This improves visual consistency and user experience in both light and dark themes.

@zzcr zzcr merged commit 4c0e007 into opentiny:dev Mar 28, 2025
10 checks passed
@kagol kagol removed the enhancement New feature or request (功能增强) label Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants