Desktop: Fixes #13411: Fix header links only work if the note viewer is visible#13442
Merged
laurent22 merged 7 commits intolaurent22:devfrom Oct 16, 2025
Merged
Conversation
…note viewer panel is visible
… viewer is hidden This change is a proof of concept. It currently relies on a setTimeout to work around a state update timing issue. The setTimeout use should be removed before a pull request is created from this change.
|
|
||
| const editor = mainScreen.noteEditor; | ||
| await editor.expectToHaveText(''); | ||
| await editor.expectToHaveText('\n'); |
Collaborator
Author
There was a problem hiding this comment.
This change in expected test output is required due to a change to editor.expectToHaveText. Previously, newlines were not included in the content fetched from the editor.
bwat47
added a commit
to bwat47/joplin-heading-navigator
that referenced
this pull request
Nov 2, 2025
…pects joplin md viewer seems to expect that first instance of a given heading has no suffix, and the next instance has a -2 suffix (skipping -1 suffix) NOTE: ctrl clicking a heading link with a suffix in the markdown editor doesn't work (brings you to top of file), but it works fine in reading view (as long as suffix increment starts with -2 as noted above). This is probably a bug with the markdown editor, since following headings in the editor view didn't work at all until very recently, see: laurent22/joplin#13411 laurent22/joplin#13442
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
Fixes #13411 by ensuring that the
editor.jumpToHashlogic runs even when the viewer is not visible.In particular, this pull request:
v6/CodeMirror.tsx'sscrollTologic to calleditor.jumpToHasheven if the viewer is not visible.NoteEditor'suseMessageHandler: If the note viewer is hidden (only the Markdown editor is visible), emitting anoteRenderCompleteafter the editor's content is set. Previously, this event was not emitted at all when the viewer was hidden.noteRenderCompleteevent causes the logic that handlesscrollWhenReadyto run.NoteEditor'suseScrollWhenReadyOptionslogic to set the value ofscrollWhenReadysooner, so that it is set before thenoteRenderCompleteemitted in (2).This may also fix an issue in which the initial editor scroll was not set unless the note viewer was also visible.Edit: The initial editor scroll issue will be partially fixed by #13447.Testing
This pull request includes an automated Playwright test.