-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(files_versions): Auto-reload versions tab on file #57843
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
base: master
Are you sure you want to change the base?
Conversation
| // Delay to let the server create the new version | ||
| setTimeout(() => { | ||
| reloadVersions() | ||
| }, 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now reading this, I'm unsure if the UI_Save post message is the right one as I would expect that once we receive the save success from Collabora we should not need to wait anymore.
Can you check if Action_Save_Resp does get emitted as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait be very nice to get rid of the delay though if possible. They are not really reliable.
Listen for files:node:updated events and automatically refresh the versions list when the current file is saved, eliminating the need to manually close and reopen the sidebar to see new versions. Signed-off-by: silver <s.szmajduch@posteo.de>
4dc188f to
04d8e83
Compare
blizzz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smoke tested successfully
|
The sidebar closing when a document is opened is to be expected in my opinion, to allow more room for working with the document. That said, there are still at least two ways to open the Nextcloud sidebar that I know of:
With that, you can probably still implement testing, but it might make more sense to write the tests for that in richdocuments rather than here. |
| onMounted(() => { | ||
| subscribe('files:node:updated', handleNodeUpdated) | ||
| }) | ||
|
|
||
| onBeforeUnmount(() => { | ||
| unsubscribe('files:node:updated', handleNodeUpdated) | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should no longer be needed on Nextcloud 33+.
As soon as the the current open node was updated, the sidebar receives a new context and passes this to the sidebar tab.
Meaning when you emit files:node:updated inside your app (e.g. text) then the files app will update the node in the store, propagate this to the sidebar and the sidebar tab should update the content.
The watch of the node prop should be enough, if not then this is a bug in the files app and need to be fixed there.

Summary
This PR adds automatic reloading of the versions sidebar tab when documents are saved, eliminating the need for manual refresh to see new versions. The feature listens to
files:node:updatedevents.Manual backport for stable32 already here: #57841
Changes
files:node:updatedevents inFilesVersionsSidebarTab.vueinfiles_versionsTesting
Note on Event Emission
Apps need to properly emit
files:node:updatedevents after saving for this feature to work.Checklist
3. to review, feature component)stable32)