Skip to content

feat: support drawer resizable - #54883

Merged
zombieJ merged 19 commits into
ant-design:nextfrom
cactuser-Lu:add-drawer-resize-next
Sep 8, 2025
Merged

zombieJ merged 19 commits into
ant-design:nextfrom
cactuser-Lu:add-drawer-resize-next

Conversation

@cactuser-Lu

@cactuser-Lu cactuser-Lu commented Sep 5, 2025 •

Copy link
Copy Markdown
Contributor

issiue:#54597
中文版模板 / 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

💡 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 support drawer resizable
🇨🇳 Chinese drawer 组件增加拖拽能力

@bolt-new-by-stackblitz

Copy link
Copy Markdown

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

@coderabbitai

coderabbitai Bot commented Sep 5, 2025 •

Copy link
Copy Markdown
Contributor

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

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
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@github-actions

github-actions Bot commented Sep 5, 2025 •

Copy link
Copy Markdown
Contributor

Preview is ready

@github-actions

github-actions Bot commented Sep 5, 2025 •

Copy link
Copy Markdown
Contributor

👁 Visual Regression Report for PR #54883 Failed ❌

🎯 Target branch: next (e4b1d20)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🆕 3 added

Expected (Branch next) Actual (Current PR) Diff
drawer-resizable.compact.png drawer-resizable.compact.png 🆕🆕🆕 Added 🆕🆕🆕
drawer-resizable.dark.png drawer-resizable.dark.png 🆕🆕🆕 Added 🆕🆕🆕
drawer-resizable.default.png drawer-resizable.default.png 🆕🆕🆕 Added 🆕🆕🆕

Important

There are 3 diffs found in this PR: 🆕 3 added.
Please check all items:

  • Visual diff is acceptable

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Summary of Changes

Hello @cactuser-Lu, 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 significantly enhances the Drawer component by integrating resizable capabilities. Users can now dynamically adjust the size of the drawer, providing greater control over layout and improving adaptability to various content needs. This feature aims to make the Drawer component more versatile and user-friendly.

Highlights

  • Resizable Drawer Functionality: Introduced a new resizable prop to the Drawer component, allowing users to adjust its width or height by dragging the edges. This enhances the flexibility and user experience of the drawer.
  • New ResizableConfig Interface: Defined a DrawerResizableConfig interface that provides callbacks (onResize, onResizeStart, onResizeEnd) for handling resize events, enabling custom logic during the resizing process.
  • Updated Documentation and Demos: Added new demo files (resizable.md, resizable.tsx) to showcase the resizable feature and updated both English and Chinese documentation to include details about the new resizable prop and its configuration.
  • Styling and Dependency Update: Implemented new CSS styles for the resizable dragger elements and dragging states to provide visual feedback during resizing. The @rc-component/drawer dependency was also updated to support this new functionality.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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. ↩

@socket-security

socket-security Bot commented Sep 5, 2025 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​rc-component/​drawer@​1.1.0 ⏵ 1.2.079 +210096 +290 +7100

View full report

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

Copy link
Copy Markdown
Contributor

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 adds a resizable feature to the Drawer component. The changes include updates to the Drawer component itself, new styles, documentation, and a demo page. The implementation looks good overall. I've found a duplicated style block that should be removed and suggested a couple of minor improvements for type safety and code clarity.

Comment thread components/drawer/style/index.ts Resolved
Comment thread components/drawer/demo/resizable.tsx Resolved
Comment thread components/drawer/index.tsx Resolved
Comment thread components/drawer/index.en-US.md Resolved
Comment thread components/drawer/index.en-US.md Resolved
@pkg-pr-new

pkg-pr-new Bot commented Sep 5, 2025 •

Copy link
Copy Markdown

Comment thread components/drawer/index.en-US.md Resolved
@codecov

codecov Bot commented Sep 5, 2025 •

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 4.91kB (0.13%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.75MB 4.91kB (0.13%) ⬆️

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.min.js 2.46kB 2.06MB 0.12%
antd.min.js 2.46kB 1.69MB 0.15%

@codecov

codecov Bot commented Sep 5, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0914ea4) to head (e92683a).
⚠️ Report is 18 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff            @@
##              next    #54883   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          792       792           
  Lines        14575     14585   +10     
  Branches      3876      3881    +5     
=========================================
+ Hits         14575     14585   +10     

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

Comment thread components/drawer/demo/resizable.md Resolved
Signed-off-by: thinkasany <480968828@qq.com>
Comment thread components/drawer/index.zh-CN.md Resolved
Comment thread components/drawer/index.tsx Resolved
@github-actions

github-actions Bot commented Sep 5, 2025

Copy link
Copy Markdown
Contributor

Hi @cactuser-Lu. Thanks for your contribution. The path .github/ or scripts/ and CHANGELOG is only maintained by team members. This current PR will be closed and team members will help on this.

@thinkasany thinkasany reopened this Sep 5, 2025
Comment thread components/drawer/index.tsx Resolved
bottom: 0,
insetInlineStart: 0,
width: 4,
cursor: 'col-resize',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

这条可以忽略不用改动,这边是我的参考建议,到时候和其他成员确认一下。

ns-resize and ew-resize seem to be used more.

image

shadcn https://ui.shadcn.com/docs/components/resizable

vscode

naive https://www.naiveui.com/zh-CN/os-theme/components/drawer

Comment thread components/drawer/style/index.ts Resolved
Comment thread components/drawer/style/index.ts Resolved
Comment thread components/drawer/style/index.ts Resolved
@thinkasany
thinkasany requested a review from Copilot September 5, 2025 14:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for resizable drawer functionality by enabling users to drag the drawer's edge to dynamically adjust its width or height based on placement.

Key Changes:

  • Integrates new resizable prop interface for controlling drag resize behavior
  • Updates dependency to support resizable drawer functionality
  • Adds comprehensive CSS styles for resizable drag handles and dragging states

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Updates @rc-component/drawer dependency to version 1.2.0 for resizable support
components/drawer/index.tsx Adds DrawerResizableConfig interface and resizable prop handling
components/drawer/style/index.ts Implements CSS styles for resizable dragger elements and dragging states
components/drawer/demo/resizable.tsx Creates interactive demo showing resizable drawer in all placements
components/drawer/index.zh-CN.md Documents resizable prop and ResizableConfig parameters in Chinese
components/drawer/index.en-US.md Documents resizable prop and ResizableConfig parameters in English

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread components/drawer/demo/resizable.tsx Resolved
Comment thread components/drawer/demo/resizable.tsx Resolved
Comment thread components/drawer/index.tsx Resolved
Comment thread components/drawer/style/index.ts Outdated
* @desc 拖拽手柄大小
* @descEN Size of resize handle
*/
resizeHandleSize: number;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

这个和 Splitter 不太一致,我去 rc-drawer 里再看看

zombieJ
zombieJ previously approved these changes Sep 8, 2025
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Sep 8, 2025
@thinkasany

Copy link
Copy Markdown
Member
image

@zombieJ
zombieJ merged commit acb7f00 into ant-design:next Sep 8, 2025
@github-actions

github-actions Bot commented Sep 8, 2025

Copy link
Copy Markdown
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 链接)。

@cactuser-Lu

Copy link
Copy Markdown
Contributor Author

🎉 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 链接)。

二维码已过期..........

@li-jia-nan

Copy link
Copy Markdown
Member

二维码已过期..........

更新了

image

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 skip-verify-files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants