richdocuments icon indicating copy to clipboard operation
richdocuments copied to clipboard

Enable startPresentation parameter

Open timur-g opened this issue 1 year ago • 2 comments

Collabora Online supports starting presentation with any presentation file, appending ?startPresentation=true after file URL. https://sdk.collaboraonline.com/docs/advanced_integration.html?highlight=startpresentation#url-query-parameters. But Nextcloud seems to remove the parameter from the url. Would be good to support this.

timur-g avatar Sep 20 '24 09:09 timur-g

I am getting errors like the following screenshots when I try to append this to the URL. Any ideas?

@timur-g

Browser error

Image

Collabora error

Image

elzody avatar Oct 04 '24 22:10 elzody

Collabora error fixed with https://github.com/CollaboraOnline/online/issues/10198.

timur-g avatar Oct 17 '24 13:10 timur-g

I've done some research into how we could implement this in richdocuments. So far, this is my analysis and proposed solution:

First, I tried to solve the problem of the &startPresentation=true parameter being removed from the URL when you try to open a presentation from within Nextcloud. This ended up being due to the file action which the viewer app registers; it uses OCP.Files.Router.goToRoute() to navigate to a very specific route, providing its own queries / parameters (thus erasing all others you give it manually). I cannot find a workaround for getting the parameter in richdocuments unless I use some hacky solution or something changes with how the viewer handles this, but with such a small addition I doubt it would be worth it to change anything there.

With that being said, my proposed solution would be to register a file action on presentation files which would immediately open them in presentation mode. It's one more click to show the file action menu, and you couldn't, for example, simply share a link to a presentation which would open it automatically in presentation mode, but it would provide a cleaner solution in my opinion.

Any thoughts or ideas which I haven't thought of? @juliusknorr and @timur-g (in case you want to stay up-to-date)

elzody avatar Oct 24 '24 18:10 elzody

A quick option would be to check for the parameter on page load in PHP and pass it to the richdocuments frontend code as initial state or store it in the session if it needs to persist multiple page reloads due to redirects.

Cleaner option would be if the files app could preserve url parameters somehow, but might be larger effort

juliusknorr avatar Nov 05 '24 07:11 juliusknorr

When this fix could be added in a Richdocument release ? It seems that it is still not available in the 8.6.0 beta1 Thanks!

klorydryk avatar Jan 14 '25 14:01 klorydryk

The commit https://github.com/nextcloud/richdocuments/commit/1cfedbc2d25f87da4f9aa2b8b164d7a13e6ecf1c is part of 8.6.1 beta1, as far as I know it also requires Collabora online 24.04.9-1

If that does not work, maybe you can file a new issue about it

juliusknorr avatar Jan 14 '25 14:01 juliusknorr

I could reproduce this, reopened https://github.com/CollaboraOnline/online/issues/10198 so Collabora can have another look

juliusknorr avatar Jan 14 '25 14:01 juliusknorr