Skip to content

Commit 5ea29b0

Browse files
Fix search bar for Model and MCP Catalog (kubeflow#2567)
* add fix for the searchbar Made-with: Cursor Signed-off-by: Philip Colares Carneiro <philip.colares@gmail.com> * fix the mcp catalog search placeholder Signed-off-by: Philip Colares Carneiro <philip.colares@gmail.com> --------- Signed-off-by: Philip Colares Carneiro <philip.colares@gmail.com>
1 parent 8f5d780 commit 5ea29b0

5 files changed

Lines changed: 31 additions & 13 deletions

File tree

clients/ui/frontend/src/app/pages/mcpCatalog/screens/McpCatalogSourceLabelSelector.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,21 @@ const McpCatalogSourceLabelSelector: React.FC<McpCatalogSourceLabelSelectorProps
8383
{...(toolbarClearAllProps ?? {})}
8484
>
8585
<ToolbarContent rowWrap={{ default: 'wrap' }}>
86-
<Flex>
87-
<ToolbarToggleGroup breakpoint="md" toggleIcon={<FilterIcon />}>
88-
<ToolbarGroup variant="filter-group" gap={{ default: 'gapMd' }} alignItems="center">
89-
<ToolbarItem>
86+
<Flex style={{ flex: 1 }}>
87+
<ToolbarToggleGroup style={{ flex: 1 }} breakpoint="md" toggleIcon={<FilterIcon />}>
88+
<ToolbarGroup
89+
style={{ flex: 1 }}
90+
variant="filter-group"
91+
gap={{ default: 'gapMd' }}
92+
alignItems="center"
93+
>
94+
<ToolbarItem style={{ flex: 1 }}>
9095
<ThemeAwareSearchInput
9196
data-testid="mcp-catalog-search-input"
9297
aria-label="Search with submit button"
9398
className="toolbar-fieldset-wrapper"
94-
placeholder="Search MCP servers..."
99+
placeholder="Search by name, keyword, or description"
95100
value={inputValue}
96-
style={{ width: '100%', maxWidth: '600px' }}
97101
onChange={handleSearchInputChange}
98102
onSearch={handleSearchInputSearch}
99103
onClear={handleClear}

clients/ui/frontend/src/app/pages/modelCatalog/screens/ModelCatalogSourceLabelSelector.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,22 @@ const ModelCatalogSourceLabelSelector: React.FC<ModelCatalogSourceLabelSelectorP
131131
: {})}
132132
>
133133
<ToolbarContent rowWrap={{ default: 'wrap' }}>
134-
<Flex>
135-
<ToolbarToggleGroup breakpoint="md" toggleIcon={<FilterIcon />}>
136-
<ToolbarGroup variant="filter-group" gap={{ default: 'gapMd' }} alignItems="center">
137-
<ToolbarItem>
134+
<Flex style={{ flex: 1 }}>
135+
<ToolbarToggleGroup style={{ flex: 1 }} breakpoint="md" toggleIcon={<FilterIcon />}>
136+
<ToolbarGroup
137+
variant="filter-group"
138+
style={{ flex: 1 }}
139+
gap={{ default: 'gapMd' }}
140+
alignItems="center"
141+
className="toolbar-fieldset-wrapper"
142+
>
143+
<ToolbarItem style={{ flex: 1 }}>
138144
<ThemeAwareSearchInput
139145
data-testid="search-input"
140146
aria-label="Search with submit button"
141147
className="toolbar-fieldset-wrapper"
142148
placeholder="Filter by name, description and provider"
143149
value={inputValue}
144-
style={{
145-
minWidth: '600px',
146-
}}
147150
onChange={handleSearchInputChange}
148151
onSearch={handleSearchInputSearch}
149152
onClear={handleClear}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.toolbar-fieldset-wrapper {
2+
flex: 1 1 0;
3+
min-width: 0;
4+
5+
> .pf-v6-c-input-group__item:not(.pf-m-search-action) {
6+
flex: 1 1 0;
7+
min-width: 0;
8+
}
9+
}

clients/ui/frontend/src/app/pages/modelRegistry/screens/components/FormFieldset.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useThemeContext } from 'mod-arch-kubeflow';
22
import React, { CSSProperties, ReactNode } from 'react';
3+
import './FormFieldset.scss';
34

45
interface FormFieldsetProps {
56
component: ReactNode;

clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ThemeAwareSearchInput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const ThemeAwareSearchInput: React.FC<ThemeAwareSearchInputProps> = ({
4141
data-testid={dataTestId}
4242
style={{
4343
...style,
44+
width: '100%',
4445
paddingBlockStart: 'var(--pf-t--global--spacer--control--vertical--default)',
4546
paddingBlockEnd: 'var(--pf-t--global--spacer--control--vertical--default)',
4647
}}

0 commit comments

Comments
 (0)