Repository navigation
fix: show "Leave share" on received shares and round the sharer avatar - #4502
Merged
Merged
Conversation
On the top folder or file of a share received from another user, the menu offered "Delete folder"/"Delete file". The server only removes the share for the recipient in that case and leaves the owner's data alone, but the label made users afraid of deleting someone else's files and hid the way to leave a share. The item is detected with the rule the app already uses for the shared-folder icon: it has the S permission and its parent folder does not. The sharer's avatar shown in the list cell share button was drawn as a square; it is now cropped to a circle like avatars elsewhere in the app. Assisted-by: Claude Code:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com> # Conflicts: # Nextcloud.xcodeproj/project.pbxproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On the top folder or file of a share received from another user, the "…" menu now says Leave share instead of "Delete folder" / "Delete file". The sharer's avatar in the list cell is now round instead of square.
Why
When a user receives a shared folder, the menu on it offered only "Delete folder" and "Remove locally". On the server, deleting the top of a received share only removes the share for the recipient (it shows up under "Deleted shares"); the owner's data is not touched. The web interface calls this "Leave this share". The old label scared users into thinking they would delete someone else's files and hid the way to leave a share.
The avatar of the user who shared an item replaces the share icon in the list cell, but it was drawn as a square.
What changed
NCMetadataPermissions.isReceivedShareRoot(permissions:parentPermissions:): an item is the top of a received share when it has theSpermission and its parent folder does not. This is the rule the app already uses for the shared-folder icon (isMetadataShareOrMounted).mountTypeis not enough: it issharedfor every item inside the share too.NCContextMenuMain.makeDeleteFileAction: shows "Leave share" with theperson.2.slashicon in that case. The action underneath is unchanged._leave_share_= "Leave share" (English only; other languages come from Transifex).NCListCell.setSharedAvatarImage(_:): crops the avatar to a circle.Tests/NextcloudUnitTests/NCReceivedShareRootTests.swift.Unchanged: multi-select delete in edit mode and the viewer's delete action. When the parent folder is not in the local database (for example a search result in a folder never opened), the menu keeps "Delete".
How to test
🤖 AI (if applicable)
Notes for reviewers
tableDirectoryformetadata.serverUrl, looked up when the menu is built.🤖 Generated with Claude Code