Skip to content

Refactor 'Save text file before download' for Viewer rewrite #7894

@silverkszlo

Description

@silverkszlo

Is your feature request related to a problem? Please describe.
Building on #7889 and this PR in Viewer, the feature that automatically saves the latest state of a text file before it is downloaded should be refactored and implemented once the Viewer rewrite is completed. Currently, we register a callback in Text and trigger it from Viewer.

Describe the solution you'd like
Use Files' action API to override the downloadAction in Text. Ensure that the text file is saved automatically right before it is downloaded.

Additional context
It started with this feature request.

Before:
When editing a markdown document online in files and download it from the editor/viewer without saving it manually, the last saved version is downloaded. The last saved version may not include what was just added/edited after the previous save operation. So the downloaded file may differ from the file one sees online.

Now:
Clicking on Download now triggers an automatic save operation of the document. If the saving for some reason fails, the last saved version is still being downloaded.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

📄 To do (~10 entries)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions