Skip to content

fix(dialog-box): dialog pop-up mask layer animation is not working (#… #3637

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

gausszhou
Copy link

@gausszhou gausszhou commented Aug 7, 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: #3636

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Possible problems

  1. Could it cause moalAppendToBody to invalidate? tiny-dialog-box__wrapper does not change with v-modal's position
  2. Untested scenarios on mobile

Summary by CodeRabbit

  • New Features

    • Enhanced dialog animations with new fade and enlarge effects for smoother transitions.
    • Dialog background now displays a semi-transparent overlay when enabled.
  • Style

    • Improved consistency in animation durations for dialog transitions.

Copy link

coderabbitai bot commented Aug 7, 2025

Walkthrough

The changes update dialog box styling and behavior by introducing new conditional animations and modal background effects in the LESS stylesheet, and adjusting the Vue component to apply a has-modal class when the modal prop is set. No logic or event handling was altered beyond class binding.

Changes

Cohort / File(s) Change Summary
Dialog Box Styling & Animation
packages/theme/src/dialog-box/index.less
Removed background from .v-modal; added new conditional animations and keyframes for dialog transitions; introduced .has-modal class for modal overlays.
Dialog Box Component Class Binding
packages/vue/src/dialog-box/src/pc.vue
Updated class binding on dialog wrapper to conditionally include has-modal based on the modal prop.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DialogComponent
    participant DialogStyles

    User->>DialogComponent: Open dialog (modal = true/false)
    DialogComponent->>DialogStyles: Apply class 'tiny-dialog-box__wrapper'
    alt modal = true
        DialogComponent->>DialogStyles: Add class 'has-modal'
        DialogStyles->>DialogComponent: Apply modal background and animations
    else modal = false
        DialogComponent->>DialogStyles: Do not add 'has-modal'
        DialogStyles->>DialogComponent: No modal background
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

In the warren of code where the dialogs reside,
New shadows and fades now elegantly glide.
With a hop and a bound, the modal appears—
Wrapped in fresh styles as the old one clears.
A rabbit applauds with a wiggle and wink,
For smooth, subtle changes that vanish in a blink!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 d3e0d35 and c85f883.

📒 Files selected for processing (2)
  • packages/theme/src/dialog-box/index.less (4 hunks)
  • packages/vue/src/dialog-box/src/pc.vue (1 hunks)
🔇 Additional comments (10)
packages/theme/src/dialog-box/index.less (9)

232-234: LGTM! Modal fade-in animation added for slide-right transition.

The nested animation rule correctly synchronizes the modal background fade-in with the slide-right dialog entrance animation, addressing the missing mask layer animation issue.


239-241: LGTM! Modal fade-out animation added for slide-right transition.

The exit animation properly complements the entrance animation, ensuring smooth modal background transitions during slide-right dialog closure.


278-280: LGTM! Modal background overlay styling added.

The semi-transparent background provides the expected modal overlay effect. The class name is descriptive and the opacity level is appropriate for modal dialogs.


284-286: LGTM! Modal animation integrated with dialog fade transition.

The modal fade-in animation duration correctly matches the dialog fade animation timing for proper synchronization.


294-296: LGTM! Modal fade-out animation completes the fade transition cycle.

The exit animation properly synchronizes with the dialog fade-out timing, ensuring consistent modal background behavior.


299-315: LGTM! Modal fade keyframes properly defined.

The keyframe animations are well-structured with simple opacity transitions, providing the essential fade behavior for modal backgrounds without unnecessary complexity.


342-346: LGTM! Enlarge animation enhanced with modal fade and consistent timing.

The modal animation addition ensures the enlarge transition includes proper background behavior, and the timing unit consistency improves maintainability.


348-353: LGTM! Enlarge leave animation completes the transition cycle.

The addition of the missing leave animation with both dialog and modal animations ensures symmetric behavior for enlarge transitions.


369-381: LGTM! Enlarge-out keyframes provide symmetric scaling animation.

The keyframe animation properly mirrors the enlarge-in behavior with reverse scaling progression, ensuring consistent visual transitions.

packages/vue/src/dialog-box/src/pc.vue (1)

21-21: LGTM! Conditional modal class binding correctly implemented.

The ternary operator properly applies the 'has-modal' class only when the modal prop is true, enabling the modal background styling defined in the LESS file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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>, please review it.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests 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 bug Something isn't working label Aug 7, 2025
@gausszhou
Copy link
Author

修复,去除 v-modal 背景使用 tiny-dialog-box__wrapper 背景作为遮罩

Image

@gausszhou
Copy link
Author

可能的问题

  1. 可能导致 moalAppendToBody 失效 ?tiny-dialog-box__wrapper 不随 v-modal 的位置变化
  2. 未测试移动端的场景

@Issues-translate-bot
Copy link

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


Possible problems

  1. Could it cause moalAppendToBody to invalidate? tiny-dialog-box__wrapper does not change with v-modal's position
  2. Untested scenarios on mobile

@gausszhou
Copy link
Author

Can somebody review ?

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