fix: Show save button in secondary toolbar for editable files #1334
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Like the save button in the main toolbar, the save button in the secondary toolbar is hidden by default and has to be explicitly shown when needed.
The save button in the secondary toolbar also needs to be handled in the same way as the one in the main toolbar regarding being enabled or disabled, replacing the default download icon with a save icon, and showing a loading icon instead of the save icon while the file is being saved.
How to test
sleep(10);for example at the beginning of https://github.com/nextcloud/server/blob/36d6b0f1e6eae58e20f35bb9d87671d338ea0a61/apps/dav/lib/Upload/ChunkingV2Plugin.php#L132 to delay the upload and be able to check the behaviour of the button during the uploadResult with this pull request
The save button is shown. It is initially disabled, and it will be enabled once an annotation is added. Clicking on it disables it again and shows a loading spinner while the file is being uploaded. The loading icon is replaced by the save icon once the upload finishes.
Result without this pull request
The save button is not shown