Skip to content

fix: show "Leave share" on received shares and round the sharer avatar - #4502

Merged
marinofaggiana merged 2 commits into
masterfrom
fix/leave-share-label
Nov 27, 2026
Merged

marinofaggiana merged 2 commits into
masterfrom
fix/leave-share-label

Conversation

@marinofaggiana

Copy link
Copy Markdown
Member

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 the S permission and its parent folder does not. This is the rule the app already uses for the shared-folder icon (isMetadataShareOrMounted). mountType is not enough: it is shared for every item inside the share too.
  • NCContextMenuMain.makeDeleteFileAction: shows "Leave share" with the person.2.slash icon in that case. The action underneath is unchanged.
  • New string _leave_share_ = "Leave share" (English only; other languages come from Transifex).
  • NCListCell.setSharedAvatarImage(_:): crops the avatar to a circle.
  • Unit tests: 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

  1. As user A, share a folder with user B.
  2. Log in as B. In list view, the share button of that folder shows A's avatar as a circle.
  3. Open the "…" menu on the folder: it shows Leave share, not "Delete folder".
  4. Tap it: the folder disappears for B; A still has the folder and all its files.
  5. Share another folder and open it as B: the "…" menu on a file inside still says "Delete file".
  6. B's own folders still say "Delete folder".

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI
Notes for reviewers
  • Not built or run by the assistant; the author verifies build, tests and behaviour on a live instance.
  • The parent permissions come from tableDirectory for metadata.serverUrl, looked up when the menu is built.
  • The circular crop runs each time the cell sets the avatar (128 px image), which is cheap; the image cache keeps the original avatar.

🤖 Generated with Claude Code

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
@marinofaggiana
marinofaggiana merged commit c4b4e73 into master Nov 27, 2026
6 checks passed
@marinofaggiana
marinofaggiana deleted the fix/leave-share-label branch November 27, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant