Skip to content

fix: add progress missing memo deps#55554

Merged
thinkasany merged 1 commit intonextfrom
progress-deps-memo
Nov 1, 2025
Merged

fix: add progress missing memo deps#55554
thinkasany merged 1 commit intonextfrom
progress-deps-memo

Conversation

@thinkasany
Copy link
Member

🤔 This is a ...

  • ❓ Other (about what?)

🔗 Related Issues

  • Describe the source of related requirements, such as links to relevant issue discussions.
  • For example: close #xxxx, fix #xxxx

💡 Background and Solution

  • The specific problem to be addressed.
  • List the final API implementation and usage if needed.
  • If there are UI/interaction changes, consider providing screenshots or GIFs.

📝 Change Log

Language Changelog
🇺🇸 English -
🇨🇳 Chinese -

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

👁 Visual Regression Report for PR #55554 Passed ✅

🎯 Target branch: next (16fe356)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎

🎊 Congrats! No visual-regression diff found.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

Preview is ready

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @thinkasany, 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 addresses a potential issue in the Progress component by updating the dependency array of a useCallback hook. The change ensures that the component's internal rendering logic is correctly memoized, leading to more predictable behavior and improved performance by preventing unnecessary re-creations of the render function.

Highlights

  • React Memoization Fix: Added several missing dependencies to the useCallback hook for the renderProcessInfo function within the Progress component. This ensures that the memoized function correctly captures the latest values of its dependencies, preventing potential bugs related to stale closures and optimizing re-renders.
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
Contributor

coderabbitai bot commented Nov 1, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch progress-deps-memo

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.

Copy link
Contributor

@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

This pull request aims to fix missing dependencies in a useMemo hook within the Progress component. While the added dependencies are mostly correct, a key dependency, props.success, was overlooked. I've provided a review comment to address this omission and suggested some cleanups to the dependency array for better maintainability. Applying this change will ensure the component behaves correctly and avoids rendering stale UI.

Comment on lines +208 to +223
}, [
showInfo,
percent,
percentNumber,
progressStatus,
type,
prefixCls,
format,
isLineType,
strokeColorIsBright,
infoPosition,
infoAlign,
isPureLineType,
mergedClassNames.indicator,
mergedStyles.indicator,
]);
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The dependency array for useMemo is missing props.success. The memoized value progressInfo calls getSuccessPercent(props), which directly depends on props.success. This can lead to stale UI when props.success changes.

Additionally, for cleanup, you could remove percentNumber and type from the dependency array as they are redundant:

  • percentNumber is not directly used inside this useMemo. Its effects are captured through progressStatus, which is already a dependency.
  • type is redundant because isLineType is already a dependency, and isLineType is derived from type.
  }, [
    showInfo,
    percent,
    progressStatus,
    prefixCls,
    format,
    props.success,
    isLineType,
    strokeColorIsBright,
    infoPosition,
    infoAlign,
    isPureLineType,
    mergedClassNames.indicator,
    mergedStyles.indicator,
  ]);

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

size-limit report 📦

Path Size
dist/antd.min.js 495.38 KB (+16 B 🔺)
dist/antd-with-locales.min.js 587.53 KB (+17 B 🔺)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 1, 2025

@codecov
Copy link

codecov bot commented Nov 1, 2025

Bundle Report

Changes will increase total bundle size by 252 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 11.8MB 252 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: antd.min-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
antd-with-locales.js 126 bytes 6.2MB 0.0%
antd.js 126 bytes 5.59MB 0.0%

@cloudflare-workers-and-pages
Copy link

Deploying ant-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: 38022e7
Status: ✅  Deploy successful!
Preview URL: https://b28b7a79.ant-design.pages.dev
Branch Preview URL: https://progress-deps-memo.ant-design.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

Deploying ant-design-next with  Cloudflare Pages  Cloudflare Pages

Latest commit: 38022e7
Status: ✅  Deploy successful!
Preview URL: https://2890c402.ant-design-next.pages.dev
Branch Preview URL: https://progress-deps-memo.ant-design-next.pages.dev

