-
Notifications
You must be signed in to change notification settings - Fork 63
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-847] feat: Add favorite to files #3184
Conversation
BundleMonFiles updated (4)
Unchanged files (14)
Total files change +5.07KB +0.1% Groups updated (6)
Unchanged groups (1)
Final result: ✅ View report in BundleMon website ➡️ |
d210ddc
to
6fa1e2e
Compare
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.
Only mandatory change is the typo on translations, everything else is nit.
Also another nit on the refactor: Use IOCozyFile type from cozy-client
commit message: Is that related to cozy/cozy-client#1496 ? If yes, I like when those relations are specified in the commit message, so it is easy to navigate between PRs and understand why things are done and where they are used (but this is purely nit)
|
||
return ( | ||
<NavItem key={file._id}> | ||
{/* eslint-disable-next-line @typescript-eslint/no-misused-promises */} |
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.
cc @acezard you created a method to wrap promises and avoid this ESLint error, do you remember its name? I hade safePromise
in mind, but it seems not to be used in react components, so maybe it is another method?
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 is, but it's only in the react-native project, not exported
) as { | ||
data?: IOCozyFile[] | null | ||
} |
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.
nit: I would suggest avoiding inline types and instead declare them somewhere else and so you can write as SomeTypeName
instead of as { ...... }
This would ease code readability as inline types are often the main reason people find TS hard to read (because you had a block of {}
only for typing where people expect to get logic code)
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.
Well noted, I'll try to improve that in my next PR 👍
@@ -17,13 +18,14 @@ import { | |||
download, | |||
trash, | |||
rename, | |||
duplicate, |
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.
In multiple places you remove duplicate
but commit messages only talk about adding favorites
concept. Is that expected?
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's deliberate, but you're right to point it out - I should have separated it out in a separate commit. It's done with an explanation now 🙂
With the design team we decided to align the experience of the actions on a file for the Favorites, Recent, and Sharing pages. That's why I removed Duplicate because it could cause weird behaviour when you're at the end of the list.
I transferred the fields that was missing in IOCozyFile into cozy-client in this PR : cozy/cozy-client#1496
This property was used when we were displaying shared drives files as secondary nav item
This was used because JSDoc type cast doesn't work well with VSCode as the error disappear I chose to remove it
6fa1e2e
to
048a737
Compare
Remaining work :
Related PRs :