diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorerFilters.tsx b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorerFilters.tsx index e423e614c3a51..5ea9541724606 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorerFilters.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorerFilters.tsx @@ -26,7 +26,7 @@ export const AssetGraphExplorerFilters = React.memo( const visibleReposSet = React.useMemo(() => new Set(visibleRepos), [visibleRepos]); const reposFilter = useStaticSetFilter({ - name: 'Repository', + name: 'Code location', icon: 'repo', allValues: allRepos.map((repo) => ({ key: repo.repository.id, diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorerSidebar.tsx b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorerSidebar.tsx index 0fbd52f2cd8a1..ab92b335d0c1d 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorerSidebar.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorerSidebar.tsx @@ -9,13 +9,13 @@ import { Menu, MenuItem, Popover, - TextInput, MiddleTruncate, useViewport, MenuDivider, Spinner, ButtonGroup, Tooltip, + Suggest, } from '@dagster-io/ui-components'; import {useVirtualizer} from '@tanstack/react-virtual'; import React from 'react'; @@ -84,7 +84,7 @@ export const AssetGraphExplorerSidebar = React.memo( if (!assetGraphData.nodes[id]) { try { const path = JSON.parse(id); - const nextOpsQuery = `${explorerPath.opsQuery} \"${tokenForAssetKey({path})}\"`; + const nextOpsQuery = `\"${tokenForAssetKey({path})}\"`; onChangeExplorerPath( { ...explorerPath, @@ -447,7 +447,7 @@ const Node = ({ const newQuery = `\"${tokenForAssetKey({path})}\"*`; const nextOpsQuery = explorerPath.opsQuery.includes(newQuery) ? explorerPath.opsQuery - : `${explorerPath.opsQuery} ${newQuery}`; + : newQuery; onChangeExplorerPath( { ...explorerPath, @@ -462,7 +462,7 @@ const Node = ({ const newQuery = `*\"${tokenForAssetKey({path})}\"`; const nextOpsQuery = explorerPath.opsQuery.includes(newQuery) ? explorerPath.opsQuery - : `${explorerPath.opsQuery} ${newQuery}`; + : newQuery; onChangeExplorerPath( { ...explorerPath, @@ -517,7 +517,7 @@ const Node = ({ style={{ width: '100%', borderRadius: '8px', - ...(isSelected ? {background: Colors.LightPurple} : {}), + ...(isSelected ? {background: Colors.Blue50} : {}), }} >
- +
@@ -654,7 +654,7 @@ const BoxWrapper = ({level, children}: {level: number; children: React.ReactNode 0 ? {side: 'left', width: 1, color: Colors.KeylineGray} : undefined} > {sofar} @@ -677,63 +677,32 @@ const SearchFilter = ({ values: {label: string; value: T}[]; onSelectValue: (e: React.MouseEvent, value: T) => void; }) => { - const [searchValue, setSearchValue] = React.useState(''); - const filteredValues = React.useMemo(() => { - if (searchValue) { - return values.filter(({label}) => label.toLowerCase().includes(searchValue.toLowerCase())); - } - return values; - }, [searchValue, values]); - const {viewport, containerProps} = useViewport(); return ( - - - {filteredValues.length ? ( - filteredValues.map((value) => ( - { - onSelectValue(e, value.value); - setSearchValue(''); - }} - text={value.label} - /> - )) - ) : ( - No results - )} - - - ) : ( -
- ) - } - > -
- { - setSearchValue(e.target.value); - }} - placeholder="Search assets" - {...(containerProps as any)} - /> -
- + + + key="asset-graph-explorer-search-bar" + inputProps={{placeholder: 'Search', style: {width: `min(100%, ${viewport.width}px)`}}} + items={values} + inputValueRenderer={(item) => item.label} + itemPredicate={(query, item) => + item.label.toLocaleLowerCase().includes(query.toLocaleLowerCase()) + } + menuWidth={viewport.width} + popoverProps={{usePortal: false, fill: true}} + itemRenderer={(item, itemProps) => ( + itemProps.handleClick(e)} + key={item.label} + text={item.label} + /> + )} + noResults={} + onItemSelect={(item, e) => onSelectValue(e as any, item.value)} + selectedItem={null} + /> + ); }; @@ -741,6 +710,7 @@ const ExpandMore = styled.div``; const GrayOnHoverBox = styled(Box)` border-radius: 8px; + cursor: pointer; &:hover { background: ${Colors.Gray100}; transition: background 100ms linear; @@ -766,3 +736,9 @@ const ButtonGroupWrapper = styled.div` function nodeId(node: {path: string; id: string} | {id: string}) { return 'path' in node ? node.path : node.id; } + +const SuggestWrapper = styled.div` + .bp4-input-group.dagster-suggest-input { + width: 100%; + } +`;