View logs

@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (16fe356) to head (38022e7).
⚠️ Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff            @@
##              next    #55554   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          796       796           
  Lines        14690     14690           
  Branches      3899      3899           
=========================================
  Hits         14690     14690           

☔ 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.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 1, 2025
@thinkasany thinkasany merged commit 7ba2c5d into next Nov 1, 2025
49 checks passed
@thinkasany thinkasany deleted the progress-deps-memo branch November 1, 2025 05:39
@zombieJ zombieJ mentioned this pull request Nov 4, 2025
17 tasks
afc163 added a commit that referenced this pull request Nov 22, 2025
Co-authored-by: 刘欢 <lh01217311@antgroup.com>
Co-authored-by: lijianan <574980606@qq.com>
Co-authored-by: 遇见同学 <1875694521@qq.com>
Co-authored-by: thinkasany <480968828@qq.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: heming <984507092@qq.com>
Co-authored-by: 海绵 <hai.mian@yingdao.com>
Co-authored-by: 二货机器人 <smith3816@gmail.com>
Co-authored-by: binghui.dbh <binghui.dbh@antgroup.com>
Co-authored-by: thinkasany <117748716+thinkasany@users.noreply.github.com>
Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ice <1597834867@qq.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 叶文俊 <yewenjun@mistong.com>
Co-authored-by: 二货爱吃白萝卜 <smith3816@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: EmilyyyLiu <100924403+EmilyyyLiu@users.noreply.github.com>
Co-authored-by: zjr222 <67370334+zjr222@users.noreply.github.com>
Co-authored-by: sheng zhang <79007994+Arktomson@users.noreply.github.com>
Co-authored-by: MadCcc <madccc@foxmail.com>
Co-authored-by: keda <53565274+Linkodt@users.noreply.github.com>
Co-authored-by: divyeshagrawal <138372682+divyeshagrawal@users.noreply.github.com>
Co-authored-by: xkhanhan <61129468+xkhanhan@users.noreply.github.com>
Co-authored-by: tanjiahao24 <90695367+tanjiahao24@users.noreply.github.com>
Co-authored-by: Susuper <susuperli@163.com>
Co-authored-by: ccc1018 <82812268+ccc1018@users.noreply.github.com>
Co-authored-by: GinWU <ginwu05@gmail.com>
Co-authored-by: lts <lts.lyc@qq.com>
Co-authored-by: nmsn <136696700@qq.com>
Co-authored-by: elrrrrrrr <elrrrrrrr@gmail.com>
Co-authored-by: 叶枫 <7971419+crazyair@users.noreply.github.com>
Co-authored-by: Wanpan <wanpan96@163.com>
Co-authored-by: 沐白 <13588781920@163.com>
Co-authored-by: heming <74885943+984507092@users.noreply.github.com>
Co-authored-by: afc163 <afc163@gmail.com>
Co-authored-by: Guo Yunhe <i@guoyunhe.me>
fix popconfirm style (#55173)
fix typo of pannel to panel (#55178)
fix: leavedClassName classname when hidden (#55309)
fix(timeline): add missing orientation memo deps (#55449)
fix(collapse): add missing deps (#55452)
fix(menu): add missing contextValue memo deps (#55459)
fix: add splitter missing memo deps (#55486)
resolve console.error (#55488)
fix script (#55496)
fix: semantic of collapse (#55499)
fix: add divider missing memo deps (#55514)
fix: add progress missing memo deps (#55554)
fix: add tag useColor hooks missing memo deps (#55555)
fix: add PromptDrawer missing memo deps (#55556)
fix: add missing childrenColumnName dependency (#55559)
fix: Optimize the definition of the duration type (#55580)
fix(textarea): resize is invalid in styles.textarea (#55579)
fix Dynamic demo key calculte error (#55624)
fix: static css extract should order of Button (#55619)
fix missing addon (#55784)
fix: add missing dependency (#55782)
fix: update innerLoading to loading (#55789)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants