-
Notifications
You must be signed in to change notification settings - Fork 68
Fix/add button behavior #3353
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
Fix/add button behavior #3353
Conversation
BundleMonFiles updated (2)
Unchanged files (19)
Total files change +1.91KB +0.04% Groups updated (1)
Unchanged groups (2)
Final result: ✅ View report in BundleMon website ➡️ |
isSelectionBarVisible={isSelectionBarVisible} | ||
isPublic={false} | ||
refreshFolderContent={(): void => { | ||
// No action needed in virtual folders |
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.
refreshFolderContent
should not be present though, isn't it? Is it required?
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.
you're correct that FavoritesView itself, being a virtual folder driven by a query, doesn't require a manual refresh action after creating items.
the refreshFolderContent prop is necessary here because the AddMenuProvider
component passes this prop down to its children, specifically ActionMenuContent
. ActionMenuContent
.
let me know if this makes sense
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.
Ok so having refreshFolderContent
undefined will throw an error, where refreshFolderContent={() => {}}
will not? If it's the case, I think a proper comment would be empty function needed because this props is required
or something like that
Did you try in sharing context? It is a important thing to do regularly when working on layout and core elements in cozy-drive. For example :
Sometime also to test with read write permissions. I don't say that you need to try every case here but it is an important thing to have in mind. But looks good overall! |
@zatteo My review is ✅ , I let you validate when you're ok too. |
src/helpers/permissions.js
Outdated
* @param {object} folder - The folder object (presumably io.cozy.files type). | ||
* @returns {boolean} True if the folder is shared and the user cannot write to it, false otherwise. | ||
*/ | ||
export const isReadOnlySharedFolder = folder => { |
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.
You do not use this 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.
yes. Deleted
The Add button (Create folder, Upload files) now remains visible in the sidebar when using desktop mode, improving user accessibility to these common actions. When users perform creation actions from virtual folders (Recent, Sharings) or Trash, the actions are automatically redirected to the root Files folder. After successful redirection and completion, the user is navigated to the Files folder to see their results. Regular actions within Files or its subfolders continue to work as before.
Update the create button (FAB) on mobile to match desktop behavior: - Show create button on all folder screens - When in virtual folders (Favorites, Recent, etc.), allow creating folders and uploading files to root Files folder - Implement NavContext to manage this behavior across different views This improves the consistency of user experience between mobile and desktop interfaces.
- Added initialDirId logic to handle invalid displayedFolder - Removed unnecessary hasWriteAccess check in AddMenuProvider - Improved code clarity by removing redundant comments - Fixed navigation with proper lastClicked state updates - Updated error handling condition for encrypted folder - Improved folder refresh implementation - Simplified upload success logic for better readability
Update AddMenu components to properly handle creation actions when working with shared folders. Improve user experience by ensuring all creation options behave correctly in shared context. Also add helper functions to support this functionality.
a395d33
to
525a50b
Compare
Update the create button: