LibreChat/packages/client/src/components
ethanlaj 781bfb857d
🩹 fix: Sync ControlCombobox popover width with trigger after layout changes (#12887)
* 🩹 fix: Sync ControlCombobox popover width with trigger after layout changes

The popover width was measured once on mount via offsetWidth. When the agent builder side panel opens after a page reload with the sidebar collapsed, the trigger button is initially measured during the layout transition (~26px) and never re-measured, leaving the agent select dropdown rendered at the far left with no options fully visible.

Use a ResizeObserver to keep buttonWidth in sync with the trigger's actual width whenever it resizes, then disconnect on unmount.

* test: cover ControlCombobox isCollapsed, no-ResizeObserver, and zero-width branches

Address review feedback:
- Use button.offsetWidth as the ResizeObserver fallback instead of
  entry.contentRect.width to avoid a content-box vs border-box mismatch in
  pre-2022 browsers that ship ResizeObserver without borderBoxSize.
- Add tests for the three previously-untested branches: isCollapsed=true
  (no observation of the trigger), ResizeObserver unavailable (sync-only
  measurement), and zero-width entries (state unchanged).

* test: lock the button.offsetWidth fallback against revert

Add a test that drives the ResizeObserver callback with borderBoxSize
absent and divergent contentRect.width vs offsetWidth (251 vs 275).
The fix would silently revert to entry.contentRect.width without this
test failing, so this pins the chosen fallback semantics.

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
2026-04-30 15:02:16 +09:00
..
DataTable 🪟 feat: DataTable update + Various UI enhancements (#9698) 2025-12-11 16:39:06 -05:00
Accordion.tsx 🧈 fix: Smoother Control Panel Tab Expansion Animations (#11077) 2025-12-25 12:25:25 -05:00
AlertDialog.tsx
AnimatedSearchInput.tsx 🛗 fix: Address Accessibility Issues - Axe Rating: Serious (#10521) 2025-12-11 16:36:32 -05:00
AnimatedTabs.css
AnimatedTabs.tsx
AnimatePopover.css 🖌️ feat: add animation styles for popovers and tooltips (#8831) 2025-08-04 14:44:00 -04:00
Avatar.tsx 🎭 refactor: Avatar Loading UX and Fix Initials Rendering Bugs (#9261) 2025-08-25 12:06:00 -04:00
Badge.tsx 🔇 fix: Hide Button Icons from Screen Readers (#10776) 2025-12-11 16:35:17 -05:00
Breadcrumb.tsx
Button.tsx ⌨️ refactor: Favorite Item Selection & Keyboard Navigation/Focus Improvements (#10952) 2025-12-12 17:18:21 -05:00
Checkbox.tsx 🪟 feat: DataTable update + Various UI enhancements (#9698) 2025-12-11 16:39:06 -05:00
CheckboxButton.tsx
Collapsible.tsx
Combobox.tsx 🪜 fix: Layering Conflicts and UX Polish (#11177) 2026-01-02 11:43:03 -05:00
ControlCombobox.spec.tsx 🩹 fix: Sync ControlCombobox popover width with trigger after layout changes (#12887) 2026-04-30 15:02:16 +09:00
ControlCombobox.tsx 🩹 fix: Sync ControlCombobox popover width with trigger after layout changes (#12887) 2026-04-30 15:02:16 +09:00
DataTable.tsx 🛗 fix: Address Accessibility Issues - Axe Rating: Serious (#10521) 2025-12-11 16:36:32 -05:00
DelayedRender.tsx
Dialog.tsx 🔇 fix: Hide Button Icons from Screen Readers (#10776) 2025-12-11 16:35:17 -05:00
DialogTemplate.spec.tsx 🪟 feat: DataTable update + Various UI enhancements (#9698) 2025-12-11 16:39:06 -05:00
DialogTemplate.tsx
Dropdown.css 🪜 fix: Layering Conflicts and UX Polish (#11177) 2026-01-02 11:43:03 -05:00
Dropdown.tsx 🧩 style: Agent Side Panel Layout and Consistency Fixes (#12676) 2026-04-15 14:27:13 -04:00
DropdownMenu.tsx 📱 fix: Mention Touch UX and MCP Tool UI Consistency (#11627) 2026-02-04 15:22:32 +01:00
DropdownNoState.tsx
DropdownPopup.tsx 🔖 fix: Announce Bookmark Selection State (#11450) 2026-01-21 13:49:50 -05:00
FileUpload.tsx
FilterInput.tsx 🎨 refactor: Redesign Sidebar with Unified Icon Strip Layout (#12013) 2026-03-22 01:15:20 -04:00
FormInput.tsx
HoverCard.tsx
index.ts 🔌 refactor: MCP UI with Improved Accessibility and Reusable Components (#11118) 2025-12-28 12:20:15 -05:00
InfoHoverCard.tsx ℹ️ feat: Scrollable InfoHoverCard Content (#10693) 2025-12-11 16:37:10 -05:00
Input.tsx 🪄 refactor: UI Polish and Admin Dialog Unification (#11108) 2025-12-28 11:01:25 -05:00
InputCombobox.tsx
InputNumber.tsx
InputOTP.tsx
InputWithDropDown.tsx
Label.tsx ️ fix: Accessibility, UI consistency, dialog & avatar refactors (#9975) 2025-10-07 14:12:49 -04:00
MultiSearch.tsx
MultiSelect.tsx 🪜 fix: Layering Conflicts and UX Polish (#11177) 2026-01-02 11:43:03 -05:00
OGDialogTemplate.tsx 🔬 ci: Add TypeScript Type Checks to Backend Workflow and Fix All Type Errors (#12451) 2026-03-28 21:06:39 -04:00
OriginalDialog.tsx 📏 fix: Dropdown Menu Z-Index Adjustments (#11441) 2026-01-21 13:46:02 -05:00
Pagination.tsx 🔇 fix: Hide Button Icons from Screen Readers (#10776) 2025-12-11 16:35:17 -05:00
PixelCard.tsx
Progress.tsx
QuestionMark.tsx
Radio.tsx 🔄 refactor: Migrate to react-resizable-panels v4 with Artifacts Header polish (#12356) 2026-03-22 02:21:27 -04:00
Resizable.tsx 🔄 refactor: Migrate to react-resizable-panels v4 with Artifacts Header polish (#12356) 2026-03-22 02:21:27 -04:00
SecretInput.tsx 🔌 refactor: MCP UI with Improved Accessibility and Reusable Components (#11118) 2025-12-28 12:20:15 -05:00
Select.tsx 🪜 fix: Layering Conflicts and UX Polish (#11177) 2026-01-02 11:43:03 -05:00
SelectDropDown.tsx
Separator.tsx
Skeleton.tsx
Slider.tsx ️ fix: Accessibility, UI consistency, dialog & avatar refactors (#9975) 2025-10-07 14:12:49 -04:00
SplitText.spec.tsx 🪟 feat: DataTable update + Various UI enhancements (#9698) 2025-12-11 16:39:06 -05:00
SplitText.tsx
Switch.tsx fix: Address Accessibility Issues (#10260) 2025-10-27 19:46:43 -04:00
Table.tsx 🪟 feat: DataTable update + Various UI enhancements (#9698) 2025-12-11 16:39:06 -05:00
Tabs.tsx
Tag.tsx 🔇 fix: Hide Button Icons from Screen Readers (#10776) 2025-12-11 16:35:17 -05:00
Textarea.tsx
TextareaAutosize.tsx fix: Address Accessibility Issues (#10260) 2025-10-27 19:46:43 -04:00
ThemeSelector.tsx 🌙 fix: Accessible Contrast for Theme Switcher Icons (#11795) 2026-02-14 13:57:00 -05:00
Toast.tsx 🥂 feat: High Contrast Toasts (#11035) 2025-12-18 20:44:40 -05:00
Tooltip.css 🚧 fix: OriginalDialog Modal Tooltip and Dropdown Menu Regressions from (#10975, #10952, #11008) (#11023) 2025-12-18 09:28:27 -05:00
Tooltip.tsx 🎨 refactor: Redesign Sidebar with Unified Icon Strip Layout (#12013) 2026-03-22 01:15:20 -04:00