-
Notifications
You must be signed in to change notification settings - Fork 275
fix(amazonq): add custom modal dropdown for model selection #6120
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
Conversation
.../jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/Browser.kt
Outdated
Show resolved
Hide resolved
|
Can you add user experience demo to this PR? |
.../jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/Browser.kt
Outdated
Show resolved
Hide resolved
Replaces native select element with a custom modal dropdown to fix visibility issues where the dropdown menu was getting cut off at the bottom. Implementation includes: - Modal overlay to ensure proper display above chat UI - Dynamic font sizing based on model name length - Stable positioning to prevent shifting when changing selections Note: Temporary workaround that could be refined with future iterations.
ed71d4e to
dcb775a
Compare
| transform: rotate(180deg) !important; | ||
| } | ||
| /* Modal overlay - covers entire screen */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we do it without overlay?
| function replaceSelectWithCustomDropdown() { | ||
| const selectElements = document.querySelectorAll('select.mynah-form-input'); | ||
| console.log('[JB Modal Dropdown] Found', selectElements.length, 'select elements'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it still only this dropdown?
| trigger.className = 'jb-custom-select-trigger'; | ||
| const selectedText = document.createElement('span'); | ||
| selectedText.textContent = select.options[select.selectedIndex]?.text || 'Select model'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This text should not be customized for a single dropdown
|
Closing in favor of #6136. Replaced the modal overlay approach with direct fixed positioning - simpler code and better performance. The new PR also addresses the review feedback about the hardcoded "Select model" fallback text, while also reducing the overall size of the dropdown. The new PR also addresses the issue where the arrow on the right of the models was being cut off. |
Types of changes
Description
The model selection dropdown in Amazon Q chat was getting cut off at the bottom, showing only 2-3 out of 4 available models. This was caused by overflow clipping in the JCEF webview environment.
Solution:
Implemented a custom modal dropdown that replaces the native
<select>element specifically for model selection. The modal overlay approach ensures the dropdown appears above all other UI elements withoutz-index conflicts.
Key features:
Before: Dropdown cut off, showing only 2-3 options
After: All 4 model options visible in centered modal
Note: This is a temporary workaround. Future improvements could include migrating to a proper mynah-ui component or refining the positioning logic.
Demo :
Screen.Recording.2025-11-21.at.2.48.43.PM.mov
Screen.Recording.2025-12-01.at.7.59.08.AM.mov
Checklist
customer-facing in the IDE. (Will add)
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.
CHANGELOG entry to add:
Fixed