Skip to content

feat: jump to search - #2453

Merged
Philipinho merged 12 commits into
mainfrom
feat/jump-to-search
Sep 5, 2026
Merged

Philipinho merged 12 commits into
mainfrom
feat/jump-to-search

Conversation

@salihudickson

@salihudickson salihudickson commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

closes: #2436

Video demo:

Screen.Recording.2026-08-29.at.22.39.10.mov

@salihudickson salihudickson changed the title jump to search init feat: jump to search Aug 29, 2026
@salihudickson
salihudickson marked this pull request as ready for review August 29, 2026 23:14
@salihudickson
salihudickson requested review from Philipinho and a lite review from Copilot August 29, 2026 23:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]);
@Philipinho
Philipinho merged commit 84e1e56 into main Sep 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search result does not jump to the matching section of the page

3 participants