Skip to content

Conversation

@zombieJ
Copy link
Member

@zombieJ zombieJ commented Feb 11, 2026

When motionName is not provided, styleReady should not return NONE

even if motionAppear is true, to allow content to render immediately.

Ultraworked with Sisyphus

Summary by CodeRabbit

发布说明

  • 错误修复

    • 优化了动画出现时的状态判断逻辑,确保在满足所有必要条件时才触发相关动作。
  • 测试

    • 增强了动画行为的测试覆盖,验证了特定场景下的渲染行为。

When motionName is not provided, styleReady should not return NONE

even if motionAppear is true, to allow content to render immediately.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@vercel
Copy link

vercel bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
motion Ready Ready Preview, Comment Feb 11, 2026 8:42am

@gemini-code-assist
Copy link

Summary of Changes

Hello @zombieJ, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a rendering issue where components utilizing CSSMotion might experience an incorrect delay in content display during initial mounting. By refining the useStatus hook's styleReady logic to properly account for supportMotion, it ensures that content appears without delay when no specific motion name is defined, thereby enhancing user experience and component responsiveness.

Highlights

  • Motion Logic Correction: The useStatus hook's logic for determining when to return 'NONE' for styleReady was updated. A supportMotion check was added to the condition, ensuring that if motionName is not provided, content renders immediately, even if motionAppear is true.
  • New Test Case: A new test was added to CSSMotion.spec.tsx to specifically verify that content renders immediately on first mount when motionName is absent but motionAppear is enabled, confirming the intended behavior.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/hooks/useStatus.ts
    • Modified the conditional logic within the useStatus hook to prevent styleReady from returning 'NONE' when motionName is not provided, by adding a supportMotion check.
  • tests/CSSMotion.spec.tsx
    • Added a new test case to confirm that content renders immediately when motionName is omitted but motionAppear is true.
Activity
  • No specific review comments or activity have been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

概述

此 PR 修改了 useStatus 钩子中的 Appear 状态判定逻辑,添加了对 supportMotionmotionAppear 的额外检查,同时补充了相应的测试用例以覆盖 motionName 未提供时的行为。

变更内容

文件/内容组 摘要
钩子逻辑更新
src/hooks/useStatus.ts
修改了 Appear 状态的可见性判定条件,现在要求同时满足未挂载、statusNONE、supportMotionmotionAppear 四个条件才能返回 NONE 样式状态。Enter/Leave 逻辑保持不变。
测试覆盖增强
tests/CSSMotion.spec.tsx
新增测试用例验证在 motionName 不提供且 motionAppear 为 true 时,CSSMotion 在首次挂载时以 visible: true 立即渲染内容的行为。

预估代码审查工作量

🎯 2 (Simple) | ⏱️ ~10 分钟

可能相关的 PR

  • PR #62:修改了相同的 useStatus 实现,将状态返回值重构为状态获取函数
  • PR #73:同样修改 src/hooks/useStatus.ts,改变了出现/可见状态逻辑的处理方式
  • PR #58:修改相同的钩子,通过引入 visibleRef 来改进动作状态转换逻辑

诗歌

🐰✨ 小钩子,大改变
Appear 的条件更严谨
motion 的支持双重检
测试完善守安全
代码流畅又清晰!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a supportMotion check before returning NONE in the styleReady logic, which matches the primary modification in useStatus.ts.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/styleReady-supportMotion-check

No actionable comments were generated in the recent review. 🎉


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.56%. Comparing base (fb7b514) to head (1fd9c1f).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #74      +/-   ##
==========================================
+ Coverage   98.55%   98.56%   +0.01%     
==========================================
  Files          11       11              
  Lines         414      417       +3     
  Branches      117      118       +1     
==========================================
+ Hits          408      411       +3     
  Misses          6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zombieJ zombieJ merged commit 27d647f into master Feb 11, 2026
10 checks passed
@zombieJ zombieJ deleted the fix/styleReady-supportMotion-check branch February 11, 2026 08:45
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request effectively addresses the issue where styleReady incorrectly returned NONE when motionName was not provided but motionAppear was true, preventing immediate content rendering. The addition of the supportMotion check in useStatus.ts correctly resolves this. The new test case in CSSMotion.spec.tsx provides good coverage for this specific scenario, ensuring the fix behaves as expected. The changes are concise and directly target the described problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant