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+chore: Resolve Overflow in Settings Modal & Upgrade to Headless UI 2.0 #2661

Merged
merged 41 commits into from
Jul 10, 2024

Conversation

techwithanirudh
Copy link
Contributor

@techwithanirudh techwithanirudh commented May 10, 2024

Summary

This pull request resolves a visibility issue within the settings modal where dropdown options were obscured due to the overflow: auto CSS property. The migration to Headless UI 2.0, with its new portal feature, effectively counters this problem by rendering dropdown elements outside their bounding container, ensuring they display fully.

Detailed Description

Previously, the settings modal was implemented using Radix UI, which did not support the necessary features to overcome the overflow limitations that were causing dropdown elements to be clipped. The update to Headless UI 2.0 brings a solution through the use of portals, which manage overflow issues by rendering components in a separate DOM node outside of the CSS overflow context.

This update required the settings modal to be rewritten in Headless UI to take advantage of the new portal feature. Furthermore, due to breaking changes introduced by the upgrade to Headless UI 2.0, other parts of the application that utilized Headless UI 1.0 also needed updates to maintain functionality and coherence across the board.

Change Type

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

Testing

N/A

Test Configuration:

N/A

Checklist

Please delete any irrelevant options.

  • 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
  • Local unit tests pass with my changes

@techwithanirudh techwithanirudh changed the title fix: dropdown overflow chore: Upgrade to Headless UI 2.0 May 11, 2024
@techwithanirudh techwithanirudh marked this pull request as ready for review May 12, 2024 08:56
@techwithanirudh
Copy link
Contributor Author

@danny-avila Could you please review this P.R?

@techwithanirudh techwithanirudh changed the title chore: Upgrade to Headless UI 2.0 🔧 fix+chore: Resolve Overflow in Settings Modal & Upgrade to Headless UI 2.0 May 12, 2024
@danny-avila
Copy link
Owner

Can you potentially address the failing frontend tests?

https://greenonsoftware.com/articles/testing/testing-and-mocking-resize-observer-in-java-script/

@techwithanirudh
Copy link
Contributor Author

Can you potentially address the failing frontend tests?

https://greenonsoftware.com/articles/testing/testing-and-mocking-resize-observer-in-java-script/

@danny-avila Could you help me on this?

@danny-avila
Copy link
Owner

Can you potentially address the failing frontend tests?
https://greenonsoftware.com/articles/testing/testing-and-mocking-resize-observer-in-java-script/

@danny-avila Could you help me on this?

seems to be an issue with headless-ui:

tailwindlabs/headlessui#2832

@techwithanirudh
Copy link
Contributor Author

Closed, due to HeadlessUI

@techwithanirudh techwithanirudh marked this pull request as draft May 15, 2024 03:54
@techwithanirudh
Copy link
Contributor Author

techwithanirudh commented Jul 9, 2024

@danny-avila Could you review this P.R?

The issue with hanging tests in HeadlessUI seems to have been resolved by this pull request: HeadlessUI PR #3357. As a result, the tests are now passing.

@techwithanirudh techwithanirudh marked this pull request as ready for review July 9, 2024 05:47
@danny-avila danny-avila merged commit 03fe361 into danny-avila:main Jul 10, 2024
2 checks passed
danny-avila added a commit that referenced this pull request Aug 5, 2024
… UI 2.0 (#2661)

* fix: dropdown overflow

* fix: make dropdown work on mobile

* feat: update headlessui to 2.0 and use portal

* feat: rewrite modal using headlessui

* fix: applying of maxHeight

* fix: optimize backdrop for dark mode

* fix: rendering dropdown width

* feat: match small screen layout to radix-ui dialog

* revert: mobile modifications

* fix: modal animations

* fix: z-index

* chore: Migrate from HeadlessUI 1.0 to 2.0

* fix: h2 nesting

* fix: use lighter border for PopoverButtons

* feat: Move modal to the top if using a small screen

* fix: mobile position

* fix: frontend tests

* feat: use row layout in mobile instead of col

* fix: remove config path from tsconfig

* fix: fix dropdown tests (gpt4o ftw!)

* feat: Upgrade to latest headlessui version

* fix:test1

* fix: ThemeSelector test

* fix: re-add speech tab

* style: use pl and pr-3

* fix: speech tab dropdowns

* style: use maxHeight for language

* feat: convert DropdownNoState to v2.0

* fix: use v2 params for voiceDropdown

* style: reduce maxHeight for VoiceDropdown and set fixed width

* chore: rebuild package-lock

* style(fix): copy over the same styles for the settingsTab

* style(fix): use -top-1 for speech tabs

* style(fix): use max-w-[400px]

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
kenshinsamue pushed a commit to intelequia/LibreChat that referenced this pull request Sep 17, 2024
… UI 2.0 (danny-avila#2661)

* fix: dropdown overflow

* fix: make dropdown work on mobile

* feat: update headlessui to 2.0 and use portal

* feat: rewrite modal using headlessui

* fix: applying of maxHeight

* fix: optimize backdrop for dark mode

* fix: rendering dropdown width

* feat: match small screen layout to radix-ui dialog

* revert: mobile modifications

* fix: modal animations

* fix: z-index

* chore: Migrate from HeadlessUI 1.0 to 2.0

* fix: h2 nesting

* fix: use lighter border for PopoverButtons

* feat: Move modal to the top if using a small screen

* fix: mobile position

* fix: frontend tests

* feat: use row layout in mobile instead of col

* fix: remove config path from tsconfig

* fix: fix dropdown tests (gpt4o ftw!)

* feat: Upgrade to latest headlessui version

* fix:test1

* fix: ThemeSelector test

* fix: re-add speech tab

* style: use pl and pr-3

* fix: speech tab dropdowns

* style: use maxHeight for language

* feat: convert DropdownNoState to v2.0

* fix: use v2 params for voiceDropdown

* style: reduce maxHeight for VoiceDropdown and set fixed width

* chore: rebuild package-lock

* style(fix): copy over the same styles for the settingsTab

* style(fix): use -top-1 for speech tabs

* style(fix): use max-w-[400px]

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
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