[GH-ISSUE #3135] [FR] Right click on View Item to open context menu #1374

Closed
opened 2026-03-23 20:48:29 +00:00 by mirror · 5 comments
Owner

Originally created by @Xazin on GitHub (Aug 7, 2023).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/3135

Originally assigned to: @LucasXu0, @Xazin on GitHub.

Description

Currently on a navigation item, only when hovering the popover button to show the context menu shows, and you can only open it by clicking the button (:).

We should refactor this so that it becomes possible to right-click anywhere on the navigation item to open the context menu.

The context menu opened with right-click should open relative to mouse.

Impact

UX

Additional Context

No response

Originally created by @Xazin on GitHub (Aug 7, 2023). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/3135 Originally assigned to: @LucasXu0, @Xazin on GitHub. ### Description Currently on a navigation item, only when hovering the popover button to show the context menu shows, and you can only open it by clicking the button (`:`). We should refactor this so that it becomes possible to right-click anywhere on the navigation item to open the context menu. The context menu opened with right-click should open relative to mouse. ### Impact UX ### Additional Context _No response_
mirror 2026-03-23 20:48:29 +00:00
Author
Owner

@dotarjun commented on GitHub (Aug 8, 2023):

working on this

<!-- gh-comment-id:1669501131 --> @dotarjun commented on GitHub (Aug 8, 2023): working on this
Author
Owner

@annieappflowy commented on GitHub (Nov 5, 2023):

Are you still working on this, @dotarjun ?

<!-- gh-comment-id:1793750769 --> @annieappflowy commented on GitHub (Nov 5, 2023): Are you still working on this, @dotarjun ?
Author
Owner

@dotarjun commented on GitHub (Nov 6, 2023):

Hey! I'm not working on this

<!-- gh-comment-id:1795152190 --> @dotarjun commented on GitHub (Nov 6, 2023): Hey! I'm not working on this
Author
Owner

@ax920 commented on GitHub (Dec 30, 2023):

Hi, I'd like to take this on

<!-- gh-comment-id:1872432167 --> @ax920 commented on GitHub (Dec 30, 2023): Hi, I'd like to take this on
Author
Owner

@Xazin commented on GitHub (Mar 6, 2024):

In case this is going to be picked up at some point, here is some information on the preferred solution:

  • Enabling Secondary Click as a Popover Trigger
  • Implementing a boolean on whether the Offset should adhere to the pointers offset on trigger, or if it should adhere to child. Eg. usePointerPosition - It should default to false so it doesn't break existing Popovers.
  • In the Listener used to track whether a click happens, we can make a check inside the onPointerDown callback, that checks whether the event.buttons is equal to kSecondaryMouseButton, similarly for the left click see kPrimaryMouseButton
  • Now for the showOverlay, it should take an optional Offset?that we can provide in case usePointerPosition is set to true.
  • Also the math for deciding where to display the Popover based on the PopoverDirection, should be different for when using the Pointer Offset, otherwise the popover will show up in odd locations.

There might also be some issues when wrapping the ViewItem in the new AppFlowyPopover, because of the rebuild that occurs if you hover over a non-selected item, and then trigger a popover which effectively removes the hover effect causing a rebuild. The rebuild should be blocked from occuring, by eg. setting resetHoverOnRebuild to false (on the FlowyHover ancestor) in case the Popover is being opened.

<!-- gh-comment-id:1980789917 --> @Xazin commented on GitHub (Mar 6, 2024): In case this is going to be picked up at some point, here is some information on the preferred solution: - Enabling Secondary Click as a Popover Trigger - Implementing a boolean on whether the Offset should adhere to the pointers offset on trigger, or if it should adhere to child. Eg. `usePointerPosition` - It should default to false so it doesn't break existing Popovers. - In the Listener used to track whether a click happens, we can make a check inside the `onPointerDown` callback, that checks whether the `event.buttons` is equal to [kSecondaryMouseButton](https://api.flutter.dev/flutter/gestures/kSecondaryMouseButton-constant.html), similarly for the left click see [kPrimaryMouseButton](https://api.flutter.dev/flutter/gestures/kPrimaryMouseButton-constant.html) - Now for the `showOverlay`, it should take an optional `Offset?`that we can provide in case `usePointerPosition` is set to `true`. - Also the math for deciding where to display the Popover based on the PopoverDirection, should be different for when using the Pointer Offset, otherwise the popover will show up in odd locations. --- There might also be some issues when wrapping the ViewItem in the new AppFlowyPopover, because of the rebuild that occurs if you hover over a non-selected item, and then trigger a popover which effectively removes the hover effect causing a rebuild. The rebuild should be blocked from occuring, by eg. setting `resetHoverOnRebuild` to false (on the `FlowyHover` ancestor) in case the Popover is being opened.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#1374
No description provided.