Skip to content

Conversation

discreted66
Copy link
Collaborator

@discreted66 discreted66 commented Apr 1, 2025

PR

fix:用例修复以及图标修改

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 checkbox visuals with a white indicator and enhanced label spacing.
    • Adjusted timeline item styling with a darker number color.
    • Modified dropdown icons to display without a hover fill.
    • Refined steps component by adjusting text line heights and background colors.
    • Revised tab close icon styling for a squarer shape and updated hover background behavior.
    • Updated checkbox disabled state color for better visual representation.
    • Removed unused grid background color variables to streamline styles.

Copy link

coderabbitai bot commented Apr 1, 2025

Walkthrough

This update refines test locators and expected CSS properties in demo test files and adjusts styles in various theme components. The changes include updating the checkbox and timeline test assertions, modifying padding, color fills, line heights, border radii, and CSS variable references across checkbox, dropdown, steps, and tabs styles. No public API changes were made.

Changes

Files Change Summary
examples/.../checkbox/basic-usage.spec.ts
examples/.../time-line/status.spec.ts
Updated test locators and expected CSS values:
- Checkbox test now locates the element directly and expects an inner SVG fill color (remains rgb(20, 118, 255)).
- Timeline test now expects the .number element color change (from rgb(128, 128, 128) to rgb(25, 25, 25)).
packages/theme/src/checkbox/index.less Added padding-top: 3px; to .checkbox-prefix-cls__label and adjusted indentation for the &__input selector.
packages/theme/src/dropdown-item/index.less Changed SVG fill color on hover/focus from var(--tv-DropdownItem-icon-color-hover) to transparent.
packages/theme/src/steps/index.less Removed line-height: 1.5 from .title, added line-height: 18px to .node-description, and removed the background-color from .icon in the timeline section.
packages/theme/src/tabs/index.less
packages/theme/src/tabs/vars.less
Modified the .tabs-prefix-cls__icon-close border-radius from 50% to 4px and updated the CSS variable --tv-Tabs-icon-close-hover-bg-color to reference var(--tv-color-bg-hover, #f0f0f0).
packages/theme/src/grid/checkbox.less Updated fill color for .icon-check in the disabled state from var(--tv-Grid-bg-color-disable) to var(--tv-Grid-bg-color-disabled).
packages/theme/src/grid/vars.less Removed CSS variables: --tv-Grid-bg-color-active and --tv-Grid-bg-color-disabled.

Possibly related PRs

  • feat(checkbox): [checkbox] Component dark theme adaptation #3007: The changes in the main PR are related to the modifications in the checkbox component's SVG element assertions, which align with the styling updates made in the retrieved PR for the checkbox component.
  • fix(grid): [grid] add dark theme #3040: The changes in the main PR focus on simplifying the checkbox element's locator in a test file, while the retrieved PR modifies the styling of the checkbox component in the grid, specifically related to its visual representation based on checked states.

Suggested labels

e2e-test

Suggested reviewers

  • zzcr

Poem

I'm a rabbit with a digital hop,
Celebrating code changes that make styles pop.
Tests refined and designs anew,
Each line of code a fresh spring dew.
With leaps of joy, I cheer this day—
Hoppin' into changes, hip-hip-hooray!

Warning

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

🔧 ESLint

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

examples/sites/demos/pc/app/checkbox/basic-usage.spec.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

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

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

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

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

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

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

examples/sites/demos/pc/app/time-line/status.spec.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

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

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

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

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

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

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


📜 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 a35d75b and 42b14f0.

⛔ Files ignored due to path filters (1)
  • packages/theme/src/svgs/checked-sur.svg is excluded by !**/*.svg
📒 Files selected for processing (9)
  • examples/sites/demos/pc/app/checkbox/basic-usage.spec.ts (1 hunks)
  • examples/sites/demos/pc/app/time-line/status.spec.ts (1 hunks)
  • packages/theme/src/checkbox/index.less (2 hunks)
  • packages/theme/src/dropdown-item/index.less (1 hunks)
  • packages/theme/src/grid/checkbox.less (1 hunks)
  • packages/theme/src/grid/vars.less (0 hunks)
  • packages/theme/src/steps/index.less (1 hunks)
  • packages/theme/src/tabs/index.less (1 hunks)
  • packages/theme/src/tabs/vars.less (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/theme/src/grid/vars.less
🚧 Files skipped from review as they are similar to previous changes (8)
  • packages/theme/src/grid/checkbox.less
  • packages/theme/src/dropdown-item/index.less
  • packages/theme/src/tabs/index.less
  • examples/sites/demos/pc/app/time-line/status.spec.ts
  • packages/theme/src/checkbox/index.less
  • examples/sites/demos/pc/app/checkbox/basic-usage.spec.ts
  • packages/theme/src/tabs/vars.less
  • packages/theme/src/steps/index.less

🪧 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 Apr 1, 2025
Copy link

Walkthrough

This PR addresses E2E test fixes and icon modifications for components such as checkbox, time-line, and steps. It includes changes in CSS properties, SVG modifications, and adjustments to test cases to ensure correct visual and functional behavior.

Changes

Files Summary
basic-usage.spec.ts, vertical-checkbox.spec.ts, status.spec.ts Updated test cases for checkbox and time-line components to reflect new CSS changes and ensure correct functionality.
index.less (checkbox, dropdown-item, steps, tabs) Modified CSS properties such as padding, display, fill color, and border-radius to improve visual consistency and fix issues.
checked-sur.svg Adjusted SVG content to align with new design requirements.
vars.less (tabs) Updated variable values to reflect new hover background color for tab icons.

await expect(checkbox).toHaveClass(/is-checked/)
await expect(checkbox.locator('.tiny-checkbox__inner svg path').first()).toHaveCSS('fill', 'rgb(20, 118, 255)')
await expect(checkbox.locator('.tiny-checkbox__inner svg path').first()).toHaveCSS('fill', 'rgb(255, 255, 255)')

Choose a reason for hiding this comment

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

The change in expected CSS fill color from 'rgb(20, 118, 255)' to 'rgb(255, 255, 255)' should be verified to ensure it aligns with the intended design specifications, as it may affect the visual appearance of the checkbox.

@@ -19,7 +19,7 @@ test('垂直布局', async ({ page }) => {
await checkedLabelSZ.click()
await expect(checkedLabelSZ).toHaveClass(/is-checked/)
const parentWrapper = page.getByLabel('checkbox-group').first()
await expect(parentWrapper).toHaveCSS('display', 'inline-block')
await expect(parentWrapper).toHaveCSS('display', 'flex')

Choose a reason for hiding this comment

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

Changing the display property from 'inline-block' to 'flex' can significantly alter the layout. Ensure that this change is intentional and does not disrupt the intended design.

@@ -11,7 +11,7 @@ test.describe('节点状态', () => {
// 默认状态
await expect(timelineItems.first()).toHaveClass(/process-wait/)
await expect(timelineItems.first().locator('.icon')).toHaveCSS('border-color', 'rgb(219, 219, 219)')
await expect(timelineItems.first().locator('.icon .number')).toHaveCSS('color', 'rgb(128, 128, 128)')
await expect(timelineItems.first().locator('.icon .number')).toHaveCSS('color', 'rgb(25, 25, 25)')

Choose a reason for hiding this comment

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

The change in expected CSS color from 'rgb(128, 128, 128)' to 'rgb(25, 25, 25)' should be verified to ensure it aligns with the intended design specifications, as it may affect the visual appearance of the timeline item.

@discreted66 discreted66 changed the title fix:[checkbox,time-line,steps] fix E2E and icon modification fix:[checkbox,time-line,steps] fix e2e test and icon modification Apr 1, 2025
@discreted66 discreted66 force-pushed the darkTheme11 branch 3 times, most recently from a35d75b to 42b14f0 Compare April 1, 2025 09:10
@zzcr zzcr merged commit 9f49aa1 into opentiny:dev Apr 1, 2025
10 checks passed
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.

2 participants