-
Notifications
You must be signed in to change notification settings - Fork 16
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
Disabled select on row names & enhance simple click experience #1438
Conversation
Your Render PR Server URL is https://storage-ui-stage-pr-1438.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c4a4o21t9dsarmtl7aj0. |
Your Render PR Server URL is https://gaming-ui-stage-pr-1438.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c4a4o2ht9dsarmtl7avg. |
Your Render PR Server URL is https://files-ui-stage-pr-1438.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c4a4o31t9dsarmtl7b90. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with the selection is fixed perfectly, however with 150ms, this makes the double click way too quick, I barely manage to have a double click now, and the single click is still too slow.
I thought we could change our approach completely and use something like https://stackoverflow.com/a/66515641
We don't really care if the single click event is fired because it's only a selection, so if there's a double click, then it'll select and navigate/show preview.
What do you think?
Ahh ok, 150 was just the number that fit the people I tried it out on, nice find on that example there, I'll test it out n refactor if feasible |
@Tbaut So the one issue I think we might run into is using the switch case, that it would trigger single click & double click actions One option if this becomes an issue is to trigger the execution, alternatively being able to cancel the single click action if double is triggered |
Yup, this is the behavior I meant to address with my
So I don't think it's actually a problem, but we should check how it behaves in real life to be certain it's really not an issue.. |
Ahh ok rad, yeah just thinking of use beyond our row selection but granted use cases where theres a single and a double tied to the same item are usually select or execute behaviours |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a great UX improvement for the simple click, and the double click just works fine from my tests 🎉
packages/storage-ui/src/Components/Modules/FileSystemItem/FileSystemItem.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
…SystemItem.tsx Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Rad! Thanks for the nifty approach, didn't realise events have context of other events |
This is a nice improvement Ryan, the single click feels way better now 😃 |
Can you please check the tests @RyRy79261 one seems to fail for valid reasons 🤷♂️
|
if (clickCount === 1) { | ||
actionSingleClick && actionSingleClick(event) | ||
const onClick = useCallback((e?: React.MouseEvent) => { | ||
if (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OMG! this is a gem! 💎
The events had the info all along!
How come the internet's full of these hook implementations!!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tbaut Found this magic trick 🔥
I can't believe I only found this out now 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol it's new for all of us, I didn't know either! Just I saw that Dropbox def. didn't have any timeout because their experience was great, and found that thing on wonderful SO :D
@Tbaut @RyRy79261 I took a quick look at this. It's a genuine failure but looks unrelated to Ryan's change. Files that shouldn't be there are present so when asserting that only the recovered folder exists it will fail because it sees other files. The additional files that can be seen on the screenshot were not added during the test and the test begins with |
closes #1415