File tree Expand file tree Collapse file tree
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/search-replace Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -391,16 +391,10 @@ export function WorkflowSearchReplace() {
391391 afterReplaceIndexRef . current = null
392392
393393 if ( queryChanged || justOpened || ! activeMatchId ) {
394- // Intentional navigation: query changed, panel just opened, or nothing was
395- // ever selected (e.g. hydration resolved after open with no matches) — go to first match.
396394 handleSelectMatch ( hydratedMatches [ 0 ] . id )
397395 } else if ( replaceIndex !== null ) {
398- // Replace button was clicked: advance to the match now at the same position (clamped),
399- // which is the next match after the one that was just replaced.
400396 handleSelectMatch ( hydratedMatches [ Math . min ( replaceIndex , hydratedMatches . length - 1 ) ] . id )
401397 } else {
402- // Content edited manually — don't steal focus or switch panels.
403- // Deselect so the user can navigate explicitly with the arrow keys.
404398 setActiveMatchId ( null )
405399 usePanelEditorSearchStore . getState ( ) . setActiveSearchTarget ( null )
406400 }
@@ -419,7 +413,6 @@ export function WorkflowSearchReplace() {
419413 const handleMoveActiveMatch = ( delta : number ) => {
420414 if ( hydratedMatches . length === 0 ) return
421415 if ( activeMatchIndex < 0 ) {
422- // Nothing selected: ↓ goes to first match, ↑ goes to last.
423416 handleSelectMatch ( hydratedMatches [ delta > 0 ? 0 : hydratedMatches . length - 1 ] . id )
424417 return
425418 }
You can’t perform that action at this time.
0 commit comments