Skip to content

feat(dialog): multiple recipients with per-recipient permissions - #258

Draft
skjnldsv wants to merge 10 commits into
mainfrom
feature/dialog-per-recipient-permissions
Draft

feat(dialog): multiple recipients with per-recipient permissions#258
skjnldsv wants to merge 10 commits into
mainfrom
feature/dialog-per-recipient-permissions

Conversation

@skjnldsv

Copy link
Copy Markdown
Contributor

WIP

The dialog now accepts multiple recipients: the search field is an add-only
picker and selected recipients render as a list, each with its own permission
preset selector and fine-grained toggles.

The share-level permission acts as the maximum and the default for newly added
recipients. A recipient's available presets and toggles are capped at the
permissions the share grants; toggles beyond the maximum are disabled. The
backend enforces the real cap (the sharer's own permissions on a reshare, or
the admin default).

Adds per-recipient permission methods to the Share class and API client, and
extends SharingRecipient with permission_preset + permissions.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.00%. Comparing base (ae00b1e) to head (6c48977).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/dialog/components/RecipientRow.vue 12.90% 21 Missing and 6 partials ⚠️
lib/dialog/components/RecipientList.vue 0.00% 5 Missing and 1 partial ⚠️
lib/dialog/composables/useRecipientPermissions.ts 91.83% 4 Missing ⚠️
lib/dialog/components/PermissionEditor.vue 85.71% 2 Missing ⚠️
lib/dialog/composables/useRecipientSearch.ts 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #258      +/-   ##
==========================================
+ Coverage   73.93%   75.00%   +1.06%     
==========================================
  Files          23       27       +4     
  Lines         564      656      +92     
  Branches      168      188      +20     
==========================================
+ Hits          417      492      +75     
- Misses        126      141      +15     
- Partials       21       23       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Rework the per-recipient row to match the sidebar: avatar + name + a compact
preset dropdown, and a three-dot menu that opens a small modal for full
permission editing (preset + custom toggles) plus removal.

Extract the preset selector and fine-grained toggles into a reusable
PermissionEditor component, used both for the share-level default/maximum and
inside the per-recipient modal. The editor shows an info notice when some
permissions are capped: a reshare names the owner and the permissions granted,
otherwise it states the share's maximum. Toggles above the maximum are disabled.

A reshare is detected per recipient (its initiator differs from the share
owner).

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
…ient row

- Guard recipient.permissions (the backend does not yet return per-recipient
  permissions), which previously threw on an undefined .map().
- Recipient row: drop the inline preset select; show a static preset label
  ("Can view" / "Custom permissions"), and move preset shortcuts + custom
  permissions (opens the modal) + remove into the three-dot menu.
- Hide the Invited/Anyone tab bar once a recipient (or the link) exists.
- Constrain the "Add people" field width.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Set up Playwright component testing (@playwright/experimental-ct-vue) and cover
the recipient/permission UI in a real browser:

- PermissionEditor: notice visibility, per-permission toggles, over-cap toggles
  disabled, toggles hidden outside custom mode.
- RecipientRow (via an in-browser fixture, since a Share with methods cannot be
  passed as a serialized prop): preset subtitle, remove from the menu, and the
  custom-permissions modal opening.
- RecipientList: one row per recipient, excluding the link (token).

Specs are named *.ct.ts so Vitest (which globs *.spec/*.test) ignores them.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
- Move the Playwright component tests to tests/ct/ so they are outside the
  library's rootDir (they import fixtures outside lib, which broke the build
  and ts:check).
- Add Share.setRecipientPermission / selectRecipientPreset unit tests.
- Add SharePanel tab-bar tests (hidden once a recipient exists).
- Rename the recipient remove action to "Remove participant" and add left
  padding to the recipient list.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
…m Vitest

Follow the repo convention (*.spec.ts) for the Playwright component tests and
exclude tests/ct/ from Vitest so the two runners do not collide.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
NcSelectUsers defaults to min-width: 260px and its focus box-shadow can spill
past the dialog padding, making the "Add people" control wider than the dialog.
Pin it to the container width (min-width: 0, max-width: 100%, border-box) like
the preset select.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@nextcloud/vue's multiple select (.select.vs--multiple) renders ~2px too wide
and overflows its container. Inset it by 1px on each side as a workaround until
it is fixed upstream in @nextcloud/vue.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
The multiple-select width is now fixed at the source in @nextcloud/vue
(NcSelect), so the local margin-inline workaround is no longer needed.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
9.11.0 includes the NcSelect multiple-variant width fix, so the recipient
picker no longer overflows the dialog.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
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.

1 participant