feat(codemirror): add search / replace support#992
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds CodeMirror search/replace support to the LeafWiki Markdown editor, including keyboard shortcuts, theme styling for the search UI, and E2E coverage to guard expected behavior.
Changes:
- Add
@codemirror/searchand enable search panels/keybindings inMarkdownCodeEditor. - Add a dedicated replace-panel shortcut (
Ctrl+H) and style the search/replace panel to match app theming. - Update global hotkey handling to avoid interfering with CodeMirror’s search panel; add Playwright tests for replace-all and Escape behavior.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ui/leafwiki-ui/src/features/editor/useToolbarActions.tsx | Refactors where the editor-focus shouldHandle helper is defined for hotkeys. |
| ui/leafwiki-ui/src/features/editor/MarkdownCodeEditor.tsx | Enables CodeMirror search/replace, adds replace-panel shortcut, search keymap, and panel styling. |
| ui/leafwiki-ui/src/components/HotKeyHandler.tsx | Skips global hotkeys when CodeMirror search UI is handling keys. |
| ui/leafwiki-ui/package.json | Adds @codemirror/search dependency. |
| ui/leafwiki-ui/package-lock.json | Locks @codemirror/search dependency resolution. |
| e2e/tests/page.spec.ts | Adds E2E tests for search/replace and Escape behavior. |
| e2e/pages/EditPage.ts | Adds page-object helpers to open/operate the search/replace panel. |
Files not reviewed (1)
- ui/leafwiki-ui/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
99c9bc8 to
bc50643
Compare
bc50643 to
cf955e1
Compare
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.
No description provided.