Skip to content

Conversation

@silverkszlo
Copy link

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.

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

Known Testing Limitation

⚠️ Sidebar UX Bug: On master, the sidebar automatically closes when a document is opened in the viewer, making it impossible to keep both the document and the sidebar visible simultaneously. This prevents traditional end-to-end testing of the auto-reload feature.

However, the implementation has been verified using alternative methods:

  1. Event emission confirmed: Console subscription to files:node:updated shows events are correctly emitted after saves
  2. Fully tested on stable32: The identical functionality (Vue 2 version) works on stable32, where the sidebar bug doesn't exist
  3. Code review: The implementation follows the same pattern as stable32, adapted for Vue 3 Composition API

Console Logging for Testing

When testing/reviewing, console output will show:


[FilesVersionsSidebarTab] File saved, reloading versions in 1s
[FilesVersionsSidebarTab] Reloaded versions: 7 → 8

This confirms:

  • Events are being received
  • Version reloading is triggered
  • New versions are being fetched successfully

Testing (once sidebar bug is fixed)

Once the sidebar UX issue is resolved, testing steps:

  1. Open a document in Collabora
  2. Keep versions sidebar tab open
  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.

TODO

  • ...

Checklist

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>
// 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

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

3 participants