Skip to content
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

fix(descriptions): last item span fill remaining column #52410

Merged
merged 3 commits into from
Jan 17, 2025

Conversation

anyuxuan
Copy link
Contributor

fix(descriptions): correct calculation of last item's span in useRow hook

🤔 This is a bug

  • 🐞 Bug fix

💡 Background and Solution

  • before
    CleanShot 2025-01-15 at 11 44 20@2x

  • after
    CleanShot 2025-01-15 at 11 45 45@2x

📝 Change Log

  • fix: last item span calc value, make it fill remaining column correctly
Language Changelog
🇺🇸 English fix last item span fill remaining column
🇨🇳 Chinese 修复最后一项的span计算值,使其正确的填充满剩余空间

fix(descriptions): correct calculation of last item's span in useRow hook
Copy link

stackblitz bot commented Jan 15, 2025

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

Copy link
Contributor

github-actions bot commented Jan 15, 2025

👁 Visual Regression Report for PR #52410 Failed ❌

🎯 Target branch: master (e707210)
📖 View Full Report ↗︎
📊 Summary: 🔄 31 changed

Expected (Branch master) Actual (Current PR) Diff
checkbox-debug-line.compact.png checkbox-debug-line.compact.png checkbox-debug-line.compact.png checkbox-debug-line.compact.png
checkbox-debug-line.compact.png checkbox-debug-line.compact.png checkbox-debug-line.compact.css-var.png checkbox-debug-line.compact.css-var.png
checkbox-debug-line.dark.png checkbox-debug-line.dark.png checkbox-debug-line.dark.png checkbox-debug-line.dark.png
checkbox-debug-line.dark.png checkbox-debug-line.dark.png checkbox-debug-line.dark.css-var.png checkbox-debug-line.dark.css-var.png
checkbox-debug-line.default.png checkbox-debug-line.default.png checkbox-debug-line.default.png checkbox-debug-line.default.png
checkbox-debug-line.default.png checkbox-debug-line.default.png checkbox-debug-line.default.css-var.png checkbox-debug-line.default.css-var.png
drawer-extra.compact.png drawer-extra.compact.png drawer-extra.compact.png drawer-extra.compact.png
drawer-extra.compact.png drawer-extra.compact.png drawer-extra.compact.css-var.png drawer-extra.compact.css-var.png

Warning

There are more diffs not shown in the table. Please check the Full Report for details.


Important

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

  • Checked all diffs in the full report
  • Visual diff is acceptable

Copy link
Contributor

github-actions bot commented Jan 15, 2025

Preview is ready

Copy link

Walkthrough

This pull request addresses a bug in the useRow hook of the descriptions component. The change corrects the calculation of the last item's span to ensure it fills the remaining columns correctly. This fix is demonstrated through updated test cases and adjustments in the span calculation logic.

Changes

Files Summary
components/descriptions/tests/index.test.tsx Added a new test case to verify the correct span calculation when the column count is 6.
components/descriptions/hooks/useRow.ts Fixed the logic for calculating the last item's span to fill the remaining columns accurately.

@afc163
Copy link
Member

afc163 commented Jan 17, 2025

@codecov-ai-reviewer review

Copy link

pkg-pr-new bot commented Jan 17, 2025

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (377cc21) to head (65abc6c).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #52410   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          763       763           
  Lines        13774     13774           
  Branches      3604      3605    +1     
=========================================
  Hits         13774     13774           

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

@afc163 afc163 merged commit 88d81e5 into ant-design:master Jan 17, 2025
35 of 40 checks passed
Copy link
Contributor

🎉 Thank you for your contribution! If you have not yet joined our DingTalk community group, please feel free to join us (when joining, please provide the link to this PR).

🎉 感谢您的贡献!如果您还没有加入钉钉社区群,请扫描下方二维码加入我们(加群时请提供此 PR 链接)。

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.

2 participants