feat(files): add save-as-new vs overwrite choice for library file edits (#564)

Editing a file from the library used to silently supersede it: the worker auto-saved every result as a new version and the leaf-only listing hid the original, which read as a destructive overwrite. Tool pages now show a per-edit choice for library-sourced files. The default saves the result as an independent new file and keeps the original; picking overwrite keeps the old superseding-version behavior.

The client sends a saveMode multipart field next to fileId, validated with a 400 on unknown values, and autoSaveToLibrary branches on it. Every hand-written route that honors fileId parses the field the same way as the factory. The review panel shows where an auto-saved result went instead of offering a second, duplicate save. Tools whose route or submitter ignores fileId keep the selector hidden via a shared unsupported-tools set, and the choice resets to the non-destructive default whenever a new file is staged.

Closes #495
This commit is contained in:
SnapOtter
2026-07-18 11:36:08 +08:00
committed by GitHub
parent e113684ddb
commit a23158d968
63 changed files with 1721 additions and 19 deletions
+6
View File
@@ -2993,6 +2993,12 @@ export const ru: TranslationKeys = {
importFromFiles: "Импорт из Файлов",
saveToFiles: "Сохранить в Файлы",
savedToFiles: "Сохранено в Файлы",
librarySaveTitle: "Этот файл из ваших файлов",
librarySaveAsNew: "Сохранить результат как новый файл",
librarySaveAsNewHint: "Оригинал останется в ваших файлах",
libraryOverwrite: "Перезаписать оригинал",
libraryOverwriteHint: "Результат заменит оригинал в ваших файлах",
viewInFiles: "Открыть в Файлах",
adjustSettings: "Настроить параметры",
startOver: "Начать заново с новым файлом",
newFile: "Новый файл",