-
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
[VO-942] feat: Open File in New Tab (Cmd+Click or Right-Click) #3237
Conversation
2822fb9
to
c30fb61
Compare
BundleMonFiles updated (5)
Unchanged files (13)
Total files change -57B 0% Groups updated (4)
Unchanged groups (3)
Final result: ✅ View report in BundleMon website ➡️ |
With the use of relative paths for opening files and breadcrumbs, we no longer need any specific code to handle Recent or Sharing pages
This commit also add a separate route for the public viewer inside public folder. This change allows you to use the same navigation as everywhere else in Drive with the relative paths
This allows you to take advantage of the default behaviour of browsers
c30fb61
to
e3d8a73
Compare
isPublic: boolean | ||
} | ||
|
||
export const computeFileType = ( |
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.
@paultranvan I'd like to take this opportunity to point you to this function where you'll find a good number of paths to files on drive
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.
Nice! This might be worth moving it to cozy-client file's models, as we might have the use elsewhere
Behold the mighty long-expected feature! ❤️ |
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.
Looks very nice and clean. Did you try on the flagship app ?
@zatteo I did a quick test of the notes on the flagship app. It opens the Notes app in a new webview and when you come back it returns to Drive. So nice that flagship app interprets opened link so we can remove custom code inside others applications |
By creating this new feature, I've completely redefined the way we trigger navigation in Drive. Now we
rely heavily on
react-router-dom
and its relative route mechanism. We're also benefiting from advances in the amiral application, which is capable of interpreting open links and redirecting them to the right applications. This allows us to make the code generic while adapting to the opening context. For example, to open a folder in the Sharing tab :sharing
../${file.id}
so react-router-dom can replace the current folder with the new idThis limit the props drilling and reduce code.
The main commit is d70ba45. The commit before are the preparation and adaptation of code after. Some noteworthy changes are :
useFileLink
is used to open favorite inside the navigation sidebarRemaining works:
Test all navigation casesMake unit tests onuseFileLink
to avoid repetitive testingAdd more extensive message to some commit