Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle linked files with direct editing #1170

Open
1 task
juliushaertl opened this issue Nov 12, 2020 · 7 comments
Open
1 task

Properly handle linked files with direct editing #1170

juliushaertl opened this issue Nov 12, 2020 · 7 comments

Comments

@juliushaertl
Copy link
Member

juliushaertl commented Nov 12, 2020

ToDo

Currently we have no special handling for linking files with direct editing, so this is not working as described in nextcloud/android#7192.

I currently see two ways of implementing support for opening linked files:

  • We send a post message to the mobile clients with the path/file id so they can directly navigate to it and open it with direct editing
  • We open a browser with the private link of the file. This has less effort on the client side, but will need the user to be logged in in the browser of course.

In addition there is also no support for adding file links through direct editing, since the user is not authenticated via a session. To solve this we'd need to implement something similar to the Collabora insert image functionality where a postMessage is emitted by the text app. Then the mobile clients would show a file picker and pass the selected file to the webview again.

cc @tobiasKaminsky @marinofaggiana What do you think. Does that make sense?

@tobiasKaminsky
Copy link
Member

On web ui one is then simply redirected, right?
Isn't the same possible? As we are already within a webview?

Regarding adding file link:
Post message sounds good 👍

@juliushaertl
Copy link
Member Author

On web ui one is then simply redirected, right?
Isn't the same possible? As we are already within a webview?

Yes, but on the web UI we have an authenticated session, while the direct editing uses a one-time token just for the file. Therefore we can only redirect to the normal files app, which might require the user to log in again.

@tobiasKaminsky
Copy link
Member

Hm.
Then your first suggestion is good, I think.

So we have three new interface methods:

  • openFile(String remotePath) -> open new file in clients, needed for link handling
  • insertImage() -> client opens file picker and sends file to editor via
  • postImage(String filename, String linkToUploadedFile)

@juliushaertl
Copy link
Member Author

In addition we would also need those two for inserting links to any file type:

  • insertFile() -> client opens file picker and sends file to editor via
  • postFile(String filename, String linkToUploadedFile)

@machiav3lli

This comment has been minimized.

@Raudius
Copy link
Contributor

Raudius commented Nov 16, 2022

Related to: #1169

In 1169 I suggest we handle the opening in the browser, as this would also work for direct editing from desktop. But we could additionally send a PostMessage to the clients in case they can handle the open request more gracefully.

@Raudius Raudius self-assigned this Nov 16, 2022
@juliushaertl
Copy link
Member Author

Yep, sounds like something for a openFile message that is emitted for that case :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🧭 Planning evaluation (don't pick)
Development

No branches or pull requests

6 participants