Server Actions Integration for File Provider Extension#9469
Conversation
f7584a3 to
83f5703
Compare
83f5703 to
270c823
Compare
|
The code changes cannot be tested against a Nextcloud server with client integrations capability right now due to the only known host having unrelated service problems which prevent the file provider extension from working. Though, this should be it. |
|
I found out this can very verified easily by setting up a local Docker container and install the contacts and analytics apps in Nextcloud server. Then the capabilities are automatically exposed and we are ready to go. |
270c823 to
913d377
Compare
|
I have a working implementation now and want to wait for the checks and Copilot review. Further, I introduced logging in the FinderSync extension on the side and fixed its socket file resolution which is broken in the release candidate. |
There was a problem hiding this comment.
Pull request overview
This pull request implements server actions integration for the macOS File Provider extension, enabling context menu items defined by the server to be displayed in Finder for files managed by the File Provider. The implementation uses XPC (Cross-Process Communication) to communicate between the File Provider extension and the main desktop application, building on previous work in PR #9403 and replacing earlier attempts (#9458 and #9461).
Changes:
- Added XPC protocol method to communicate file action requests from File Provider extension to main app
- Integrated server capability checks to determine which files should display the "File actions" context menu item based on MIME type filters
- Extended FileActionsModel to support file provider scenarios without sync folders by accepting optional fileId and remoteItemPath parameters
- Migrated FinderSync extensions from NSLog to os_log for better logging infrastructure
- Updated dependency on NextcloudCapabilitiesKit to version 2.5.0 to support new context menu filtering capabilities
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/gui/systray.h/cpp | Added methods to handle file provider file actions dialog creation with support for non-sync-folder scenarios |
| src/gui/owncloudgui.cpp | Connected File Provider service signal to systray slot for displaying file actions dialog |
| src/gui/macOS/fileproviderservice.mm/h | Implemented XPC callback to receive file actions requests from File Provider extension and emit Qt signal |
| src/gui/integration/fileactionsmodel.h/cpp | Extended model to support optional fileId and remoteItemPath for file provider scenarios without sync folders |
| src/gui/integration/FileActionsWindow.qml | Added fileId and remoteItemPath properties passed to FileActionsModel |
| shell_integration/MacOSX/.../FileProviderExtension.swift | Added manager property for accessing NSFileProviderManager APIs |
| shell_integration/MacOSX/.../FileProviderExtension+CustomActions.swift | Implemented FileActionsAction custom action handler |
| shell_integration/MacOSX/.../AppProtocol.h | Defined presentFileActions XPC protocol method |
| shell_integration/MacOSX/.../FileProviderExt/Info.plist | Added File actions context menu action definition with activation rule |
| shell_integration/MacOSX/.../FinderSyncExt/Info.plist | Updated to use NCApplicationGroupIdentifier configuration |
| shell_integration/MacOSX/.../FinderSync.m | Migrated from NSLog to os_log and updated to use group identifier from Info.plist |
| shell_integration/MacOSX/.../FinderSyncSocketLineProcessor.m | Migrated from NSLog to os_log |
| shell_integration/MacOSX/.../Item.swift | Added displayFileActions property and included it in userInfo dictionary |
| shell_integration/MacOSX/.../Item+getContextMenuItemTypeFilters.swift | New file implementing capability-based MIME type filter retrieval |
| shell_integration/MacOSX/.../Item+typeHasApplicableContextMenuItems.swift | New file implementing MIME type matching against server filters |
| shell_integration/MacOSX/.../SendableItemMetadata+Array.swift | Optimized bulk item conversion to fetch filters once and reuse for all items |
| shell_integration/MacOSX/.../Item+*.swift | Propagated displayFileActions parameter through all Item initialization paths |
| shell_integration/MacOSX/.../Package.swift | Updated NextcloudCapabilitiesKit dependency to 2.5.0 |
| shell_integration/MacOSX/.../Package.resolved | Updated package resolution for NextcloudCapabilitiesKit 2.5.0 |
| shell_integration/MacOSX/.../ItemPropertyTests.swift | Updated all test cases to include displayFileActions parameter |
| shell_integration/MacOSX/.../MockEnumerator.swift | Updated to pass displayFileActions parameter |
| shell_integration/MacOSX/.../Item+Init.swift | Updated test helper to pass displayFileActions parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension+CustomActions.swift
Outdated
Show resolved
Hide resolved
...ration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension+CustomActions.swift
Show resolved
Hide resolved
...ration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension+CustomActions.swift
Show resolved
Hide resolved
d60d7d5 to
11cacfa
Compare
|
The failed actions are unrelated to my changes, as it appears. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 31 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Info.plist
Show resolved
Hide resolved
…ension - Introduced a new presentFileActions: method in the XPC interface of the main app. - Implemented the presentFileActions: method in the main app to call existing code for file action presentation. - Added the new custom action to the build-time declarations of custom actions in the Info.plist of the file provider extension. - Extended the custom actions handling code switch to process the invocation and call the main app via XPC. Chores: - Created a shared file provider manager object and related stored property for the lifetime of the file provider extension object to be used in various places in its implementation. In example: resolving the user-visible URL of the item to present file actions for. Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
11cacfa to
5eeebfa
Compare
|
Artifact containing the AppImage: nextcloud-appimage-pr-9469.zip Digest: To test this change/fix you can download the above artifact file, unzip it, and run it. Please make sure to quit your existing Nextcloud app and backup your data. |
|
|
/backport to stable-33.0 |




Implements the integration for context menu items defined by the server for the macOS file provider extension.
This builds on top of #9403 and replaces #9458 and #9461.
This depends on a pull request and new release of NextcloudCapabilitiesKit.