fix: add overflow handling to hot keys dropdown#147
Conversation
Add max-height and overflow-y to prevent the workflow selector dropdown from extending beyond the viewport when there are many workflows. Fixes RoamJS#144
WalkthroughThe changes address an overflow issue in the hotkey dropdown menu by applying styling and portal configuration. A MenuItemSelect component in HotKeyPanel.tsx receives a new popoverProps configuration that assigns the CSS class "roamjs-hotkey-dropdown" for portal rendering. Concurrently, a CSS rule is added to the stylesheet that limits the dropdown's height and enables vertical scrolling. These modifications do not alter underlying logic or functionality. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/index.ts (1)
111-114: LGTM! CSS overflow handling implemented correctly.The CSS rule properly limits the dropdown height and enables vertical scrolling. The selector is appropriately scoped to avoid affecting other menus.
Optional: Consider responsive max-height
The fixed 300px max-height works well for most cases, but on smaller screens you might consider using viewport units for better responsiveness:
.roamjs-hotkey-dropdown .bp3-menu { - max-height: 300px; + max-height: min(300px, 50vh); overflow-y: auto; }This ensures the dropdown never exceeds 50% of the viewport height on smaller screens while maintaining the 300px limit on larger displays.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/HotKeyPanel.tsxsrc/index.ts
🔇 Additional comments (1)
src/HotKeyPanel.tsx (1)
84-84: Portal class correctly configured for dropdown styling.The
popoverPropswithportalClassNameproperly connects the CSS overflow rules fromsrc/index.ts(lines 111-113) to this dropdown. MenuItemSelect from roamjs-components supports thepopoverPropsprop, forwarding it to Blueprint's Popover component, and the configuration is correct.
|
Woo! Thanks 👊 |
…w from rebase Rebase silently dropped these changes. Restores: - popoverProps with overflow CSS for hotkey dropdown (RoamJS#147) - Ctrl+n/j/p/k vim-style navigation in SmartBlocks menu (RoamJS#146) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Fixes #144 - Adds overflow handling to the hot keys workflow selector dropdown.
Problem
When a user has many workflows, the dropdown in the hot keys settings panel extends beyond the viewport, making it difficult or impossible to select workflows at the bottom of the list.
Solution
popoverPropswith a custom portal class to theMenuItemSelectcomponent inHotKeyPanel.tsx.roamjs-hotkey-dropdown .bp3-menuwithmax-height: 300pxandoverflow-y: autoThis makes the dropdown scrollable when there are many workflows.
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.