Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Make it show which node triggered the event when right-clicking on tree#1861

Merged
eliandoran merged 4 commits intodevelopfrom
content-menu-target
May 10, 2025
Merged

Make it show which node triggered the event when right-clicking on tree#1861
eliandoran merged 4 commits intodevelopfrom
content-menu-target

Conversation

@SiriusXT
Copy link
Copy Markdown
Member

@SiriusXT SiriusXT commented May 6, 2025

Previously, when right-clicking on the tree, it was unclear which item triggered the event. Now, a shadow is shown on the target item to indicate the source of the event.

Image
For example, the image above shows that the context menu was triggered by the "word count widget".


In addition,

  1. the check if (Date.now() - this.dateContextMenuOpenedMs > 300) was removed. Related to Note tree context menu closes immediately (Firefox-Ubuntu) Trilium#468

Based on testing, in Firefox 66, right-clicking does trigger a click event.
However, after testing a newer version (Firefox 90), the click event is no longer triggered on right-click, which indicates the issue has been resolved in Firefox.
Test code: https://jsfiddle.net/r1cawjk7/

  1. Remove delays to close the right-click menu
    Because the 100ms delay in the code still causes the click event to propagate down. Reproduction method: Open the note map in the note ribbon, select a map node, then open the content menu. Long press 'Open Note in New Tab', and release the mouse when the right-click menu closes. At this point, the click event propagates down because the click event is triggered on mouse up. Therefore, the content menu is hidden on mouseup.

@github-actions
Copy link
Copy Markdown

github-actions bot commented May 6, 2025

Folder/File Previous size New size Difference
/upload/TriliumNextNotes-Server-1861-merge-linux-x64.tar.xz 69.28MB +69.28MB (+100.00%)
TOTAL +69.28MB

@SiriusXT SiriusXT marked this pull request as draft May 6, 2025 11:49
@SiriusXT SiriusXT marked this pull request as ready for review May 6, 2025 12:48
@eliandoran eliandoran added this to the v0.94.0 milestone May 9, 2025
@eliandoran eliandoran merged commit 43d1b53 into develop May 10, 2025
11 checks passed
@eliandoran eliandoran deleted the content-menu-target branch May 10, 2025 12:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants