From a4bfd8edd37fed48f50c4b065b312b77974a3c50 Mon Sep 17 00:00:00 2001 From: ww Date: Thu, 23 Apr 2026 14:10:14 +0800 Subject: [PATCH] fix(files): close preview on navigation/delete/rename + backfill i18n (#150) * i18n: backfill files/download translations for de, es, fr, ja, ko, pt Add nav.files, files.* (39 keys), and download.* (9 keys) so the file browser UI is fully localized in these six locales instead of falling back to English. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(files): close preview when navigating or affected file changes Opening a preview and then navigating directories, deleting the previewed file, or renaming it left the preview pane stuck on stale content because previewFile was never cleared. - stores/hermes/files.ts: - fetchEntries clears previewFile on path change (in-place refresh keeps the preview). - deleteEntry / renameEntry clear preview/editor state when the affected entry matches the previewed/edited file or its parent. - Add isAffected(target, changed, isDir) helper. - components/hermes/files/FilePreview.vue: replace the misleading common.cancel close button with a dedicated files.closePreview key plus an X icon and quaternary style. - i18n: add files.closePreview to all 8 locales. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../components/hermes/files/FilePreview.vue | 17 ++++- packages/client/src/i18n/locales/de.ts | 70 +++++++++++++++++-- packages/client/src/i18n/locales/en.ts | 1 + packages/client/src/i18n/locales/es.ts | 70 +++++++++++++++++-- packages/client/src/i18n/locales/fr.ts | 70 +++++++++++++++++-- packages/client/src/i18n/locales/ja.ts | 70 +++++++++++++++++-- packages/client/src/i18n/locales/ko.ts | 70 +++++++++++++++++-- packages/client/src/i18n/locales/pt.ts | 70 +++++++++++++++++-- packages/client/src/i18n/locales/zh.ts | 1 + packages/client/src/stores/hermes/files.ts | 27 +++++++ 10 files changed, 427 insertions(+), 39 deletions(-) diff --git a/packages/client/src/components/hermes/files/FilePreview.vue b/packages/client/src/components/hermes/files/FilePreview.vue index 3532dc1..bce83df 100644 --- a/packages/client/src/components/hermes/files/FilePreview.vue +++ b/packages/client/src/components/hermes/files/FilePreview.vue @@ -1,5 +1,6 @@