diff --git a/workspaces/lightspeed/.changeset/chilled-carrots-boil.md b/workspaces/lightspeed/.changeset/chilled-carrots-boil.md new file mode 100644 index 0000000000..2fa296dc4a --- /dev/null +++ b/workspaces/lightspeed/.changeset/chilled-carrots-boil.md @@ -0,0 +1,8 @@ +--- +'@red-hat-developer-hub/backstage-plugin-lightspeed': patch +--- + +Fix MCP settings panel and options dropdown behavior: + +- Keep MCP settings panel open during navigation in fullscreen mode +- Prevent options dropdown from auto-focusing first item on open diff --git a/workspaces/lightspeed/plugins/lightspeed/src/components/LightSpeedChat.tsx b/workspaces/lightspeed/plugins/lightspeed/src/components/LightSpeedChat.tsx index a5e7350270..fbeae27632 100644 --- a/workspaces/lightspeed/plugins/lightspeed/src/components/LightSpeedChat.tsx +++ b/workspaces/lightspeed/plugins/lightspeed/src/components/LightSpeedChat.tsx @@ -1111,7 +1111,9 @@ export const LightspeedChat = ({ const onNewChat = useCallback(() => { (async () => { - setIsMcpSettingsOpen(false); + if (!isFullscreenMode) { + setIsMcpSettingsOpen(false); + } if (conversationId !== TEMP_CONVERSATION_ID) { setMessages([]); setFileContents([]); @@ -1342,7 +1344,9 @@ export const LightspeedChat = ({ const onSelectActiveItem = useCallback( (_: MouseEvent | undefined, selectedItem: string | number | undefined) => { - setIsMcpSettingsOpen(false); + if (!isFullscreenMode) { + setIsMcpSettingsOpen(false); + } setNewChatCreated(false); const newConvId = String(selectedItem); setConversationId((c_id: string) => { @@ -1365,6 +1369,7 @@ export const LightspeedChat = ({ scrollToBottomRef, setCurrentConversationId, setIsMcpSettingsOpen, + isFullscreenMode, ], ); @@ -1779,7 +1784,9 @@ export const LightspeedChat = ({ selectedModel={selectedModel} models={models} onSelect={item => { - setIsMcpSettingsOpen(false); + if (!isFullscreenMode) { + setIsMcpSettingsOpen(false); + } onNewChat(); handleSelectedModel(item); }} @@ -1947,7 +1954,9 @@ export const LightspeedChat = ({ { - setIsMcpSettingsOpen(false); + if (!isFullscreenMode) { + setIsMcpSettingsOpen(false); + } onNewChat(); handleSelectedModel(item); }} diff --git a/workspaces/lightspeed/plugins/lightspeed/src/components/LightspeedChatBoxHeader.tsx b/workspaces/lightspeed/plugins/lightspeed/src/components/LightspeedChatBoxHeader.tsx index 5762bc4d21..cc18b4cdfb 100644 --- a/workspaces/lightspeed/plugins/lightspeed/src/components/LightspeedChatBoxHeader.tsx +++ b/workspaces/lightspeed/plugins/lightspeed/src/components/LightspeedChatBoxHeader.tsx @@ -176,6 +176,7 @@ export const LightspeedChatBoxHeader = ({