fix(editor): open missing journal links from shortcut#12663
Merged
Conversation
27b6fb4 to
72b6ccd
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the editor “follow link under cursor” shortcut (mod+o) so that journal (and other page) links that aren’t yet present in the UI DB don’t open as blank pages. It does this by resolving the target page against the worker DB first (when missing locally) and only creating the page if it’s missing from both.
Changes:
- Added async page-following logic to resolve a page via worker DB before redirecting, and create the page if it doesn’t exist.
- Updated
follow-link-under-cursor!to use the new page-following helper for non-URL links. - Added test coverage for following links to (1) existing UI pages, (2) missing pages, and (3) pages present only in the worker DB.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/main/frontend/handler/editor.cljs |
Adds async page resolution/creation path when following editor links via shortcut. |
src/test/frontend/handler/editor_test.cljs |
Adds shortcut-focused tests covering existing/missing/worker-only page link behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Root cause
follow-link-under-cursor!redirected directly to a page title. When a journal page created by/datewas not yet present in the renderer DB, the route opened as a blank page instead of creating or resolving the page first.Test plan
rtk bb dev:test -v frontend.handler.editor-testrelated to logseq/db-test#879