Skip to content

Conversation

@whymono
Copy link

@whymono whymono commented Jan 29, 2026

Description

fixed the sidebar collapsing issue on window with width under 768px, by removing unrefined useOutsideClickDetector

Type of Change

  • [ x] Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Test Scenarios

before the change the sidebar would collapse after click or touch on windows with width under 768px, after the change the sidebar no longer collapses.

References

#8555

Summary by CodeRabbit

  • Refactor
    • Updated sidebar behavior: the sidebar no longer automatically closes when clicking outside of it. It now responds only to window size changes.

✏️ Tip: You can customize this high-level summary in your review settings.

…by removing unrefined useOutsideClickDetector
@CLAassistant
Copy link

CLAassistant commented Jan 29, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

The useOutsideClickDetector hook is removed entirely from the codebase. The sidebar component no longer uses this hook, eliminating the outside-click detection behavior. The sidebar retains only its window-resize-based toggle functionality.

Changes

Cohort / File(s) Summary
Hook Removal
packages/hooks/src/use-outside-click-detector.tsx
Complete deletion of the useOutsideClickDetector hook export and its entire implementation, including the mousedown event listener logic and useEffect lifecycle.
Sidebar Component Update
apps/web/core/components/sidebar/sidebar-wrapper.tsx
Removed import and usage of the deleted useOutsideClickDetector hook; outside-click-to-close sidebar behavior eliminated while window-size toggle behavior retained.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 The hook is gone, no more clicks around,
Sidebar closes only when screens shrink down,
Simpler it is, no tangled affairs,
One less behavior floating in there! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: preventing sidebar auto-close on touch/click events on small screens, which aligns with the removal of useOutsideClickDetector hook.
Description check ✅ Passed The description covers all required template sections including a clear description of the fix, appropriate type-of-change selection, test scenarios explaining the before/after behavior, and a reference to the related issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

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