fix: Display correct right click menu in file viewer 🐛#3598
Merged
Conversation
BundleMonFiles updated (2)
Unchanged files (19)
Total files change +439B +0.01% Groups updated (1)
Unchanged groups (2)
Final result: ✅ View report in BundleMon website ➡️ |
rezk2ll
reviewed
Oct 31, 2025
20b6822 to
5dbb04b
Compare
db6187c to
95a3576
Compare
rezk2ll
requested changes
Nov 4, 2025
src/modules/actions/helpers.js
Outdated
Comment on lines
+29
to
+36
| export const driveActionsToContextMenuActions = (driveActions = []) => { | ||
| return driveActions.filter(driveAction => { | ||
| const action = Object.values(driveAction)[0] | ||
| return ( | ||
| action.displayInContextMenu === undefined || action.displayInContextMenu | ||
| ) | ||
| }) | ||
| } |
Member
There was a problem hiding this comment.
i liked the displayInContextMenu solution to handle displaying the action in context menu and top bar.
however this function needs a little refactoring,
- the name is off, it suggest it does some converting or mutation, instead it's just a filter. you can rename it to
getContextMenuActions - L33 check is weird, you can just check the explicit value:
!== false - missing JSDoc
- add unit tests for this helper
you can make it more clean like this:
/**
* Returns the context menu visible actions
*
* @param {Object[]} actions - the list of actions
* @returns {Object[]} - the list of actions to be displayed
*/
export const getContextMenuActions = (actions = []) =>
actions.filter(action =>
Object.values(action)[0]?.displayInContextMenu !== false
)80922d6 to
6d385b8
Compare
6d385b8 to
88ae675
Compare
rezk2ll
approved these changes
Nov 5, 2025
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.
Change:
In file viewer, we need to display
RightClickFileMenuinstead ofRightClickAddMenu.Results:
Normal file viewer:
Shared drive file viewer: