Repository navigation
feat: support drawer resizable - #54883
Conversation
|
|
|
Note Other AI code review bot(s) detectedCodeRabbit 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 skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
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. Comment |
👁 Visual Regression Report for PR #54883 Failed ❌
Important There are 3 diffs found in this PR: 🆕
|
There was a problem hiding this comment.
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
resizableprop to theDrawercomponent, 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
DrawerResizableConfiginterface 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 newresizableprop 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/drawerdependency 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
-
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. ↩
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
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.
More templates
commit: |
Bundle ReportChanges will increase total bundle size by 4.91kB (0.13%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Signed-off-by: thinkasany <480968828@qq.com>
…Lu/ant-design into add-drawer-resize-next
|
Hi @cactuser-Lu. Thanks for your contribution. The path |
| bottom: 0, | ||
| insetInlineStart: 0, | ||
| width: 4, | ||
| cursor: 'col-resize', |
There was a problem hiding this comment.
这条可以忽略不用改动,这边是我的参考建议,到时候和其他成员确认一下。
ns-resize and ew-resize seem to be used more.
shadcn https://ui.shadcn.com/docs/components/resizable
vscode
naive https://www.naiveui.com/zh-CN/os-theme/components/drawer
There was a problem hiding this comment.
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.
| * @desc 拖拽手柄大小 | ||
| * @descEN Size of resize handle | ||
| */ | ||
| resizeHandleSize: number; |
There was a problem hiding this comment.
这个和 Splitter 不太一致,我去 rc-drawer 里再看看








issiue:#54597
中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
💡 Background and Solution
📝 Change Log