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.

💄 fix(model-list): improve search bar layout and add square variant to tabs (#16279)

Innei5686be81500d
diff --git a/src/features/ModelSwitchPanel/components/Toolbar.tsx b/src/features/ModelSwitchPanel/components/Toolbar.tsx
index ba314753e9e..677104f26fe 100644
--- a/src/features/ModelSwitchPanel/components/Toolbar.tsx
+++ b/src/features/ModelSwitchPanel/components/Toolbar.tsx
@@ -26,23 +26,29 @@ export const Toolbar = memo<ToolbarProps>(
align="center"
className={styles.toolbar}
gap={4}
+ justify="space-between"
paddingBlock={8}
paddingInline={8}
+ width="100%"
>
- <SearchBar
- allowClear
- placeholder={t('ModelSwitchPanel.searchPlaceholder')}
- size="small"
- style={{ flex: 1 }}
- value={searchKeyword}
- variant="borderless"
- onChange={(e) => onSearchKeywordChange(e.target.value)}
- onKeyDown={stopPropagation}
- />
+ <Flexbox flex={1} width="100%">
+ <SearchBar
+ allowClear
+ placeholder={t('ModelSwitchPanel.searchPlaceholder')}
+ size="small"
+ style={{ width: '100%' }}
+ styles={{ input: { width: '100%' } }}
+ value={searchKeyword}
+ variant="borderless"
+ onChange={(e) => onSearchKeywordChange(e.target.value)}
+ onKeyDown={stopPropagation}
+ />
+ </Flexbox>
{showGroupModeSwitch && (
<Tabs
activeKey={groupMode}
size="small"
+ style={{ minWidth: 0, width: 'fit-content' }}
items={[
{
key: 'byModel',
diff --git a/src/routes/(main)/settings/provider/features/ModelList/index.tsx b/src/routes/(main)/settings/provider/features/ModelList/index.tsx
index 0ca09155da9..a998746af60 100644
--- a/src/routes/(main)/settings/provider/features/ModelList/index.tsx
+++ b/src/routes/(main)/settings/provider/features/ModelList/index.tsx
@@ -140,6 +140,7 @@ const Content = memo<ContentProps>(({ id }) => {
items={tabs}
size="small"
style={{ marginBottom: 12, marginLeft: -6 }}
+ variant="square"
onChange={setActiveTab}
/>
<EnabledModelList activeTab={currentActiveTab} />