diff --git a/package.json b/package.json index ce00acd107..dbf27a5888 100644 --- a/package.json +++ b/package.json @@ -205,7 +205,7 @@ "@lobehub/icons": "^4.0.2", "@lobehub/market-sdk": "0.29.1", "@lobehub/tts": "^4.0.2", - "@lobehub/ui": "^4.28.0", + "@lobehub/ui": "^4.29.0", "@modelcontextprotocol/sdk": "^1.25.1", "@napi-rs/canvas": "^0.1.88", "@neondatabase/serverless": "^1.0.2", diff --git a/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/index.tsx b/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/index.tsx index 67f4f35da0..4ff174f062 100644 --- a/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/index.tsx +++ b/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/index.tsx @@ -56,6 +56,7 @@ const ProfileEditor = memo(() => { style={{ marginBottom: 12 }} > { style={{ marginBottom: 12 }} > ({ popup: css` - &.${prefixCls}-select-dropdown .${prefixCls}-select-item-option-grouped { - padding-inline-start: 12px; - } - `, - select: css` - .${prefixCls}-select-selection-item { - .${TAG_CLASSNAME} { - display: none; - } - } + width: max(360px, var(--anchor-width)); `, })); +type ModelAbilities = EnabledProviderWithModels['children'][number]['abilities']; + interface ModelOption { - label: any; + abilities?: ModelAbilities; + displayName?: string; + id: string; + label: ReactNode; provider: string; value: string; } -interface ModelSelectProps extends Pick { +interface ModelSelectProps extends Pick { defaultValue?: { model: string; provider?: string }; + initialWidth?: boolean; onChange?: (props: { model: string; provider: string }) => void; requiredAbilities?: (keyof EnabledProviderWithModels['children'][number]['abilities'])[]; showAbility?: boolean; + value?: { model: string; provider?: string }; } const ModelSelect = memo( - ({ value, onChange, showAbility = true, requiredAbilities, loading, size, style, variant }) => { + ({ + value, + onChange, + initialWidth = false, + showAbility = true, + requiredAbilities, + loading, + size, + style, + variant, + }) => { const enabledList = useEnabledChatModels(); - const options = useMemo(() => { + const options = useMemo(() => { const getChatModels = (provider: EnabledProviderWithModels) => { const models = requiredAbilities && requiredAbilities.length > 0 @@ -81,34 +87,43 @@ const ModelSelect = memo( options: opts, }; }) - .filter(Boolean) as SelectProps['options']; + .filter(Boolean) as LobeSelectProps['options']; }, [enabledList, requiredAbilities, showAbility]); return ( -