Skip to content

Conversation

@silverkszlo
Copy link

@silverkszlo silverkszlo commented Jan 27, 2026

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:updated events.

Manual backport for stable32 already here: #57841

Changes

  • Subscribe to files:node:updated events in FilesVersionsSidebarTab.vue in files_versions
  • Automatically reload versions list when the current file is saved
  • Add 1-second delay before fetching to allow server time to create new version entry
  • Add console debug logging for testing verification

Testing

  1. Open a document in Collabora
  2. Open sidebar to see "Versions" tab
  3. Make changes and save
  4. Versions list should automatically update after ~1 second
  5. New version appears without manual refresh

Note on Event Emission

Apps need to properly emit files:node:updated events after saving for this feature to work.

Checklist

// Delay to let the server create the new version
setTimeout(() => {
reloadVersions()
}, 1000)
Copy link
Member

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I checked with added console logs and definitely did not get Action_Save_Resp:
Screenshot from 2026-01-29 11-01-40

Copy link
Member

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>
@silverkszlo silverkszlo force-pushed the fix/update-version-sidebartab branch from 4dc188f to 04d8e83 Compare February 9, 2026 14:08
Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smoke tested successfully

@elzody
Copy link
Contributor

elzody commented Feb 9, 2026

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:

  1. Click "Share" in the top right of Collabora to open the sharing tab
  2. Click "File > See history" in Collabora to open the versions tab

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.

@silverkszlo silverkszlo marked this pull request as ready for review February 9, 2026 19:02
@silverkszlo silverkszlo requested a review from a team as a code owner February 9, 2026 19:02
@silverkszlo silverkszlo requested review from artonge, sorbaugh and susnux and removed request for a team February 9, 2026 19:02
Comment on lines +113 to +119
onMounted(() => {
subscribe('files:node:updated', handleNodeUpdated)
})

onBeforeUnmount(() => {
unsubscribe('files:node:updated', handleNodeUpdated)
})
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reload versions tab after editing/saving in editor

5 participants