Skip to content

feat(files_sharing): unified sharing sidebar and dialog - #62593

Open
skjnldsv wants to merge 4 commits into
masterfrom
feature/sidebar-sharing-dialog
Open

feat(files_sharing): unified sharing sidebar and dialog#62593
skjnldsv wants to merge 4 commits into
masterfrom
feature/sidebar-sharing-dialog

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Jul 27, 2026

Copy link
Copy Markdown
Member

Replaces the share editor in the files sidebar with the unified sharing UI: a single flat list of shares, and the Vue 3 sharing dialog from @nextcloud/sharing for creating and editing them.

What changed

  • Sidebar: one flat list ordered by permission, instead of the Internal/External sections. A share with several recipients renders as an expandable group with stacked avatars; every row shows its permission, and each recipient shows its own. Destructive actions live in the overflow menu.
  • Dialog: reached through an OCA.Sharing bridge — the Vue 3 entry point registers it, the (still Vue 2) sidebar calls it. Once files_sharing is Vue 3 the bridge can go and the library be imported directly.
  • Off by default: the whole thing stays behind sharing.unified_api_enable, which is off and now documented in the config sample. Turning it on is left to a follow-up.
  • Bumps @nextcloud/sharing to 1.0.0-beta.2.
  • Raises the unified sharing API's rate limits, which were set low enough that the dialog tripped them on its own.

Known gap

Legacy shares (oc_share) do not appear in the new list until a ISharingLegacyBackend is registered, which is backend work outside this PR. That is one of the reasons the feature stays off by default here; the frontend needs no change when the backend lands.

Testing

  • npx vitest run apps/files_sharing — 104 unit tests, including the sidebar refresh and the delete/remove guards.
  • NOCOVERAGE=0 ./autotest.sh sqlite apps/sharing/tests/CapabilitiesTest.php — pins the API to off by default.
  • npx playwright test --project=sharing — 34 new end-to-end tests: opening the sidebar, listing and grouping, the row actions, creating and editing shares (including declined confirmations and editing a link share), plus whole journeys such as sharing with a group and then granting one person more than the group. Which sidebar the tab renders is instance-wide state, so all sharing specs now run in one serial project; the share editor specs turn the API off for their worker.

These caught a regression in this branch: the share detail listeners had been camel-cased, which Vue 2 does not match against the hyphenated events the entries emit, so the previous share editor stopped opening.

Notes for the reviewer

  • Recipients cannot list the shares addressed to them through the unified API yet, so the tests assert what the share owner sees.
  • The share-level permission select rebuilds its options whenever the share re-syncs, which detaches its open dropdown. A click that lands while that happens hits whatever is underneath — in one test run it silently toggled "Note to recipients". Worth a look, separately from this PR.
  • The API's write endpoints allowed one call per one to five seconds, which the dialog exceeds by itself, so they are now sized per minute from the flows that use them. The per-recipient permission endpoint had no limit at all and got one. The end-to-end tests run against the real limiter rather than switching it off.

AI disclosure

This pull request was written with AI assistance (Claude Code); every commit carries an Assisted-by trailer. The code was reviewed by me before submission.

@provokateurin

Copy link
Copy Markdown
Member

#63565

@skjnldsv skjnldsv reopened this Aug 26, 2026
@skjnldsv

Copy link
Copy Markdown
Member Author

this is more than a killswitch :)

@skjnldsv skjnldsv added 2. developing Work in progress feature: sharing team: Files Code maintained by 📁 Files team labels Aug 26, 2026
@skjnldsv
skjnldsv force-pushed the feature/sidebar-sharing-dialog branch 5 times, most recently from f97c68f to 6c27e20 Compare August 27, 2026 12:19
@skjnldsv skjnldsv changed the title feat(files_sharing): unified sharing dialog in the sidebar (killswitched) feat(files_sharing): unified sharing dialog in the sidebar Aug 27, 2026
@skjnldsv
skjnldsv force-pushed the feature/sidebar-sharing-dialog branch 2 times, most recently from a78b50a to fe038c3 Compare September 3, 2026 03:07
@skjnldsv skjnldsv changed the title feat(files_sharing): unified sharing dialog in the sidebar feat(files_sharing): unified sharing sidebar and dialog, enabled by default Sep 3, 2026
@skjnldsv
skjnldsv marked this pull request as ready for review September 3, 2026 07:54
@skjnldsv
skjnldsv requested review from a team as code owners September 3, 2026 07:54
@skjnldsv
skjnldsv requested review from Altahrim, icewind1991, kristian-zendato, provokateurin, sorbaugh and susnux and removed request for a team September 3, 2026 07:54
@skjnldsv skjnldsv added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 3, 2026
@skjnldsv
skjnldsv force-pushed the feature/sidebar-sharing-dialog branch from 1fcafb0 to 83bb056 Compare September 3, 2026 08:01
Comment thread lib/private/Sharing/SharingManager.php Outdated
@skjnldsv
skjnldsv force-pushed the feature/sidebar-sharing-dialog branch from 83bb056 to 8822e13 Compare September 3, 2026 09:57
@skjnldsv skjnldsv changed the title feat(files_sharing): unified sharing sidebar and dialog, enabled by default feat(files_sharing): unified sharing sidebar and dialog Sep 3, 2026
Comment thread apps/files_sharing/src/components/AvatarStack.vue Outdated
Comment thread apps/files_sharing/src/sharing-dialog-bridge.ts
susnux

This comment was marked as resolved.

@provokateurin
provokateurin self-requested a review September 3, 2026 12:20
@skjnldsv

skjnldsv commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

Also sad to see new vue components not directly written in <script setup lang="ts"> meaning we will have to refactor all of them again to enable vapor mode with Vue 3.

Right, I was thinking of vue2, but I forgot the last versions were supporting a nice setup approach, let me adjust! 👍

@skjnldsv

skjnldsv commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

I am not sure I like that this puts part of files sharing into non-legacy bundle.

I think, until we rewrite and drop the legacy part of the sharing sidebar, I don't wanna touch the clean sharing app :)

@provokateurin

Copy link
Copy Markdown
Member

I don't wanna touch the clean sharing app

I think it's also good to not add this code that is files-specific to an app that is not files-specific.

Replace the share editor in the files sidebar with the unified sharing UI: one
flat list of shares ordered by permission, where a share with several recipients
renders as an expandable group showing each recipient's own permission, and
destructive actions live in the overflow menu.

Creating and editing a share opens the Vue 3 dialog from `@nextcloud/sharing`.
The sidebar is still Vue 2, so the dialog is reached through an `OCA.Sharing`
bridge that the Vue 3 entry point registers; once files_sharing is Vue 3 the
bridge can go and the library be imported directly.

The new components are written as `<script setup lang="ts">`, which Vue 2.7
supports and other components of this app already use, so they will not need
rewriting for Vue 3.

The whole thing stays behind `sharing.unified_api_enable`, which is off by
default and is now documented in the config sample. Enabling it is left to a
follow-up.

Signed-off-by: Barthelemy Briand <barthelemy.briand@nextcloud.com>
Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Every write endpoint allowed one call per one to five seconds, which the sharing
dialog exceeds on its own: it creates a draft when it opens, adds a recipient
per pick, and fans a preset change out over one request per permission. Size the
limits per minute from those flows instead, keep the tighter one on regenerating
a token, and add the missing limit on the per-recipient permission endpoint.

Signed-off-by: Barthelemy Briand <barthelemy.briand@nextcloud.com>
Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
files_sharing is symlinked into the Vue 3 frontend for its bridge entry point,
which also handed its Vue 2 sources to that project's lint and test configs. The
Vue 3 lint config rejects the hyphenated event listeners Vue 2 requires, so
following it broke the share editor, and its Vitest project picked the Vue 2
specs up a second time. Exclude the app from both; the legacy frontend already
covers it with the rules that match the code.

Sharing specs also move to their own serial Playwright project: which sidebar
the sharing tab renders is instance-wide state, so the unified specs and the
share editor specs cannot run beside each other.

Finally, ignore the worker teardown error Vitest raises when a worker still has
console output in flight as it shuts down. It fails a run in which every test
passed, and which files trip it only depends on how they are spread over the
workers.

Signed-off-by: Barthelemy Briand <barthelemy.briand@nextcloud.com>
Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv
skjnldsv force-pushed the feature/sidebar-sharing-dialog branch from 8822e13 to 2abae94 Compare September 3, 2026 13:25
Unit tests for the share list, its refresh and its delete guards, and a case
pinning the API to off by default.

End to end, 34 tests over opening the sidebar, listing and grouping, the row
actions, and creating and editing shares, including the destructive paths where
a confirmation is declined. On top of those, whole journeys: sharing with a
group and then granting one person more than the group, a link beside an invited
share, abandoning the dialog, and narrowing a single recipient.

The specs turn the API on for their worker, while the share editor specs keep it
off. Recipients cannot list the shares addressed to them through the API yet, so
the tests assert what the share owner sees. The rate limiter is left on so the
specs also stand as the check that its limits are livable.

Signed-off-by: Barthelemy Briand <barthelemy.briand@nextcloud.com>
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

3. to review Waiting for reviews AI assisted enhancement feature: sharing team: Files Code maintained by 📁 Files team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants