@@ -41,6 +41,7 @@ import type {
4141 GraphMissingRefsMetadata ,
4242 GraphRefMetadataItem ,
4343 GraphRepository ,
44+ GraphSearchMode ,
4445 GraphSearchResults ,
4546 GraphSearchResultsError ,
4647 InternalNotificationType ,
@@ -83,7 +84,10 @@ import { GlFeatureBadge } from '../../shared/components/react/feature-badge';
8384import { GlFeatureGate } from '../../shared/components/react/feature-gate' ;
8485import { GlIssuePullRequest } from '../../shared/components/react/issue-pull-request' ;
8586import { GlSearchBox } from '../../shared/components/search/react' ;
86- import type { SearchNavigationEventDetail } from '../../shared/components/search/search-box' ;
87+ import type {
88+ SearchModeChangeEventDetail ,
89+ SearchNavigationEventDetail ,
90+ } from '../../shared/components/search/search-box' ;
8791import type { DateTimeFormat } from '../../shared/date' ;
8892import { formatDate , fromNow } from '../../shared/date' ;
8993import { emitTelemetrySentEvent } from '../../shared/telemetry' ;
@@ -100,6 +104,7 @@ export interface GraphWrapperProps {
100104 onChangeColumns ?: ( colsSettings : GraphColumnsConfig ) => void ;
101105 onChangeExcludeTypes ?: ( key : keyof GraphExcludeTypes , value : boolean ) => void ;
102106 onChangeGraphConfiguration ?: ( changes : UpdateGraphConfigurationParams [ 'changes' ] ) => void ;
107+ onChangeGraphSearchMode ?: ( searchMode : GraphSearchMode ) => void ;
103108 onChangeRefIncludes ?: ( branchesVisibility : GraphBranchesVisibility , refs ?: GraphRefOptData [ ] ) => void ;
104109 onChangeRefsVisibility ?: ( refs : GraphExcludedRef [ ] , visible : boolean ) => void ;
105110 onChangeSelection ?: ( rows : GraphRow [ ] ) => void ;
@@ -226,6 +231,7 @@ export function GraphWrapper({
226231 onChangeColumns,
227232 onChangeExcludeTypes,
228233 onChangeGraphConfiguration,
234+ onChangeGraphSearchMode,
229235 onChangeRefIncludes,
230236 onChangeRefsVisibility,
231237 onChangeSelection,
@@ -629,6 +635,11 @@ export function GraphWrapper({
629635 onSearchOpenInView ?.( searchQuery ) ;
630636 } ;
631637
638+ const handleSearchModeChange = ( e : CustomEvent < SearchModeChangeEventDetail > ) => {
639+ const { searchMode } = e . detail ;
640+ onChangeGraphSearchMode ?.( searchMode ) ;
641+ } ;
642+
632643 const ensureSearchResultRow = async ( id : string ) : Promise < string | undefined > => {
633644 if ( onEnsureRowPromise == null ) return id ;
634645 if ( ensuredIds . current . has ( id ) ) return id ;
@@ -1379,13 +1390,15 @@ export function GraphWrapper({
13791390 valid = { Boolean ( searchQuery ?. query && searchQuery . query . length > 2 ) }
13801391 more = { searchResults ?. paging ?. hasMore ?? false }
13811392 searching = { searching }
1393+ filter = { state . defaultSearchMode === 'filter' }
13821394 value = { searchQuery ?. query ?? '' }
13831395 errorMessage = { searchResultsError ?. error ?? '' }
13841396 resultsHidden = { searchResultsHidden }
13851397 resultsLoaded = { searchResults != null }
13861398 onChange = { e => handleSearchInput ( e ) }
13871399 onNavigate = { e => handleSearchNavigation ( e ) }
13881400 onOpenInView = { ( ) => handleSearchOpenInView ( ) }
1401+ onSearchModeChange = { e => handleSearchModeChange ( e ) }
13891402 />
13901403 < span >
13911404 < span className = "action-divider" > </ span >
@@ -1609,6 +1622,7 @@ export function GraphWrapper({
16091622 refMetadataById = { refsMetadata }
16101623 rowsStats = { rowsStats }
16111624 rowsStatsLoading = { rowsStatsLoading }
1625+ searchMode = { searchQuery ?. filter ? 'filter' : 'normal' }
16121626 shaLength = { graphConfig ?. idLength }
16131627 shiftSelectMode = "simple"
16141628 suppressNonRefRowTooltips
0 commit comments