Skip to content
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

🔧 fix: Ariakit Combobox Virtualization #5851

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

danny-avila
Copy link
Owner

Summary:

I resolved virtualization issues in the Ariakit Combobox within LibreChat by replacing the conflicting react-virtualized implementation with the experimental SelectRenderer from @ariakit/react-core. I updated the dependencies and refactored the component’s state management and styling to improve performance and ensure smoother focus handling.

  • Replaced react-virtualized’s AutoSizer and List with SelectRenderer to resolve scrolling and focus management conflicts.
  • Updated dependency versions (@ariakit/react to ^0.4.15 and added @ariakit/react-core) to leverage the latest virtualization improvements.
  • Configured combobox state using useComboboxStore and select state using useSelectStore for clearer state handling.
  • Adjusted component styling and button width logic to reliably support both collapsed and expanded states.
  • Improved performance by reducing render overhead and eliminating conflicts between automated focusing and virtualization.

Change Type:

  • Bug fix (non-breaking change which fixes an issue)

Testing:

  • Manually verified that the combobox displays options correctly in both collapsed and expanded modes.
  • Confirmed that focus management and scrolling behave as expected in a virtualized environment.
  • Ensured that the updated dependencies and state management integrate smoothly without introducing new warnings.

Checklist:

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules

Ariakit Combobox was not working well with several virtualization libraries as automated focus management was conflicting with scrolling/styling required of other virtualization methods. The entire strategy was replaced using experimental ariakit virtualization component `SelectRenderer`

Performance of component was also improved as a result of latest ariakit lib changes
@danny-avila danny-avila merged commit 28fe121 into main Feb 13, 2025
6 checks passed
@danny-avila danny-avila deleted the fix/combobox-virtualization branch February 13, 2025 15:07
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.

1 participant