fix(lightspeed): disable model selector during active chat sessions#3690
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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3690 +/- ##
=======================================
Coverage 54.28% 54.29%
=======================================
Files 2347 2347
Lines 89650 89644 -6
Branches 25062 25068 +6
=======================================
+ Hits 48666 48670 +4
+ Misses 40724 40714 -10
Partials 260 260
*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:
|
|
❌ The last analysis has failed. |
|
Cc: @HusneShabbir if you get time please check if atleast functionality is working properly. As it is first pr by |
HusneShabbir
left a comment
There was a problem hiding this comment.
@its-mitesh-kumar I agree that this is an edge-case scenario, but I think it's worth addressing as well.
When the model dropdown is open and a message is sent, it's still possible to change the model mid-conversation. Please refer to the recording below.
It would be great if we could handle this case too and prevent the model from being changed while a conversation is in progress.
cc: @karthikjeeyar / @rohitkrai03
Summary
Fixes RHDHBUGS-3313
Bug: Switching the model in an active conversation incorrectly opens a new chat instead of staying in the current session.
Root cause: The model selector's
onSelecthandler inLightSpeedChat.tsxunconditionally calledonNewChat(), creating a new conversation every time the model was changed — even mid-conversation.Fix:
messages.length > 0)onNewChat()call from the model selector'sonSelecthandlerChanges
LightSpeedChat.tsxmessages.length > 0; removeonNewChat()fromonSelect; passdisabledTooltippropMessageBarModelSelector.tsxdisabledTooltipprop; wrap dropdown in<Tooltip>when disabledref.tsmodelSelector.disabledTooltiptranslation keyde.ts,es.ts,fr.ts,it.ts,ja.tsreport-alpha.api.mdUI before changes
The model selector is clickable mid-conversation and switching models creates a new chat
UI after changes
The model selector is disabled once a message is sent, showing a tooltip on hover
Test plan
yarn tsc:fullpasses with no errorsyarn buildpasses