nextcloud / nextcloud/text

Refactor 'Save text file before download' for Viewer rewrite

Open
#7,894 0 comments 0 reactions 1 assignee View on GitHub

@silverkszlo is already working on this.

Since Nov 6, 2025.

enhancement
Dominant language
JavaScript
Stars
659
Forks
133
Avg merge
1d 20h
Merged PRs (30d)
110

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.