Skip to content

Fix(backup): WebDAV Deletion Confirmation and List Refresh#260

Merged
Chevey339 merged 1 commit intoChevey339:masterfrom
luosc:fix/webdav-delete-refresh-and-confirm
Jan 27, 2026
Merged

Fix(backup): WebDAV Deletion Confirmation and List Refresh#260
Chevey339 merged 1 commit intoChevey339:masterfrom
luosc:fix/webdav-delete-refresh-and-confirm

Conversation

@luosc
Copy link
Copy Markdown
Contributor

@luosc luosc commented Jan 15, 2026

Fix: WebDAV Deletion Confirmation and List Refresh

Description:

This PR addresses two key issues related to WebDAV backups:

  1. Missing Confirmation on Deletion: Previously, deleting a remote WebDAV backup happened immediately without any user confirmation, leading to potential accidental data loss. A confirmation dialog has now been added to both Mobile (Android/iOS) and Desktop platforms.
  2. Backup List Not Refreshing on Android: On Android devices, the list of remote backups did not refresh after a deletion, showing stale data. This has been resolved by automatically closing the menu upon confirmation, performing the deletion, and then re-opening the menu with the updated list.

Changes:

  • Mobile (lib/features/backup/pages/backup_page.dart):
    • Added a confirmation dialog before deletion.
    • Implemented logic to close the current bottom sheet, show a loading indicator, perform the deletion, and then re-open the bottom sheet with the fresh list.
  • Desktop (lib/desktop/setting/backup_pane.dart):
    • Added a confirmation dialog to the remote backup management dialog.
  • Localization:
    • Added new translation keys backupPageDeleteConfirmTitle and backupPageDeleteConfirmContent to app_en.arb and app_zh.arb.

Testing:

  • Verified on Android: The confirmation dialog appears, and after deletion, the menu reloads correctly reflecting the changes.
  • Verified on macOS: The confirmation dialog appears correctly before deletion.

修复:WebDAV 删除确认及列表刷新问题

描述:

此 PR 修复了两个与 WebDAV 备份相关的问题:

  1. 删除时缺少确认提示: 之前删除远程 WebDAV 备份时会立即执行,没有任何用户确认,容易导致误删。现在已在移动端 (Android/iOS) 和桌面端添加了删除确认对话框。
  2. Android 端备份列表未刷新: 在 Android 设备上,删除操作后远程备份列表不会自动刷新,仍显示旧数据。通过在确认删除后自动关闭当前菜单,执行删除操作,然后重新打开菜单加载最新列表,解决了此问题。

变更:

  • 移动端 (lib/features/backup/pages/backup_page.dart):
    • 添加了删除前的确认对话框。
    • 实现了关闭当前底部菜单、显示加载提示、执行删除、然后重新打开底部菜单加载新列表的逻辑。
  • 桌面端 (lib/desktop/setting/backup_pane.dart):
    • 在远程备份管理对话框中添加了确认提示。
  • 本地化:
    • app_en.arbapp_zh.arb 中添加了新的翻译键值 backupPageDeleteConfirmTitlebackupPageDeleteConfirmContent

测试:

  • Android 验证:确认对话框正常显示,删除后菜单会自动重新加载并显示最新数据。
  • macOS 验证:删除前能正确显示确认对话框。

@Chevey339
Copy link
Copy Markdown
Owner

这个编译的时候会报错
error: The method '_chooseImportOptionsDialog' isn't defined for the type '_BackupPageState'. (undefined_method at [Kelivo] lib\features\backup\pages\backup_page.dart:494)
error: The named parameter 'options' isn't defined. (undefined_named_parameter at [Kelivo] lib\features\backup\pages\backup_page.dart:496)

@luosc
Copy link
Copy Markdown
Contributor Author

luosc commented Jan 24, 2026

@Chevey339 感谢指出。我调查了,原因是:

  • 这个改动是在颗粒化恢复feat基础上开发(RestoreOptions / _chooseImportOptionsDialog,见 PR Feat: 支持颗粒化备份恢复 (设置/供应商/聊天/文件) #240
  • 我把该特性 rebase/cherry‑pick 到 origin/master 时没有带上依赖的 API 变更,master 里只有 _chooseImportModeDialog / mode,因此编译报错。Git 没有产生冲突,但 API 不匹配。

请问你希望的合并顺序是:
1)考虑先合并这个颗粒化恢复feat(PR #240),这样本改动无需修改即可生效;
还是
2)我先把本改动适配 origin/master(改回 _chooseImportModeDialog + mode),然后在 #240 再在本PR基础上改动?

@luosc luosc changed the title Fix(backup): WebDAV Deletion Confirmation and List Refresh Fix(backup): [dependent on PR #240] WebDAV Deletion Confirmation and List Refresh Jan 25, 2026
@luosc luosc marked this pull request as draft January 25, 2026 03:36
- Added confirmation dialog when deleting remote WebDAV backups on both Mobile and Desktop platforms.

- Fixed an issue on Mobile/Android where the backup list would not refresh immediately after deletion by automatically reloading the menu.

- Updated localization files (English and Chinese) with new confirmation messages.
@luosc luosc force-pushed the fix/webdav-delete-refresh-and-confirm branch from fd391bd to 2476172 Compare January 26, 2026 19:27
@luosc
Copy link
Copy Markdown
Contributor Author

luosc commented Jan 26, 2026

@Chevey339

@luosc luosc marked this pull request as ready for review January 26, 2026 19:28
@luosc luosc changed the title Fix(backup): [dependent on PR #240] WebDAV Deletion Confirmation and List Refresh Fix(backup): WebDAV Deletion Confirmation and List Refresh Jan 26, 2026
@Chevey339 Chevey339 merged commit da2c365 into Chevey339:master Jan 27, 2026
@luosc luosc deleted the fix/webdav-delete-refresh-and-confirm branch January 28, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants