Skip to content

Conversation

@silverkszlo
Copy link
Contributor

@silverkszlo silverkszlo commented Oct 2, 2025

Resolves

Before

When the user exports a document as PDF or EPUB from Collabora Online OR uses "save as" to save the file with a different format or a new name, the new file did not appear automatically in their files list. Only after a manual page reload was the file displayed.

Now

The new file appears in the files' list without needing a reload of the page.

The "Save As" and "Export As" events are being handled by tracking the requested filename when the user initiates the operation. When Collabora confirms the save/export is complete, the app fetches the new file's metadata via WebDAV and emits a files:node:created event, causing the Files app to display the new file in the file list immediately without requiring a page reload.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

@silverkszlo silverkszlo force-pushed the refresh-filelist-after-export branch 2 times, most recently from 62afe5f to 340677b Compare October 2, 2025 13:01
@elzody
Copy link
Contributor

elzody commented Oct 6, 2025

I think there is probably a better way to handle this, like via post message. Clicking on the Save As or Export As buttons in Collabora sends the UI_SaveAs post message to us, which we then handle by displaying the Save As dialog on our side. In response, we send the Action_SaveAs post message, which has a Notify argument that tells Collabora whether or not we want to know when the operation has finished and what the result is.

My idea was to use this to then trigger a rebuild of the files list (probably via some event bus message), but we only get the Action_Save_Resp post message back from Collabora when the user carries out the task from the Save As button -- not from the Export As button.

This doesn't make sense to me because if it's following the same flow under the hood, 1) why have two separate buttons for it and 2) why does doing this via the Export As button not also notify us when the operation is complete

I will clarify this behavior with them before we proceed

@juliusknorr
Copy link
Member

Yes, I think we should rather rely on existing files app methods to add the new file or update it through events. Reload was possible and used in the past but had quite some performance impact to always refetch the full file list.

@elzody
Copy link
Contributor

elzody commented Oct 7, 2025

Collabora has confirmed that the Export As button not sending back an Action_Save_Resp is a bug, so I think we should wait for that to be fixed and then implement better handling for this using the methods Julius highlighted.

@juliusknorr
Copy link
Member

CollaboraOnline/online#13309 as upstream fix to be tested with

@juliusknorr
Copy link
Member

@elzody I rememeber you wanted to give the collabora fix a try? Could you give an update on that part?

@juliusknorr juliusknorr added bug Something isn't working 2. developing Work in progress labels Nov 13, 2025
@elzody
Copy link
Contributor

elzody commented Nov 13, 2025

@juliusknorr @silverkszlo Indeed, the fix on Collabora's side works. It seems to send the correct PostMessage now, so we should be able to proceed with our fix. I am happy to help any way that I can

@silverkszlo silverkszlo force-pushed the refresh-filelist-after-export branch from 340677b to 64cf8ef Compare November 18, 2025 13:44
@silverkszlo
Copy link
Contributor Author

@juliusknorr @silverkszlo Indeed, the fix on Collabora's side works. It seems to send the correct PostMessage now, so we should be able to proceed with our fix. I am happy to help any way that I can

Ok so I couldn't just use updateFileInfo after performing "Save as" or "Export as" as it updates metadata for the current file that's already open (name, modification time). In order to see the new file (either saved with a different format, name or exported with a different format) without reloading the page, I implemented createNodeForNewFile.

  • It queries the current directory via WebDAV,
  • finds the newly created file by its basename,
  • and emits a files:node:created event. This event triggers the Files app to add the new file to the visible file list without requiring a page reload.

This works for both SaveAs and ExportAs now.

@silverkszlo silverkszlo changed the title Refresh files page after exporting a file in a different format Refresh files list after exporting a file in a different format Nov 18, 2025
@silverkszlo silverkszlo added 3. to review Ready to be reviewed and removed 2. developing Work in progress labels Nov 18, 2025
@silverkszlo silverkszlo force-pushed the refresh-filelist-after-export branch from 64cf8ef to 7700b4b Compare November 19, 2025 10:20
@juliusknorr juliusknorr merged commit 5284e3e into main Nov 19, 2025
51 checks passed
@juliusknorr juliusknorr deleted the refresh-filelist-after-export branch November 19, 2025 11:04
@juliusknorr
Copy link
Member

Backports?

@silverkszlo
Copy link
Contributor Author

/backport to stable32 please

@silverkszlo
Copy link
Contributor Author

/backport to stable31 please

@silverkszlo
Copy link
Contributor Author

/backport to stable30 please

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

Labels

3. to review Ready to be reviewed bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants