Repository navigation
fix(wework): improve model selector popover - #1836
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe desktop model selector menu now renders via a portal into document.body with fixed positioning computed from refs, replacing container-relative absolute positioning and the useOutsideClick helper with a pointerdown listener. The reasoning slider gains pointer-drag interaction with threshold-based selection. Tests were updated accordingly. ChangesModelSelector Desktop Menu and Reasoning Slider
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ModelSelector
participant DocumentBody
User->>ModelSelector: click model selector button
ModelSelector->>ModelSelector: updateDesktopMenuLayout
ModelSelector->>DocumentBody: createPortal renders fixed menu
User->>DocumentBody: pointerdown outside menu
DocumentBody->>ModelSelector: pointerdown event bubble
ModelSelector->>ModelSelector: closeMenu if target outside refs
User->>ModelSelector: pointerdown on reasoning slider track
ModelSelector->>ModelSelector: start drag, record startX
User->>ModelSelector: pointermove
ModelSelector->>ModelSelector: selectReasoningOptionFromClientX
User->>ModelSelector: pointerup
ModelSelector->>ModelSelector: setSelectedModelOption, suppress click
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Summary
Fixes the Wework model selector so desktop popovers render above workspace panels and the reasoning slider supports dragging.
What changed
Why
The desktop selector menu was rendered inside the composer stacking context, so nested menus could be clipped or covered by workspace panels. The reasoning slider only supported clicking specific handles, which made the slider feel broken for drag interactions.
Validation
pnpm --dir wework exec vitest run src/components/chat/ChatInput.test.tsx src/test/theme-token-guard.test.tspnpm --dir wework exec eslint src/components/chat/composer/ModelSelector.tsx src/components/chat/ChatInput.test.tsxSummary by CodeRabbit
New Features
Bug Fixes