🤯 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.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
💄 style: Pre render ModelSwitchPanel (#9499)
sxjeru840382b5b50d
diff --git a/src/features/ChatInput/ActionBar/components/ActionDropdown.tsx b/src/features/ChatInput/ActionBar/components/ActionDropdown.tsxindex 38a43c7edd9..3a14dddb2b6 100644--- a/src/features/ChatInput/ActionBar/components/ActionDropdown.tsx+++ b/src/features/ChatInput/ActionBar/components/ActionDropdown.tsx@@ -23,16 +23,36 @@ export interface ActionDropdownProps extends DropdownProps {maxHeight?: number | string;maxWidth?: number | string;minWidth?: number | string;+ /**+ * 是否在挂载时预渲染弹层,避免首次触发展开时的渲染卡顿+ */+ prefetch?: boolean;}const ActionDropdown = memo<ActionDropdownProps>(- ({ menu, maxHeight, minWidth, maxWidth, children, placement = 'top', ...rest }) => {+ ({+ menu,+ maxHeight,+ minWidth,+ maxWidth,+ children,+ placement = 'top',+ prefetch = false,+ destroyOnHidden,+ forceRender,+ ...rest+ }) => {const { cx, styles } = useStyles();const isMobile = useIsMobile();+ const dropdownForceRender = prefetch ? true : forceRender;+ const dropdownDestroyOnHidden = prefetch ? false : destroyOnHidden;+return (<Dropdownarrow={false}+ destroyOnHidden={dropdownDestroyOnHidden}+ forceRender={dropdownForceRender}menu={{...menu,className: cx(styles.dropdownMenu, menu.className),diff --git a/src/features/ModelSwitchPanel/index.tsx b/src/features/ModelSwitchPanel/index.tsxindex 51031c7ecbd..133fdee4a46 100644--- a/src/features/ModelSwitchPanel/index.tsx+++ b/src/features/ModelSwitchPanel/index.tsx@@ -161,6 +161,7 @@ const ModelSwitchPanel = memo<IProps>(({ children, onOpenChange, open }) => {onOpenChange={onOpenChange}open={open}placement={'topLeft'}+ prefetch>{icon}</ActionDropdown>