Skip to content

fix: drawer is broken #2351

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

Merged
merged 3 commits into from
May 31, 2025
Merged

fix: drawer is broken #2351

merged 3 commits into from
May 31, 2025

Conversation

astandrik
Copy link
Collaborator

@astandrik astandrik commented May 31, 2025

Stand

Closes #2350

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
318 317 0 1 0

😟 No changes in tests. 😕

Bundle Size: ✅

Current: 83.65 MB | Main: 83.65 MB
Diff: +1.25 KB (0.00%)

✅ Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@astandrik astandrik requested review from Raubzeug and Copilot May 31, 2025 11:51
Raubzeug
Raubzeug previously approved these changes May 31, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses a broken drawer by introducing a dedicated portal container and wiring it through context.

  • Expose an itemContainerRef in the drawer context and render its DOM node.
  • Wrap the existing GravityDrawer in a Portal that mounts into the new container.
  • Update imports to bring in Portal from the UI kit.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/components/Drawer/DrawerContext.tsx Add itemContainerRef to context type, default value, and provider DOM
src/components/Drawer/Drawer.tsx Import Portal, consume itemContainerRef, and wrap drawer in portal
Comments suppressed due to low confidence (2)

src/components/Drawer/Drawer.tsx:52

  • The drawerRef variable is declared but never used. Remove this unused ref to clean up dead code or attach it to the GravityDrawer if you intended to control the drawer DOM node.
const drawerRef = React.useRef<HTMLDivElement>(null);

src/components/Drawer/DrawerContext.tsx:63

  • The useMemo dependency array includes containerWidth but omits itemContainerRef, which is part of the returned value. Add itemContainerRef to the dependencies to satisfy React’s exhaustive-deps rule.
[containerWidth],

@astandrik astandrik added this pull request to the merge queue May 31, 2025
Merged via the queue into main with commit ce13b7f May 31, 2025
7 checks passed
@astandrik astandrik deleted the astandrik.2350 branch May 31, 2025 12:37
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.

Drawer is broken
2 participants