Skip to content

feat(collaboration): enable EnableInsertRemoteFile and EnableInsertRemoteImage WOPI flags#12192

Open
pedropintosilva wants to merge 1 commit intoowncloud:masterfrom
pedropintosilva:feat/enable-insert-remote-file
Open

feat(collaboration): enable EnableInsertRemoteFile and EnableInsertRemoteImage WOPI flags#12192
pedropintosilva wants to merge 1 commit intoowncloud:masterfrom
pedropintosilva:feat/enable-insert-remote-file

Conversation

@pedropintosilva
Copy link
Copy Markdown

@pedropintosilva pedropintosilva commented Apr 7, 2026

Add EnableInsertRemoteFile flag to Collabora CheckFileInfo response,
enabling multimedia insertion and document comparison menus in Collabora
Online (UI_InsertFile postMessage, available since 24.04.10).

Also wire up EnableInsertRemoteImage which was defined but never set in
the CheckFileInfo infoMap.

Tests:

go test ./services/collaboration/...

All 134 connector tests pass locally.

Signed-off-by: Pedro Pinto Silva pedro.silva@collabora.com


Screenshots

image image

PR's Notes

Collabora Online documentation:

This is just the server side change we still require a frontend side (owncloud/web#13658) change to handle the UI_InsertGraphic and UI_InsertFile postMessages that Collabora sends when the user clicks the new menu items.

The existing FilePickerModal.vue (https://github.com/owncloud/web/blob/master/packages/web-pkg/src/components/Modals/FilePickerModal.vue#L68) at packages/web-pkg/src/components/Modals/FilePickerModal.vue is for "Open With App" (user picks a file and it opens that file in a new editor tab) but we need something different here, something that:

  1. Accepts allowedFileTypes (e.g. ['image/png', 'image/jpeg'] for Insert Graphic, or whatever mimeTypeFilter Collabora sends for Insert File)
  2. Gets the picked file's download URL
  3. Send it back to the Collabora iframe via postMessage (Action_InsertGraphic, Action_InsertMultimedia, or Action_CompareDocuments)

I'm not sure if I can do it or how would you prefer it (to refactor the existing FilePickerModal or create a new one for this case)

@update-docs
Copy link
Copy Markdown

update-docs Bot commented Apr 7, 2026

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@mmattel
Copy link
Copy Markdown
Contributor

mmattel commented Apr 7, 2026

@pedropintosilva Thanks for the PR. Please check the following to prepare approval to run the workflow:

@jvillafanez
Copy link
Copy Markdown
Member

Code looks fine, although I'm not sure if we want to have the feature enabled at the moment. As you've said, we need changes in the frontend to make it work, otherwise the feature would look like broken (unless they provide something by default).

For the frontend changes, it's better to check with the frontend devs (https://github.com/owncloud/web), so you can open a ticket there.
I think there were some other buttons in collabora with similar "problems", in case you want to include them in your plans.

@jvillafanez
Copy link
Copy Markdown
Member

Also wire up EnableInsertRemoteImage which was defined but never set in the CheckFileInfo infoMap.

To clarify a bit, since we needed changes in the frontend to make it work, I decided not to include it (so it was set to false by default). It was intentional.

@pedropintosilva pedropintosilva force-pushed the feat/enable-insert-remote-file branch from 590eeab to 8b245c2 Compare April 8, 2026 09:25
@pedropintosilva
Copy link
Copy Markdown
Author

@pedropintosilva Thanks for the PR. Please check the following to prepare approval to run the workflow:

thanks I have forced pushed, now signed and with the extra markdown file.

@mmattel
Copy link
Copy Markdown
Contributor

mmattel commented Apr 8, 2026

@jvillafanez shall we approve the workflow run to see if any coding issues pop up?

@pedropintosilva pedropintosilva force-pushed the feat/enable-insert-remote-file branch from 8b245c2 to 43b56dc Compare April 8, 2026 12:04
pedropintosilva added a commit to pedropintosilva/web-1 that referenced this pull request Apr 8, 2026
…rtFile postMessages

Add frontend handling for Collabora's remote file insertion and document
comparison features. When oCIS sets EnableInsertRemoteFile and
EnableInsertRemoteImage in the WOPI CheckFileInfo response, Collabora
shows new menu items that send UI_InsertGraphic and UI_InsertFile
postMessages to the parent window.

- Add Host_PostmessageReady handshake: reply to App_LoadingStatus with
  Host_PostmessageReady so Collabora accepts Action postMessages.

- Handle UI_InsertGraphic: open a file picker modal filtered to image
  MIME types, resolve the selected file to a signed WebDAV download URL,
  and send Action_InsertGraphic back to the Collabora iframe.

- Handle UI_InsertFile: read callback and mimeTypeFilter from the
  Collabora message, open the file picker accordingly, and send back
  the appropriate Action (Action_InsertMultimedia or
  Action_CompareDocuments).

- Create InsertRemoteFileModal.vue: new modal component that embeds the
  oCIS file browser in embed mode, resolves the picked file to a
  download URL via clientService.webdav.getFileUrl(), and calls back
  with { filename, url }.

- Replace catchClickMicrosoftEdit with a unified handleAppMessage
  listener that handles all app iframe postMessages (UI_Edit,
  App_LoadingStatus, UI_InsertGraphic, UI_InsertFile).

Companion server-side PR: owncloud/ocis#12192

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
@pedropintosilva
Copy link
Copy Markdown
Author

Code looks fine, although I'm not sure if we want to have the feature enabled at the moment. As you've said, we need changes in the frontend to make it work, otherwise the feature would look like broken (unless they provide something by default).

For the frontend changes, it's better to check with the frontend devs (https://github.com/owncloud/web), so you can open a ticket there. I think there were some other buttons in collabora with similar "problems", in case you want to include them in your plans.

Thanks, I have created another PR against that repo. I hope it helps.

pedropintosilva added a commit to pedropintosilva/web-1 that referenced this pull request Apr 8, 2026
…rtFile postMessages

Add frontend handling for Collabora's remote file insertion and document
comparison features. When oCIS sets EnableInsertRemoteFile and
EnableInsertRemoteImage in the WOPI CheckFileInfo response, Collabora
shows new menu items that send UI_InsertGraphic and UI_InsertFile
postMessages to the parent window.

- Add Host_PostmessageReady handshake: reply to App_LoadingStatus with
  Host_PostmessageReady so Collabora accepts Action postMessages.

- Handle UI_InsertGraphic: open a file picker modal filtered to image
  MIME types, resolve the selected file to a signed WebDAV download URL,
  and send Action_InsertGraphic back to the Collabora iframe.

- Handle UI_InsertFile: read callback and mimeTypeFilter from the
  Collabora message, open the file picker accordingly, and send back
  the appropriate Action (Action_InsertMultimedia or
  Action_CompareDocuments).

- Create InsertRemoteFileModal.vue: new modal component that embeds the
  oCIS file browser in embed mode, resolves the picked file to a
  download URL via clientService.webdav.getFileUrl(), and calls back
  with { filename, url }.

- Replace catchClickMicrosoftEdit with a unified handleAppMessage
  listener that handles all app iframe postMessages (UI_Edit,
  App_LoadingStatus, UI_InsertGraphic, UI_InsertFile).

Companion server-side PR: owncloud/ocis#12192

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
@jvillafanez
Copy link
Copy Markdown
Member

@pedropintosilva please rebase / update your branch to the latest master code.
It seems the pipeline had a problem because the go-git library version isn't the latest. Current master code already have the library updated, so you just need to apply your changes on top of it. There shouldn't be any new changes shown here.

@pedropintosilva pedropintosilva force-pushed the feat/enable-insert-remote-file branch 2 times, most recently from 942a19d to 08d7e45 Compare April 8, 2026 13:23
@pedropintosilva
Copy link
Copy Markdown
Author

rebased; touch ocis/cmd/ocis/main.go && make -C ocis build successfully and tested manually.

…moteImage WOPI flags

Add EnableInsertRemoteFile flag to Collabora CheckFileInfo response,
enabling multimedia insertion and document comparison menus in Collabora
Online (UI_InsertFile postMessage, available since 24.04.10).

Also wire up EnableInsertRemoteImage which was defined but never set in
the CheckFileInfo infoMap.

Tests:

    go test ./services/collaboration/...

All 134 connector tests pass locally.

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
pedropintosilva added a commit to pedropintosilva/web-1 that referenced this pull request Apr 26, 2026
…rtFile postMessages

Add frontend handling for Collabora's remote file insertion and document
comparison features. When oCIS sets EnableInsertRemoteFile and
EnableInsertRemoteImage in the WOPI CheckFileInfo response, Collabora
shows new menu items that send UI_InsertGraphic and UI_InsertFile
postMessages to the parent window.

- Add Host_PostmessageReady handshake: reply to App_LoadingStatus with
  Host_PostmessageReady so Collabora accepts Action postMessages.

- Handle UI_InsertGraphic: open a file picker modal filtered to image
  MIME types, resolve the selected file to a signed WebDAV download URL,
  and send Action_InsertGraphic back to the Collabora iframe.

- Handle UI_InsertFile: read callback and mimeTypeFilter from the
  Collabora message, open the file picker accordingly, and send back
  the appropriate Action (Action_InsertMultimedia or
  Action_CompareDocuments).

- Create InsertRemoteFileModal.vue: new modal component that embeds the
  oCIS file browser in embed mode, resolves the picked file to a
  download URL via clientService.webdav.getFileUrl(), and calls back
  with { filename, url }.

- Replace catchClickMicrosoftEdit with a unified handleAppMessage
  listener that handles all app iframe postMessages (UI_Edit,
  App_LoadingStatus, UI_InsertGraphic, UI_InsertFile).

Companion server-side PR: owncloud/ocis#12192

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
@pedropintosilva pedropintosilva force-pushed the feat/enable-insert-remote-file branch from 08d7e45 to 080eee4 Compare April 26, 2026 07:29
@pedropintosilva
Copy link
Copy Markdown
Author

I think the workflow needs approval.

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.

3 participants