fix(lightspeed): disable model selector in active chat sessions#3685
Open
its-mitesh-kumar wants to merge 1 commit into
Open
Conversation
Fixes: https://redhat.atlassian.net/browse/RHDHBUGS-3313 Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Changed Packages
|
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3685 +/- ##
=======================================
Coverage 54.28% 54.28%
=======================================
Files 2347 2347
Lines 89650 89656 +6
Branches 25020 25025 +5
=======================================
+ Hits 48666 48670 +4
- Misses 39456 39457 +1
- Partials 1528 1529 +1
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Disable the model selector once an active chat session has started (messages exist in the conversation). When disabled, hovering over the selector shows a tooltip: "Each chat session supports only one model. To switch models, open a new chat." This prevents the confusing behavior where switching models mid-conversation would open a new chat thread.
Root cause
The
MessageBarModelSelectorcomponent'sonSelecthandler unconditionally calledonNewChat()when a model was chosen, creating a new conversation. The selector was only disabled during streaming (isSendButtonDisabled), but remained enabled for conversations that already had messages.The fix disables the selector when
messages.length > 0(conversation has content) and wraps it in aTooltipexplaining the restriction. The tooltip message is fully localized in all 6 supported languages.Fixed
Checklist
Made with Cursor