Skip to content
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

fix #1746: reuse contextual menu for all files #237

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

malykhinvi
Copy link
Contributor

Fix IceWhaleTech/CasaOS#1746

The problem:
The ActionButton component renders a dropdown for every file in the folder even though it is visible only after click. If there are many files in the folder, the browser might freeze.

The solution:

  1. Simplify ActionButton so that it would be just a trigger for ContextMenu component
  2. openContextMenu when user clicks ActionButton

Results:
Switching between grid view and list view.
50 txt files, macbook air m1

Before After
~458ms ~205ms
Screenshot 2024-07-31 at 21 04 35 Screenshot 2024-07-31 at 21 32 07

Copy link

@@ -227,22 +223,6 @@ export const mixin = {
type: 'is-success'
})
},
/**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed filters and methods that are not used in the code

@malykhinvi malykhinvi marked this pull request as ready for review July 31, 2024 19:53
@jerrykuku
Copy link
Contributor

I've reviewed it and it's really a very good optimisation solution.

@jerrykuku jerrykuku merged commit a625ef9 into IceWhaleTech:main Aug 5, 2024
2 checks passed
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.

[Bug] CasaOS unresponsive when trying to view files uploaded to the device
2 participants