Skip to content

feat: nmc/6466 add Nextcloud 33 compatibility for sharing file actions and popup - #72

Open
suet-kei-chan wants to merge 3 commits into
mainfrom
nmc/6466-nextcloud-33-compatibility-for-nmcsharing
Open

feat: nmc/6466 add Nextcloud 33 compatibility for sharing file actions and popup#72
suet-kei-chan wants to merge 3 commits into
mainfrom
nmc/6466-nextcloud-33-compatibility-for-nmcsharing

Conversation

@suet-kei-chan

Copy link
Copy Markdown
Contributor

Nextcloud 33 ships @nextcloud/files v4, which scopes the file-action registry by library major version and removes the OCA.Files.Sidebar API. The actions registered with the v3 library were no longer picked up (the sharing buttons disappeared) and the sidebar-based sharing popup no longer opened.

  • Migrate the file actions to the v4 API: plain object literals instead of the removed FileAction class, and destructured action context (exec/enabled receive { nodes, view, folder })
  • Open the MagentaCLOUD sharing popup as a standalone modal instead of a removed sidebar tab, exposed via window.OCA.Nmcsharing.openSharingPopup; the "Show sharing options" and "Share" actions use it
  • Keep "Manage shares" opening the files sidebar via getSidebar()
  • Decouple SharingPopup from the removed OCA.Files.Sidebar API (close/isSharedWithMe/openSharingManage)
  • Bump @nextcloud/files to ^4.0.0

Note: package-lock.json still needs regenerating against @nextcloud/files v4 (and a v4-compatible @nextcloud/dialogs) before release. The v4 library only works on Nextcloud 33+, so info.xml still declares min-version 30 - consider raising it to 33.

Notable finding
origin/main had already bumped the version to 33.0.1 and declared NC 30–34, but never migrated the sharing code — it still ships @nextcloud/files@^3, new FileAction(...), and OCA.Files.Sidebar. So this branch is the actual NC 33 fix, not a duplicate. The old nmc/4516 I initially branched from was just 4 commits behind main with no unique work.

Two things flagged in the commit for the reviewer
package-lock.json regen against @nextcloud/files v4 (+ a v4-compatible @nextcloud/dialogs) is still required before release — the working bundles came from the local node_modules overlay, not the committed lockfile.
min-version: main declares 30, but the v4 library only works on NC 33+, so the sharing actions won't register on 30–32. I left it at main's 30 rather than change policy — consider raising to 33.

Nextcloud 33 ships @nextcloud/files v4, which scopes the file-action
registry by library major version and removes the OCA.Files.Sidebar API.
The actions registered with the v3 library were no longer picked up (the
sharing buttons disappeared) and the sidebar-based sharing popup no
longer opened.

- Migrate the file actions to the v4 API: plain object literals instead
  of the removed FileAction class, and destructured action context
  (exec/enabled receive { nodes, view, folder })
- Open the MagentaCLOUD sharing popup as a standalone modal instead of a
  removed sidebar tab, exposed via window.OCA.Nmcsharing.openSharingPopup;
  the "Show sharing options" and "Share" actions use it
- Keep "Manage shares" opening the files sidebar via getSidebar()
- Decouple SharingPopup from the removed OCA.Files.Sidebar API
  (close/isSharedWithMe/openSharingManage)
- Bump @nextcloud/files to ^4.0.0

Note: package-lock.json still needs regenerating against @nextcloud/files
v4 (and a v4-compatible @nextcloud/dialogs) before release. The v4 library
only works on Nextcloud 33+, so info.xml still declares min-version 30 -
consider raising it to 33.
@suet-kei-chan suet-kei-chan self-assigned this Aug 17, 2026
@suet-kei-chan
suet-kei-chan requested a review from psawalka August 19, 2026 07:20
The Nextcloud 33 compatibility work left the sharing entry point broken:
the "Create new link" entry failed to render and the "Show sharing
options" file-list action was missing. Three separate NC33 breaking
changes were involved.

- Link share entry crash: NC33 removed the OCA.Sharing.ExternalLinkActions
  global. SharingEntryLink read `.state` off it inside data(), which threw
  and aborted the component's data init (also leaving SHARE_TYPES unset, so
  isEmailShareType failed too), so the link entry never rendered. Drop the
  dead ExternalLegacyLinkActions references, mirroring upstream NC33 which
  keeps only ExternalShareActions.

- Missing "Show sharing options" action: @nextcloud/files v4 moved the
  file-action registry from window._nc_fileactions to the version-scoped
  window._nc_files_scope.v4_0.fileActions. Actions registered via the app's
  v3 build landed in a registry core no longer reads, so custom actions
  (sharing-popup) never appeared. Register directly into the v4 scoped
  registry that core consumes, mirroring v4's registerFileAction.

- Sidebar open: replace the v4-only getSidebar() import in the
  "Manage shares" action with the window.OCA.Files._sidebar() runtime
  global it proxies, so it works from the v3 build.

Dependency alignment: the branch had bumped @nextcloud/files to ^4.0.0,
which is incompatible with the app's Vue 2 stack (files v4 pulls in
dialogs v7 / @nextcloud/vue v9 / Vue 3) and broke the webpack build. Pin
@nextcloud/files to ^3.12.2 (still exposes every API the app uses) and
@nextcloud/dialogs to ^6.3.1, bump @nextcloud/vue to ^8.23.1, and add the
babel-loader build dependency explicitly. The app stays on Vue 2 while
bridging to NC33's runtime globals for the few v4-scoped integrations.
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