Skip to content

feat: add marginSize prop for QRCode quiet zone#56569

Merged
thinkasany merged 7 commits intofeaturefrom
feat/add-margin-size-prop
Jan 12, 2026
Merged

feat: add marginSize prop for QRCode quiet zone#56569
thinkasany merged 7 commits intofeaturefrom
feat/add-margin-size-prop

Conversation

@afc163
Copy link
Member

@afc163 afc163 commented Jan 12, 2026

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ⌨️ Accessibility improvement
  • ❓ Other (about what?)

🔗 Related Issues

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

close #56458

💡 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 QRCode adds marginSize prop for quiet zone size.
🇨🇳 Chinese QRCode 新增 marginSize 属性用于展示二维码留白区。

@bolt-new-by-stackblitz
Copy link

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

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 feat/add-margin-size-prop

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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @afc163, 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 enhances the QRCode component by adding a marginSize prop, which provides granular control over the quiet zone surrounding the generated QR code. This allows for more flexible integration and visual customization of QR codes within applications, ensuring they meet specific design requirements for spacing and presentation.

Highlights

  • New marginSize Prop: Introduced a new marginSize prop to the QRCode component, allowing users to specify the size of the quiet zone (margin) around the QR code in modules. The default value is 0, meaning no margin.
  • Documentation Updates: The marginSize prop has been added to both the English (index.en-US.md) and Chinese (index.zh-CN.md) documentation files for the QRCode component, detailing its purpose, type (number), and default value.
  • Test Coverage: A new test case has been added to index.test.tsx to verify that the marginSize prop correctly influences the viewBox attribute of SVG-rendered QR codes, ensuring the quiet zone is properly applied.

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

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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 12, 2026

Preview is ready

@github-actions
Copy link
Contributor

github-actions bot commented Jan 12, 2026

👁 Visual Regression Report for PR #56569 Failed ❌

🎯 Target branch: feature (27826a8)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🔄 2 changed

Expected (Branch feature) Actual (Current PR) Diff
table-sticky.dark.png table-sticky.dark.png table-sticky.dark.png table-sticky.dark.png
table-sticky.default.png table-sticky.default.png table-sticky.default.png table-sticky.default.png

Important

There are 2 diffs found in this PR: 🔄 2 changed.
Please check all items:

  • Visual diff is acceptable

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 12, 2026

Deploying ant-design-next with  Cloudflare Pages  Cloudflare Pages

Latest commit: f817d55
Status: ✅  Deploy successful!
Preview URL: https://73fdff03.ant-design-next.pages.dev
Branch Preview URL: https://feat-add-margin-size-prop.ant-design-next.pages.dev

View logs

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 introduces a marginSize prop to the QRCode component, allowing control over the quiet zone. The implementation involves passing this prop down to the underlying qrcode component. The changes are also reflected in the documentation, and a new test case has been added. My review focuses on improving the robustness of the new test case.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 12, 2026

size-limit report 📦

Path Size
dist/antd.min.js 523.01 KB (+3 B 🔺)
dist/antd-with-locales.min.js 616.52 KB (+4 B 🔺)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 12, 2026

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 12, 2026

Deploying ant-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: f817d55
Status: ✅  Deploy successful!
Preview URL: https://c48d7f8d.ant-design.pages.dev
Branch Preview URL: https://feat-add-margin-size-prop.ant-design.pages.dev

View logs

@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (27826a8) to head (f817d55).
⚠️ Report is 1 commits behind head on feature.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #56569   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          807       807           
  Lines        14922     14922           
  Branches      3935      3935           
=========================================
  Hits         14922     14922           

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

@afc163 afc163 marked this pull request as ready for review January 12, 2026 05:40
Signed-off-by: afc163 <afc163@gmail.com>
@codecov
Copy link

codecov bot commented Jan 12, 2026

Bundle Report

Changes will increase total bundle size by 8.14MB (211.08%) ⬆️⚠️, exceeding the configured threshold of 5%.

Bundle name Size Change
antd.min-array-push 12.0MB 8.14MB (211.08%) ⬆️⚠️

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 (New) 6.31MB 6.31MB 100.0% 🚀
antd.js (New) 5.69MB 5.69MB 100.0% 🚀
antd-with-locales.min.js (Deleted) -2.12MB 0 bytes -100.0% 🗑️
antd.min.js (Deleted) -1.73MB 0 bytes -100.0% 🗑️

afc163 and others added 3 commits January 12, 2026 20:45
Co-authored-by: thinkasany <480968828@qq.com>
Signed-off-by: afc163 <afc163@gmail.com>
Co-authored-by: thinkasany <480968828@qq.com>
Signed-off-by: afc163 <afc163@gmail.com>
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 12, 2026
@thinkasany thinkasany merged commit 5b9b6f8 into feature Jan 12, 2026
43 of 44 checks passed
@thinkasany thinkasany deleted the feat/add-margin-size-prop branch January 12, 2026 13:44
@zombieJ zombieJ mentioned this pull request Jan 13, 2026
17 tasks
QDyanbing pushed a commit to QDyanbing/ant-design that referenced this pull request Jan 14, 2026
* feat: add marginSize prop for QRCode quiet zone

* Apply suggestions from code review

Signed-off-by: afc163 <afc163@gmail.com>

* Update components/qr-code/index.en-US.md

Co-authored-by: thinkasany <480968828@qq.com>
Signed-off-by: afc163 <afc163@gmail.com>

* Apply suggestions from code review

Co-authored-by: thinkasany <480968828@qq.com>
Signed-off-by: afc163 <afc163@gmail.com>

---------

Signed-off-by: afc163 <afc163@gmail.com>
Co-authored-by: thinkasany <480968828@qq.com>
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.

3 participants