Repository navigation
feat: jump to search - #2453
Merged
Merged
feat: jump to search#2453
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Implements “jump to search” by carrying matched terms from global search results into the page editor via URL parameters, then automatically opening a lightweight search navigation UI that highlights matches and scrolls to the current one.
Changes:
- Extend editor search-and-replace to support multiple search terms and an optional whole-word matching mode.
- Add backend + client search response fields (
matchedText,wholeWord) and pass them into page URLs as query params. - Add an editor-side “search navigation” dialog that opens on page load and scrolls to the current highlighted match.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/editor-ext/src/lib/search-and-replace/search-and-replace.ts | Adds multi-term + whole-word regex support and new commands for controlling search state. |
| apps/server/src/core/search/search.service.ts | Extracts matchedText from highlight markup and adds wholeWord to the search result payload. |
| apps/server/src/core/search/dto/search-response.dto.ts | Extends search response DTO with matchedText and wholeWord. |
| apps/client/src/features/search/types/search.types.ts | Extends client search result type with matchedText and wholeWord. |
| apps/client/src/features/search/components/search-result-item.tsx | Builds page links that include matched terms + match mode in query params. |
| apps/client/src/features/page/page.utils.ts | Adds helpers to append search query params (q, m) when building page URLs. |
| apps/client/src/features/editor/page-editor.tsx | Reads search query params and dispatches an event to open the search navigation dialog after sync. |
| apps/client/src/features/editor/components/search-and-replace/search-navigation-dialog.tsx | New dialog that navigates next/prev match and scrolls the current match into view. |
| apps/client/src/features/editor/components/search-and-replace/search-and-replace-dialog.tsx | Updates editor search command usage to the new multi-term API. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+143
to
+147
| if (!result.highlight) { | ||
| result.matchedText = []; | ||
| return result; | ||
| } | ||
|
|
Comment on lines
+420
to
+438
| const appliedSearchRef = useRef(false); | ||
| const searchQueries = searchParams.getAll("q"); | ||
| const match = searchParams.get("m"); | ||
|
|
||
| useEffect(() => { | ||
| if (!editor || editor.isDestroyed) return; | ||
| if (showStatic || !isSynced) return; | ||
| if (!searchQueries.length || appliedSearchRef.current) return; | ||
| if (!editor || editor.isDestroyed || !editor.view.dom.isConnected) return; | ||
|
|
||
| appliedSearchRef.current = true; | ||
|
|
||
| document.dispatchEvent( | ||
| new CustomEvent("openSearchNavigationDialog", { | ||
| detail: { searchTerms: searchQueries, wholeWord: match === "whole" }, | ||
| }) | ||
| ); | ||
|
|
||
| }, [editor, isSynced, showStatic, searchQueries]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes: #2436
Video demo:
Screen.Recording.2026-08-29.at.22.39.10.mov