From a555926159777bf9749e3ccbcf229e2316e47504 Mon Sep 17 00:00:00 2001 From: silver Date: Tue, 27 Jan 2026 11:13:22 +0100 Subject: [PATCH] [stable32] feat(files_versions): Auto-reload versions tab on file 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 --- apps/files_versions/src/views/VersionTab.vue | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/files_versions/src/views/VersionTab.vue b/apps/files_versions/src/views/VersionTab.vue index a643aef439d8a..dc4c4f6ab5d44 100644 --- a/apps/files_versions/src/views/VersionTab.vue +++ b/apps/files_versions/src/views/VersionTab.vue @@ -142,11 +142,28 @@ export default { }, mounted() { subscribe('files_versions:restore:restored', this.fetchVersions) + subscribe('files:node:updated', this.handleNodeUpdated) }, beforeUnmount() { unsubscribe('files_versions:restore:restored', this.fetchVersions) + unsubscribe('files:node:updated', this.handleNodeUpdated) }, methods: { + /** + * Handle files:node:updated event to reload versions when the current file is saved + * + * @param {object} node The updated node + */ + handleNodeUpdated(node) { + // Reload if this is the currently open file + if (this.fileInfo && node.fileid === this.fileInfo.id) { + // Delay to let the server create the new version + setTimeout(() => { + this.fetchVersions() + }, 1000) + } + }, + /** * Update current fileInfo and fetch new data *