Skip to content

fix(editor): open missing journal links from shortcut#12663

Merged
tiensonqin merged 1 commit into
masterfrom
logseq/fix-journal-shortcut-blank-page
May 15, 2026
Merged

fix(editor): open missing journal links from shortcut#12663
tiensonqin merged 1 commit into
masterfrom
logseq/fix-journal-shortcut-blank-page

Conversation

@tiensonqin
Copy link
Copy Markdown
Contributor

@tiensonqin tiensonqin commented May 15, 2026

Summary

  • create missing page refs when following links with the editor shortcut
  • check the worker DB before creating, so pages not yet present in the UI DB still open normally
  • add shortcut coverage for existing UI pages, missing pages, and worker-only pages

Root cause

follow-link-under-cursor! redirected directly to a page title. When a journal page created by /date was 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-test

related to logseq/db-test#879

Copilot AI review requested due to automatic review settings May 15, 2026 11:53
@tiensonqin tiensonqin force-pushed the logseq/fix-journal-shortcut-blank-page branch from 27b6fb4 to 72b6ccd Compare May 15, 2026 11:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread src/main/frontend/handler/editor.cljs
@tiensonqin tiensonqin merged commit 302f798 into master May 15, 2026
10 checks passed
@tiensonqin tiensonqin deleted the logseq/fix-journal-shortcut-blank-page branch May 15, 2026 11:59
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.

2 participants