feat(editor): improve markdown insert tools#1040
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the markdown editing experience by adding a dedicated link-insert dialog (with internal page suggestions) and improving editor formatting tools (inline code shortcut, table insertion UI, and more robust wrap/unwrap behavior).
Changes:
- Added a new Link Insert dialog, registered in the global dialog registry and invokable via toolbar and
Mod+K. - Expanded editor hotkeys via
useToolbarActions(inline code + link dialog) and CodeMirror keymap (inline code). - Improved formatting utilities: table size picker in the toolbar, new
replaceSelectioneditor API, and smarter wrap/unwrap logic ininsertWrappedText.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/leafwiki-ui/src/lib/registries/index.tsx | Registers the new link insert dialog type and renderer in the global dialog registry. |
| ui/leafwiki-ui/src/features/editor/useToolbarActions.tsx | Adds hotkeys for inline code and opening the link dialog. |
| ui/leafwiki-ui/src/features/editor/PageEditor.tsx | Wires new toolbar actions (inline code) and provides an openLinkDialog handler. |
| ui/leafwiki-ui/src/features/editor/MarkdownToolbar.tsx | Adds table size picker UI, updates link behavior to open the dialog, and adds inline code button. |
| ui/leafwiki-ui/src/features/editor/MarkdownEditor.tsx | Extends the editor ref API with replaceSelection to support dialog-driven insertions. |
| ui/leafwiki-ui/src/features/editor/MarkdownCodeEditor.tsx | Adds `Mod-`` shortcut and updates CM styling for horizontal scrolling/non-wrapping behavior. |
| ui/leafwiki-ui/src/features/editor/LinkInsertDialog.tsx | Introduces the new dialog UI with internal page suggestions and keyboard handling. |
| ui/leafwiki-ui/src/features/editor/editorCommands.ts | Improves wrap/unwrap behavior when toggling formatting around selections. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
perber
force-pushed
the
feat/editor-insert-tools
branch
from
May 24, 2026 17:08
9b917f2 to
53bdfb3
Compare
Add a link insert dialog with internal page suggestions and keyboard support. Improve toolbar formatting actions with inline code shortcuts, a table size picker, and more predictable wrap and unwrap behavior in the editor.
perber
force-pushed
the
feat/editor-insert-tools
branch
from
May 24, 2026 17:34
53bdfb3 to
24b2bbc
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.
Add a link insert dialog with internal page suggestions and keyboard support.
Improve toolbar formatting actions with inline code shortcuts, a table size picker, and more predictable wrap and unwrap behavior in the editor.