nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.25k stars 4.05k forks source link

Reload versions tab after editing/saving in editor #35510

Open PVince81 opened 1 year ago

PVince81 commented 1 year ago

How to use GitHub

Is your feature request related to a problem? Please describe. When in the text editor and saving, if the versions tab is open it will not automatically reload the list. One needs to close the sidebar then open it again.

Describe the solution you'd like Technically, every editor should trigger a global Javascript event (on the event bus?) so that the sidebar tabs knows that a file has been edited. The versions tab can then listen to that event to reload itself.

Describe alternatives you've considered N/A

Additional context

@juliushaertl are the text apps and office already triggering such events ?

cc @artonge @CarlSchwan as we discussed this as part of versions.

I suspect that implementing this is rather trivial, most time will likely been spent discussing the name of the event and mechanism :sweat_smile:

juliusknorr commented 1 year ago

Currently not, but should be straight forward. I think we could just emit the same events that the viewer already uses:

https://github.com/nextcloud/server/issues/35511#issuecomment-1335405045

juliusknorr commented 1 year ago

Pushed a pull request for text to emit emit('files:file:updated', { fileid: 123456 }) as viewer already does that for image editing: https://github.com/nextcloud/text/pull/3524

Collabora might be a bit trickier since we don't get a simple saved message from them, but we can track the state of the Doc_ModifiedStatus post message there and consider a save if the status changes from true to false. Will check the next days if that works properly and do a similar PR there then.