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

Right click context menu #2134

Merged
merged 37 commits into from
May 25, 2022
Merged

Right click context menu #2134

merged 37 commits into from
May 25, 2022

Conversation

tanmoyAtb
Copy link
Contributor

@tanmoyAtb tanmoyAtb commented May 17, 2022

closes #2095

Some notes:
We have a right click(context menu) implementation here. The overall menu system took a refactor. I really wanted to use the MaterialMenu we already had, but for some reason the material menu just does not fire on the second right click. 🤷 I toyed around with it, and then decided to write a simple AnchorMenu. some of the behaviour is inspired from drive and dropbox.

I didn't add this to storage. If we feel like it should be there, I'll add that in.
Added to storage


Submission checklist:

Layout

  • Change looks good in the desktop web ui
  • Change looks good in the mobile web ui

Theme

  • Components / elements inspected in light mode
  • Components / elements inspected in dark mode

@render
Copy link

render bot commented May 17, 2022

@render
Copy link

render bot commented May 17, 2022

@render
Copy link

render bot commented May 17, 2022

@github-actions github-actions bot added the Type: Feature Added to PRs to identify that the change is a new feature. label May 17, 2022
@tanmoyAtb tanmoyAtb marked this pull request as ready for review May 17, 2022 15:25
Copy link
Contributor

@juans-chainsafe juans-chainsafe left a comment

Choose a reason for hiding this comment

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

Amazing job! is working as expected, I tested as well in mobile of course in there you don't have the right click but I checked that all is working correctly there.

PS: I think it will be a good idea to add this to storage as well, maybe not in this ticket but I can create another if you agree

@tanmoyAtb tanmoyAtb marked this pull request as draft May 18, 2022 18:03
@tanmoyAtb
Copy link
Contributor Author

I'm going to add this to storage and reopen this PR for review.

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

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

Left some minor comments in the code. The refactor with the getItemOperations brings some clarity IMHO which is great, although it's a little messy with the million params 🤷‍♂️ .

The only main problem I see is that because we don't use the "clever" menu, we end up having an unusable right click menu when we are close to the bottom of the page, and scrolling doesn't help.

bottom.mp4

@tanmoyAtb
Copy link
Contributor Author

Left some minor comments in the code. The refactor with the getItemOperations brings some clarity IMHO which is great, although it's a little messy with the million params 🤷‍♂️ .

The only main problem I see is that because we don't use the "clever" menu, we end up having an unusable right click menu when we are close to the bottom of the page, and scrolling doesn't help.

bottom.mp4

I have been able to make the AnchorMenu we have a little more clever. It should position better at the bottom and right sides now. Also, prevented scroll when menu is open (this is what the material menu does as well).

Cleaned up the item operations more and also added to storage. :D

@tanmoyAtb tanmoyAtb changed the title Feat/right click menu 2095 Right click context menu May 20, 2022
@tanmoyAtb tanmoyAtb marked this pull request as ready for review May 20, 2022 10:37
Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

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

Love the refactoring and new functionality. I checked mostly Files code, left a couple nits. I did play with Storage as well and noticed that the menu, when it appears is displayed a very brief moment at the top left before being displayed at the right position. See my video

flashing.mp4

Tbaut and others added 8 commits May 23, 2022 15:39
…leSystemItem/FileSystemItem.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
…Operations.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
…lesList.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
@lgtm-com
Copy link

lgtm-com bot commented May 23, 2022

This pull request introduces 1 alert when merging fb883ac into 7071348 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@tanmoyAtb
Copy link
Contributor Author

Love the refactoring and new functionality. I checked mostly Files code, left a couple nits. I did play with Storage as well and noticed that the menu, when it appears is displayed a very brief moment at the top left before being displayed at the right position. See my video

flashing.mp4

I was able to see the flash in Firefox a few times. Made some changes to make sure that the dropdown only appears when we have an anchor position. Please check that it works well your side.

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

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

It didn't quite make the cut and was still flashing occasionally. I added some comments to completely solve the issue, with explanations. Let me know if that makes sense, and we should replicate this in storage as well.

@tanmoyAtb
Copy link
Contributor Author

tanmoyAtb commented May 24, 2022

Thanks :) :). This was perfect insight into the problem. I've made the updates to files and storage.

@tanmoyAtb tanmoyAtb enabled auto-merge (squash) May 24, 2022 16:57
@Tbaut
Copy link
Collaborator

Tbaut commented May 25, 2022

I was still having issue, so I fought a bit and arrived at a state where I really really can't reproduce in this PR #2152 :)

* some more fixes

* cut the needless noise
Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

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

awesome awesome work, the files view is feeling great thanks to this!

@tanmoyAtb tanmoyAtb merged commit c67ac4f into dev May 25, 2022
@tanmoyAtb tanmoyAtb deleted the feat/right-click-menu-2095 branch May 25, 2022 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Added to PRs to identify that the change is a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Right-clicking on the page should serve the user with a custom menu, rather than browser page settings.
4 participants