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

[VO-942] feat: Open File in New Tab (Cmd+Click or Right-Click) #3237

Merged
merged 16 commits into from
Oct 25, 2024

Conversation

cballevre
Copy link
Contributor

@cballevre cballevre commented Oct 22, 2024

### ✨ Features

* Open File in New Tab (Cmd+Click or Right-Click)

### 🔧 Tech
 
* Update cozy-ui from 111.12.0 to 111.21.0

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 :

  • Before, we would share callback function to file so it could navigate to folder with the prefix sharing
  • After, we use a relative route ../${file.id} so react-router-dom can replace the current folder with the new id
    This 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 :

  • The public viewer to open file from folder is in separate route
  • The breadcrumb is also using relative route
  • useFileLink is used to open favorite inside the navigation sidebar

Remaining works:

  • Test all navigation cases
  • Make unit tests on useFileLink to avoid repetitive testing
  • Add more extensive message to some commit

@cballevre cballevre changed the title feat: Open File in New Tab (Cmd+Click or Right-Click) [VO-942] feat: Open File in New Tab (Cmd+Click or Right-Click) Oct 22, 2024
Copy link

bundlemon bot commented Oct 22, 2024

BundleMon

Files updated (5)
Status Path Size Limits
vendors/drive.(hash).js
1.79MB (+327B +0.02%) 2MB
public/drive.(hash).js
1.56MB (+68B 0%) 1.7MB
intents/drive.(hash).js
87.66KB (+39B +0.04%) 190KB
public/drive.(hash).min.css
39.94KB (+14B +0.03%) 100KB
app/drive.(hash).js
161.12KB (-504B -0.3%) 300KB
Unchanged files (13)
Status Path Size Limits
public/pdf.worker.entry.(hash).worker.js
345.35KB 350KB
services/qualificationMigration/drive.js
282.15KB 500KB
services/dacc/drive.js
263.08KB 500KB
public/cozy-client-js.js
159.28KB 160KB
onlyOffice/slide.pptx
24.83KB 25KB
app-drive.(hash).min.css
10.73KB 56KB
intents-drive.(hash).min.css
7.89KB 40KB
onlyOffice/text.docx
5.85KB 6KB
onlyOffice/spreadsheet.xlsx
5.02KB 6KB
manifest.webapp
1.87KB 2KB
index.html
597B 1KB
intents/index.html
507B 1KB
manifest.json
185B 1KB

Total files change -57B 0%

Groups updated (4)
Status Path Size Limits
vendors/**
1.79MB (+327B +0.02%) -
public/**
2.11MB (+81B 0%) -
intents/**
88.15KB (+39B +0.04%) -
app/**
161.12KB (-504B -0.3%) -
Unchanged groups (3)
Status Path Size Limits
services/**
545.23KB -
onlyOffice/**
35.7KB -
img/**
5.85KB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@cballevre cballevre marked this pull request as ready for review October 24, 2024 15:03
@cballevre cballevre requested a review from acezard as a code owner October 24, 2024 15:03
@cballevre cballevre requested review from zatteo and Merkur39 October 24, 2024 15:05
isPublic: boolean
}

export const computeFileType = (
Copy link
Contributor Author

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

Copy link
Contributor

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

@paultranvan
Copy link
Contributor

Behold the mighty long-expected feature! ❤️

Copy link
Contributor

@zatteo zatteo left a 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 ?

@cballevre
Copy link
Contributor Author

@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

@cballevre cballevre merged commit 56161a1 into master Oct 25, 2024
4 checks passed
@cballevre cballevre deleted the feat/open-new-tab branch October 25, 2024 07:29
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.

3 participants