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

feat(Splitter): add lazy mode #51557

Merged
merged 32 commits into from
Nov 14, 2024
Merged

Conversation

OysterD3
Copy link
Contributor

@OysterD3 OysterD3 commented Nov 9, 2024

中文版模板 / 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
  • ❓ 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 Add lazy mode to Splitter
🇨🇳 Chinese Splitter 增加 lazy 模式

Copy link

stackblitz bot commented Nov 9, 2024

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

Copy link
Contributor

github-actions bot commented Nov 9, 2024

Preview is ready

Copy link
Contributor

github-actions bot commented Nov 9, 2024

👁 Visual Regression Report for PR #51557 Failed ❌

🎯 Target branch: feature (390e346)
📖 View Full Report ↗︎

Expected (Branch feature) Actual (Current PR) Diff
splitter-lazy.compact.css-var.png splitter-lazy.compact.css-var.png 🆕🆕🆕 Added 🆕🆕🆕
splitter-lazy.compact.png splitter-lazy.compact.png 🆕🆕🆕 Added 🆕🆕🆕
splitter-lazy.dark.css-var.png splitter-lazy.dark.css-var.png 🆕🆕🆕 Added 🆕🆕🆕
splitter-lazy.dark.png splitter-lazy.dark.png 🆕🆕🆕 Added 🆕🆕🆕
splitter-lazy.default.css-var.png splitter-lazy.default.css-var.png 🆕🆕🆕 Added 🆕🆕🆕
splitter-lazy.default.png splitter-lazy.default.png 🆕🆕🆕 Added 🆕🆕🆕

Check Full Report for details


If you think the visual diff is acceptable, please check:

  • Visual diff is acceptable

Copy link

Walkthrough

This pull request introduces a new feature to the Splitter component by adding a "lazy" mode. In lazy mode, the size of the panels is not updated immediately during dragging but only after the drag operation is completed. This change includes updates to the SplitBar and Splitter components, new tests, and documentation updates.

Changes

Files Summary
components/splitter/SplitBar.tsx, components/splitter/Splitter.tsx Added lazy mode functionality, including new props and logic for handling lazy resizing.
components/splitter/tests/index.test.tsx Added tests to verify the lazy mode behavior for both mouse and touch events.
components/splitter/demo/lazy.md, components/splitter/demo/lazy.tsx Added a new demo showcasing the lazy mode feature.
components/splitter/index.en-US.md, components/splitter/index.zh-CN.md Updated documentation to include the lazy mode feature.
components/splitter/interface.ts Updated interfaces to include the lazy prop.
components/splitter/style/index.ts Added styles for the preview element in lazy mode.

Copy link

pkg-pr-new bot commented Nov 9, 2024

Copy link

codecov bot commented Nov 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (390e346) to head (16567d1).
Report is 1 commits behind head on feature.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #51557   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          761       761           
  Lines        13533     13565   +32     
  Branches      3527      3539   +12     
=========================================
+ Hits         13533     13565   +32     

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

Co-authored-by: afc163 <[email protected]>
Signed-off-by: Oyster Lee <[email protected]>
components/splitter/SplitBar.tsx Outdated Show resolved Hide resolved
components/splitter/demo/lazy.md Outdated Show resolved Hide resolved
components/splitter/demo/lazy.md Outdated Show resolved Hide resolved
components/splitter/index.zh-CN.md Outdated Show resolved Hide resolved
components/splitter/index.en-US.md Outdated Show resolved Hide resolved
Co-authored-by: lijianan <[email protected]>
Signed-off-by: Oyster Lee <[email protected]>
@chenshuai2144
Copy link
Contributor

这个 pr 搞完是不是可以搞个可推拽表格了

components/splitter/index.en-US.md Outdated Show resolved Hide resolved
components/splitter/index.en-US.md Outdated Show resolved Hide resolved
components/splitter/index.zh-CN.md Outdated Show resolved Hide resolved
components/splitter/index.zh-CN.md Outdated Show resolved Hide resolved
Co-authored-by: afc163 <[email protected]>
Signed-off-by: Oyster Lee <[email protected]>
@afc163
Copy link
Member

afc163 commented Nov 13, 2024

size-limit report 📦

Path Size
dist/antd.min.js 441.55 KB (+297 B 🔺)
dist/antd-with-locales.min.js 509.42 KB (+272 B 🔺)

@afc163 afc163 merged commit 6773815 into ant-design:feature Nov 14, 2024
39 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 链接)。

@zombieJ zombieJ mentioned this pull request Jan 6, 2025
16 tasks
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.

5 participants