Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✨ feat: wrap ConversationArea and ModelSwitchPanel in TooltipGroup for enhanced UI

Innei672bcf774047
diff --git a/src/app/[variants]/(main)/chat/features/Conversation/index.tsx b/src/app/[variants]/(main)/chat/features/Conversation/index.tsx
index e0994f01f95..8df5a99aca8 100644
--- a/src/app/[variants]/(main)/chat/features/Conversation/index.tsx
+++ b/src/app/[variants]/(main)/chat/features/Conversation/index.tsx
@@ -1,3 +1,4 @@
+import { TooltipGroup } from '@lobehub/ui';
import { memo } from 'react';
import { Flexbox } from 'react-layout-kit';
@@ -12,7 +13,9 @@ const ChatConversation = memo(() => {
return (
<Flexbox height={'100%'} style={{ overflow: 'hidden', position: 'relative' }} width={'100%'}>
{showHeader && <ChatHeader />}
- <ConversationArea />
+ <TooltipGroup>
+ <ConversationArea />
+ </TooltipGroup>
</Flexbox>
);
});
diff --git a/src/features/ModelSwitchPanel/index.tsx b/src/features/ModelSwitchPanel/index.tsx
index 4bf6ffc92fb..9c80d15b0b0 100644
--- a/src/features/ModelSwitchPanel/index.tsx
+++ b/src/features/ModelSwitchPanel/index.tsx
@@ -1,4 +1,4 @@
-import { ActionIcon, Icon } from '@lobehub/ui';
+import { ActionIcon, Icon, TooltipGroup } from '@lobehub/ui';
import { Dropdown } from 'antd';
import { createStyles } from 'antd-style';
import { LucideArrowRight, LucideBolt } from 'lucide-react';
@@ -344,37 +344,39 @@ const ModelSwitchPanel = memo<ModelSwitchPanelProps>(
);
return (
- <Dropdown
- arrow={false}
- onOpenChange={handleOpenChange}
- open={isOpen}
- placement={placement}
- popupRender={() => (
- <Rnd
- className={styles.dropdown}
- disableDragging
- enableResizing={ENABLE_RESIZING}
- maxWidth={MAX_WIDTH}
- minWidth={MIN_WIDTH}
- onResizeStop={(_e, _direction, ref) => {
- const newWidth = ref.offsetWidth;
- setPanelWidth(newWidth);
- localStorage.setItem(STORAGE_KEY, String(newWidth));
- }}
- position={{ x: 0, y: 0 }}
- size={{ height: panelHeight, width: panelWidth }}
- style={{ position: 'relative' }}
- >
- <div style={{ height: panelHeight, overflow: 'auto', width: '100%' }}>
- {(renderAll ? virtualItems : virtualItems.slice(0, INITIAL_RENDER_COUNT)).map(
- renderVirtualItem,
- )}
- </div>
- </Rnd>
- )}
- >
- <div className={styles.tag}>{children}</div>
- </Dropdown>
+ <TooltipGroup>
+ <Dropdown
+ arrow={false}
+ onOpenChange={handleOpenChange}
+ open={isOpen}
+ placement={placement}
+ popupRender={() => (
+ <Rnd
+ className={styles.dropdown}
+ disableDragging
+ enableResizing={ENABLE_RESIZING}
+ maxWidth={MAX_WIDTH}
+ minWidth={MIN_WIDTH}
+ onResizeStop={(_e, _direction, ref) => {
+ const newWidth = ref.offsetWidth;
+ setPanelWidth(newWidth);
+ localStorage.setItem(STORAGE_KEY, String(newWidth));
+ }}
+ position={{ x: 0, y: 0 }}
+ size={{ height: panelHeight, width: panelWidth }}
+ style={{ position: 'relative' }}
+ >
+ <div style={{ height: panelHeight, overflow: 'auto', width: '100%' }}>
+ {(renderAll ? virtualItems : virtualItems.slice(0, INITIAL_RENDER_COUNT)).map(
+ renderVirtualItem,
+ )}
+ </div>
+ </Rnd>
+ )}
+ >
+ <div className={styles.tag}>{children}</div>
+ </Dropdown>
+ </TooltipGroup>
);
},
);