Skip to content

feat: support API in direct editing - #4249

Merged
marinofaggiana merged 22 commits into
masterfrom
126-richdocuments-via-directediting
Aug 14, 2026
Merged

feat: support API in direct editing#4249
marinofaggiana merged 22 commits into
masterfrom
126-richdocuments-via-directediting

Conversation

@marinofaggiana

@marinofaggiana marinofaggiana commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

This PR migrates document editor discovery, creation, and opening to the Nextcloud Direct Editing API while preserving the legacy Richdocuments flow for older Collabora configurations.

What changed

  • Fetches and caches Direct Editing editors and creators separately from the standard server capabilities.
  • Centralizes document editor availability checks and routing.
  • Opens Collabora through NCViewerDirectEditing when the richdocuments Direct Editing editor is available.
  • Falls back to the legacy NCViewerRichdocuments flow only when Collabora is not available through Direct Editing.
  • Migrates Text and Rich Workspace operations to the Direct Editing APIs.
  • Separates Direct Editing creation and template APIs from the legacy Richdocuments endpoints.
  • Groups Office creation actions by provider.
  • Adds Collabora creators for Document, Spreadsheet, Presentation, and Diagram.
  • Supports both DirectEditingMobileInterface and RichDocumentsMobileInterface in the Direct Editing viewer.
  • Handles Collabora mobile actions including sharing, pasting, inserting graphics, downloading, printing, slideshow, renaming, hyperlinks, reloading, and closing.
  • Renames legacy Richdocuments components to make the distinction from Direct Editing explicit.
  • Moves editor-specific availability and user-agent logic out of NCUtility.

Compatibility

  • Modern Collabora installations use the Direct Editing editor identified by richdocuments.
  • Older Collabora installations continue to use the legacy /apps/richdocuments/ endpoints.
  • Text, OnlyOffice, EuroOffice, and Whiteboard remain Direct Editing editors.
  • Existing offline and end-to-end encryption restrictions are preserved.

Dependencies

Test plan

  • Build the Nextcloud scheme locally.
  • Run NextcloudUnitTests: 45 tests passed in 6 suites.
  • Run SwiftLint on all changed Swift files.
  • Validate the Xcode project and Git diff.
  • Verify opening and creating files with legacy Collabora.
  • Verify Direct Editing Collabora with Document, Spreadsheet, Presentation, and Diagram.
  • Verify Text, EuroOffice, and Whiteboard.

馃 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Fetch direct editing capabilities through the dedicated API and clear cached data when the request fails.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Use direct-editing capabilities for editor lookup and tighten legacy rich-document MIME type matching.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
@marinofaggiana
marinofaggiana marked this pull request as draft August 14, 2026 08:22
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Use direct editing editor identifiers to detect supported editors and distinguish Collabora direct editing from legacy rich documents.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Rename rich workspace operations and use direct editing creators for file creation and opening.

Handle missing editor URLs as invalid data instead of force-unwrapping them.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Update the richdocuments asset URL API and track the NextcloudKit editors branch.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Route supported editors through the Direct Editing API while preserving legacy Richdocuments fallback for Collabora.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Prefer Direct Editing creators for Collabora and fall back to the legacy Richdocuments API when needed.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Use advertised editor names, refresh cached menus when editors change, and match Collabora creators by template identifier.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Use the shared EuroOffice identifier when building the context menu.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Add diagram creation and handle RichDocuments commands for image insertion, downloads, printing, renaming, and hyperlinks.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Validate editor URLs and legacy templates before opening created files.
Handle Collabora focus, close events, loading failures, and menu sizing.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
@marinofaggiana
marinofaggiana marked this pull request as ready for review August 14, 2026 15:46
@marinofaggiana
marinofaggiana merged commit e377d52 into master Aug 14, 2026
9 checks passed
@marinofaggiana
marinofaggiana deleted the 126-richdocuments-via-directediting branch August 14, 2026 16:22
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.

Richdocuments via DirectEditing

1 participant