Skip to content

fix: pick the target folder when saving or exporting from Collabora - #4374

Merged
kulmann merged 2 commits into
mainfrom
fix/collabora-save-as-location-picker
Nov 10, 2026
Merged

kulmann merged 2 commits into
mainfrom
fix/collabora-save-as-location-picker

Conversation

@tammi-23

@tammi-23 tammi-23 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Description

"Save As" and "Export As" (e.g. PDF) in Collabora only offered a file name input, so documents could only be saved next to the current file. Both actions now open the location picker, where the user can choose the target folder and the file name.

  • UI_SaveAs opens the LocationPickerModal with chooseFileName instead of the FileNameModal. The file name is prefilled with the current name, or with the new extension when exporting.
  • The chosen folder is sent to Collabora as a path relative to the folder of the current file (Action_SaveAs Filename), because WOPI PutRelativeFile resolves the target relative to that folder.
  • Folders outside the current folder or its subfolders can't be reached that way, so an error message is shown and nothing is saved.
  • If a file with the chosen name already exists in the target folder, a free name is picked (name (1).ext), like the file list does.
  • After saving, the editor switches to the new file. The route is now built via getDriveAliasAndItem, so this also works when the file was saved into a subfolder of a received share or public link.
  • The conflict check lists the target folder by its resource (path and id), so it also works in public links, where listing by id alone returns the link root.
  • FileNameModal.vue is removed since it is no longer used.

Known limitation: saving into a parent folder or another space isn't possible because of how PutRelativeFile works. Lifting that would need a backend change.

Related Issue

  • Fixes: no separate issue, requested internally

How Has This Been Tested?

  • test environment: local OpenCloud with Collabora, Chrome
  • test case 1: personal space, Save As into a subfolder → new file is created there and opened in the editor
  • test case 2: personal space, export as PDF into a nested subfolder → PDF is created there
  • test case 3: target folder above the current folder → error message, nothing is saved
  • test case 4: received share (editor role), Save As into a subfolder with an existing file of the same name → name (1).odt is created and opened
  • test case 5: received share, export as PDF into a nested subfolder → PDF is created there
  • test case 6: public edit link (logged out), Save As into a subfolder, also with a name conflict → name (1).odt is created and opened
  • test case 7: public edit link, export as PDF into a nested subfolder; link root as target → error message
  • unit tests for useCollaboraPostMessages

@tammi-23 tammi-23 self-assigned this Nov 9, 2026
@tammi-23
tammi-23 force-pushed the fix/collabora-save-as-location-picker branch from 9b0494e to 41084ea Compare November 9, 2026 12:32

@AlexAndBear AlexAndBear left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Works great, but the known limitation (only current + subfolders) is very limiting, we should open a backend issue, since you mentioned, it's a server side restriction.

@kulmann kulmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice 💪 Could you please open a backend issue for the path limitation? 🙈

@kulmann
kulmann merged commit 0aa34d0 into main Nov 10, 2026
28 checks passed
@kulmann
kulmann deleted the fix/collabora-save-as-location-picker branch November 10, 2026 13:08
@openclouders openclouders mentioned this pull request Nov 10, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants