Skip to content

fix: Display correct right click menu in file viewer 🐛#3598

Merged
lethemanh merged 1 commit intomasterfrom
display-correct-right-click-menu-in-file-viewer
Nov 5, 2025
Merged

fix: Display correct right click menu in file viewer 🐛#3598
lethemanh merged 1 commit intomasterfrom
display-correct-right-click-menu-in-file-viewer

Conversation

@lethemanh
Copy link
Copy Markdown
Contributor

Change:

In file viewer, we need to display RightClickFileMenu instead of RightClickAddMenu.

Results:

Normal file viewer:

CleanShot 2025-10-31 at 15 46 43@2x

Shared drive file viewer:

CleanShot 2025-10-31 at 15 40 52@2x

@bundlemon
Copy link
Copy Markdown

bundlemon bot commented Oct 31, 2025

BundleMon

Files updated (2)
Status Path Size Limits
static/js/main.(hash).js
156.93KB (+315B +0.2%) -
public/static/js/public.(hash).js
124.02KB (+124B +0.1%) -
Unchanged files (19)
Status Path Size Limits
static/js/(chunkId).(hash).js
971.02KB -
static/js/cozy.(hash).js
906.65KB -
public/static/js/(chunkId).(hash).js
905.5KB -
public/static/js/cozy.(hash).js
771.96KB -
(hash).js
336.11KB -
public/(hash).js
336.11KB -
services/qualificationMigration.js
281.49KB -
services/dacc.js
261.47KB -
public/static/js/lib-react.(hash).js
39.24KB -
static/js/lib-react.(hash).js
39.24KB -
public/static/css/cozy.(hash).css
33.65KB -
static/css/cozy.(hash).css
33.65KB -
public/static/js/lib-router.(hash).js
21.86KB -
static/js/lib-router.(hash).js
21.86KB -
static/css/main.(hash).css
17.01KB -
public/static/css/public.(hash).css
6.7KB -
manifest.webapp
3.04KB -
index.html
691B -
assets/manifest.json
185B -

Total files change +439B +0.01%

Groups updated (1)
Status Path Size Limits
**/*.js
6.92MB (+439B +0.01%) -
Unchanged groups (2)
Status Path Size Limits
**/*.{png,svg,ico}
2.19MB -
**/*.css
127.85KB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@lethemanh lethemanh force-pushed the display-correct-right-click-menu-in-file-viewer branch from 20b6822 to 5dbb04b Compare November 3, 2025 04:36
@lethemanh lethemanh requested a review from rezk2ll November 3, 2025 04:36
@lethemanh lethemanh force-pushed the display-correct-right-click-menu-in-file-viewer branch 2 times, most recently from db6187c to 95a3576 Compare November 3, 2025 10:27
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
)
})
}
Copy link
Copy Markdown
Member

@rezk2ll rezk2ll Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
  )

@lethemanh lethemanh force-pushed the display-correct-right-click-menu-in-file-viewer branch 2 times, most recently from 80922d6 to 6d385b8 Compare November 4, 2025 09:56
@lethemanh lethemanh requested a review from rezk2ll November 4, 2025 09:58
@lethemanh lethemanh force-pushed the display-correct-right-click-menu-in-file-viewer branch from 6d385b8 to 88ae675 Compare November 5, 2025 06:53
@lethemanh lethemanh merged commit 2ac2df3 into master Nov 5, 2025
4 checks passed
@lethemanh lethemanh deleted the display-correct-right-click-menu-in-file-viewer branch November 5, 2025 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants