Skip to content

fix(loading): [loading] fix loading new design review problem #1942

New issue

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

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

Already on GitHub? # to your account

Merged
merged 5 commits into from
Aug 21, 2024

Conversation

chenxi-20
Copy link
Collaborator

@chenxi-20 chenxi-20 commented Aug 19, 2024

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

  • New Features

    • Enhanced loading indicators with customizable size settings.
    • Added a new shadow variant of the loading icon for improved visual representation.
    • Introduced a new component for loading state, enhancing design consistency.
  • Bug Fixes

    • Updated loading text color and vertical margin properties for better visual alignment.
  • Style

    • Modified CSS variable references to ensure consistent color usage in loading animations.
  • Documentation

    • Clarified comments related to loading icon colors for better understanding.

@chenxi-20 chenxi-20 added the bug Something isn't working label Aug 19, 2024
Copy link

coderabbitai bot commented Aug 19, 2024

Important

Review skipped

Review was skipped due to path filters

Files ignored due to path filters (1)
  • packages/theme/src/svgs/loading-shadow.svg is excluded by !**/*.svg

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The recent updates enhance the loading components by introducing a new size parameter for the loading indicators, allowing for a customizable appearance. Additionally, CSS variable references have been refined for better alignment with visual design principles, streamlining the loading animation's colors and spacing. Overall, these changes aim to improve user experience through more visually prominent and consistent loading states.

Changes

File Path Change Summary
examples/sites/demos/pc/app/loading/... Added size: 'large' parameter to Loading.service calls in multiple loading components, enabling better customization of loading indicators.
packages/theme/src/loading/index.less Updated CSS variable references for SVG loading animation colors to ensure consistency with icon design, changing from --ti-loading-text-color to --ti-loading-icon-color.
packages/theme/src/loading/smb-theme.js Modified properties of tinyLoadingSmbTheme object, changing text color and vertical margin to improve visual presentation.
packages/theme/src/loading/vars.less Updated comments and added new CSS variable --ti-loading-icon-color, enhancing flexibility in loading icon styling while retaining the existing text color variable.
examples/sites/demos/pc/app/icon/iconGroups.js Introduced a new entry, 'IconLoadingShadow', to expand the available loading icons.
packages/vue/src/loading/src/pc.vue Replaced SVG loading graphic with <tiny-icon-loading-shadow> component, enhancing the visual representation of the loading state and improving design consistency.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Component
    participant LoadingService
    User->>Component: Trigger loading state
    Component->>LoadingService: Loading.service({ text, target, size: 'large' })
    LoadingService-->>Component: Show loading indicator
    Component->>User: Display loading state
Loading

🐇
In a world of loading spins,
Where patience often begins,
With sizes bold, we now delight,
Icons gleam, colors bright.
A hop, a skip, we cheer anew,
For loading joy, we thank you! 🌟


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

@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 21618ea and 3fa2933.

Files selected for processing (5)
  • examples/sites/demos/pc/app/loading/loading-tip-text-composition-api.vue (1 hunks)
  • examples/sites/demos/pc/app/loading/loading-tip-text.vue (1 hunks)
  • packages/theme/src/loading/index.less (1 hunks)
  • packages/theme/src/loading/smb-theme.js (1 hunks)
  • packages/theme/src/loading/vars.less (1 hunks)
Additional comments not posted (5)
examples/sites/demos/pc/app/loading/loading-tip-text.vue (1)

12-13: LGTM! Verify the size parameter usage.

The addition of the size parameter to the Loading.service method call is a good enhancement for customizing the loading indicator's size. Ensure that the Loading.service method supports this parameter throughout the codebase.

Verification successful

The size parameter is supported in Loading.service.

The size parameter is used in multiple instances across the codebase, confirming its support in the Loading.service method.

  • Files with size parameter usage:
    • examples/sites/demos/pc/app/loading/size.vue
    • examples/sites/demos/mobile/app/loading/size.vue
    • examples/sites/demos/pc/app/loading/loading-size.vue
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the `size` parameter usage in the `Loading.service` method.

# Test: Search for `Loading.service` method calls. Expect: Occurrences with the `size` parameter.
rg --type vue --type js --type ts -A 5 $'Loading.service'

Length of output: 84


Script:

#!/bin/bash
# Description: Verify the `size` parameter usage in the `Loading.service` method.

# Test: Search for `Loading.service` method calls across all files and filter by file extension.
rg 'Loading\.service' --glob '*.vue' --glob '*.js' --glob '*.ts' -A 5

Length of output: 22007

examples/sites/demos/pc/app/loading/loading-tip-text-composition-api.vue (1)

12-13: LGTM! Verify the size parameter usage.

The addition of the size parameter to the Loading.service method call is consistent with enhancing customization. Ensure that the Loading.service method supports this parameter throughout the codebase.

packages/theme/src/loading/smb-theme.js (1)

2-4: LGTM!

The updates to the ti-loading-text-color and ti-loading-text-margin-vertical properties enhance the visual presentation of loading elements, aligning with design principles.

packages/theme/src/loading/vars.less (1)

14-15: LGTM!

The introduction of the --ti-loading-icon-color variable and updated comments improve styling flexibility and clarity.

packages/theme/src/loading/index.less (1)

109-114: LGTM!

Updating the stroke and fill colors to use --ti-loading-icon-color ensures consistency with the intended design for icons, aligning with the overall theme.

@chenxi-20
Copy link
Collaborator Author

image

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


image

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3fa2933 and c7aa278.

Files ignored due to path filters (1)
  • packages/theme/src/svgs/loading-shadow.svg is excluded by !**/*.svg
Files selected for processing (2)
  • examples/sites/demos/pc/app/icon/iconGroups.js (1 hunks)
  • packages/vue/src/loading/src/pc.vue (2 hunks)
Additional comments not posted (3)
packages/vue/src/loading/src/pc.vue (2)

34-44: Proper import and registration of iconLoadingShadow.

The import and registration of iconLoadingShadow as TinyIconLoadingShadow is correctly implemented, supporting a modular design approach. Ensure the component is correctly integrated into the overall application.


22-23: Improved design consistency with <tiny-icon-loading-shadow>.

The introduction of <tiny-icon-loading-shadow> enhances the design consistency and reusability of the loading component. Ensure that the rendering logic aligns with the intended design specifications.

examples/sites/demos/pc/app/icon/iconGroups.js (1)

359-359: Addition of 'IconLoadingShadow' to iconGroups.

The addition of 'IconLoadingShadow' expands the available icons and enhances visual representation options. Verify its usage in the application to ensure it is correctly integrated.

Verification successful

'IconLoadingShadow' is correctly integrated into the application.

The iconLoadingShadow is defined, exported, and used in multiple components across the application, indicating proper integration. No further action is needed.

  • packages/vue/src/loading/src/pc.vue
  • examples/sites/demos/pc/app/loading/spinner-composition-api.vue
  • examples/sites/demos/pc/app/loading/spinner.vue
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `'IconLoadingShadow'` in the application.

# Test: Search for `'IconLoadingShadow'` usage. Expect: Occurrences in relevant files.
rg --type js 'IconLoadingShadow'

Length of output: 187


Script:

#!/bin/bash
# Check where `iconLoadingShadow` is defined and how it is used.
rg 'iconLoadingShadow' -A 5

Length of output: 2443

@chenxi-20 chenxi-20 added the enhancement New feature or request (功能增强) label Aug 19, 2024
@zzcr zzcr merged commit 61c012c into dev Aug 21, 2024
3 checks passed
@kagol kagol deleted the fix/loading-20240819 branch November 4, 2024 03:55
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working enhancement New feature or request (功能增强)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants