-
Notifications
You must be signed in to change notification settings - Fork 65
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
File openings inside new tab #2521
base: master
Are you sure you want to change the base?
Conversation
onFolderOpen(attributes.id) | ||
console.log('is directory') | ||
|
||
if (event.ctrlKey || event.metaKey || event.shiftKey) { |
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.
it seems that you build an href for a folder https://github.com/cozy/cozy-drive/pull/2521/files#diff-66f571a15fdeccd6293e111e9483d731a1d8a1bddf527123ece478a9605e12bfR121 why do you need to check the event key?
let buildHref = '' | ||
if (isFolder(file)) { | ||
buildHref = `/#${folderUrlToNavigate(file.id)}` | ||
} else if (isNote(file)) { |
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.
All these helpers method should already been in https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/file.js#L36-L50 I think
The thing I dislike here is that we still have several ways to handle navigation. Sometimes we will have an href, so we'll be able to make a right click and use browser action, sometimes not since the href will be empty. Right? |
note files are handled in createFileOpeningHandlers
bbc2279
to
5ca4236
Compare
This PR handles most of the case I found:
Handle:
But has not been cleant / tested at all.
comment about this gif:
the link below the anchor is wrong (it's the same than the file of the table cell) => ❌ you can see on the below left corner on my browser
when Cmd + Click, we have the expected feature (folder opened in a new tab) => ✅ I arrived inside the test folder
when right click, opening, we open the file instead of the folder => ❌ I arrived on the Recent gif, instead of the folder test
on click on Notes / Shortcut, this needs the big refactor "Don't use on click, use only anchor - prefetch (query?)"