-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desktop: Fixes #10199: Rich text editor: Include "ctrl-click to open" in link tooltips #10547
Merged
laurent22
merged 6 commits into
laurent22:dev
from
personalizedrefrigerator:pr/desktop/tinymce-link-click-tooltip
Jun 11, 2024
Merged
Desktop: Fixes #10199: Rich text editor: Include "ctrl-click to open" in link tooltips #10547
laurent22
merged 6 commits into
laurent22:dev
from
personalizedrefrigerator:pr/desktop/tinymce-link-click-tooltip
Jun 11, 2024
Conversation
This file contains 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
This is a potential fix for laurent22#10199. This particular fix displays a custom tooltip, in addition to the OS tooltip. The custom tooltip is shown above the target element, while the OS tooltip (at least on my Linux system) is shown below. After this, I plan to work on a different fix that changes the content of the OS tooltip, and changes it back before saving. This would be a similar approach to laurent22#10359, except change the content in the rich text editor, rather than in `turndown`. This has the advantage of also working for HTML notes.
Comment on lines
37
to
39
element.title = _('cmd+click to open: %s', element.title || element.href); | ||
} else { | ||
element.title = _('ctrl+click to open: %s', element.title || element.href); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Handle the case where a link is a note.
- Handle the case where the link is a resource.
- Not working -- resource ID not present. See Attachments not watched for changes when opened from the Rich Text Editor #10551.
- It should be possible to fix this with changes made in Desktop: Fixes #10551: Watch resources for changes when opened from the Rich Text Editor #10554.
- Also check for HTML notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personalizedrefrigerator
changed the title
Desktop: Fixes #10199: Rich text editor: Include "ctrl+click to open" in link tooltips
Desktop: Fixes #10199: Rich text editor: Include "ctrl-click to open" in link tooltips
Jun 10, 2024
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/useLinkTooltips.ts
Outdated
Show resolved
Hide resolved
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
This pull request adds a "ctrl+click to open" prompt to the beginning of tooltips shown in the rich text editor. This prefix is removed before saving. On MacOS, the prompt reads "cmd+click to open". This pull request has not yet been tested on MacOS.
See this commit for an alternate fix.
Resolves #10199.
Screenshots
Hovering over a web link shows "ctrl+click to open: http://URL here" or "ctrl+click to open: title here" if the link has a user-set title.
Hovering over a note link shows "Ctrl-click to open: joplin://some-note-id-here":
Hovering over a resource link shows "Ctrl-click to open", then the path to the item in Joplin's resource directory:
Titles are also changed in HTML notes:
Possible improvements
Testing plan
This has been tested successfully on Ubuntu 24.04.