Skip to content

feat(chat): add delete-all-versions action for multi-version messages#452

Merged
Chevey339 merged 1 commit intoChevey339:masterfrom
luosc:feat/437-delete-message-versions
Apr 13, 2026
Merged

feat(chat): add delete-all-versions action for multi-version messages#452
Chevey339 merged 1 commit intoChevey339:masterfrom
luosc:feat/437-delete-message-versions

Conversation

@luosc
Copy link
Copy Markdown
Contributor

@luosc luosc commented Apr 5, 2026

Rename the message deletion entry to "Delete This Version" and expose a separate "Delete All Versions" action whenever the current message group has more than one stored version. Keep the existing single-version delete path unchanged for messages without alternate versions.

Route the new action through the shared chat content layer so both mobile and desktop menus use the same version-aware behavior. Add explicit confirmation copy for deleting the current version versus deleting the entire message version group, and persist version selection cleanup when a group is removed entirely.

Update localized strings across all four ARB files, regenerate l10n output, and add focused tests for menu visibility and version-selection recomputation after single-version and all-version deletion flows.

Closes #437

Files:

  • lib/features/chat/widgets/message_more_sheet.dart: extend MessageMoreAction, add canDeleteAllVersions, rename the delete action to current-version semantics, and show a separate Delete All Versions entry on both mobile and desktop menus.
  • lib/features/home/widgets/message_list_view.dart: pass version-count awareness into the more-actions sheet and route deleteCurrentVersion vs deleteAllVersions to separate callbacks.
  • lib/features/home/pages/home_page.dart: add separate confirmation dialogs and action routing for deleting the current version versus deleting all versions in a message group.
  • lib/features/home/controllers/home_page_controller.dart: add a controller entry point for deleting all versions in a message group and clear translation UI state for every removed version.
  • lib/features/home/controllers/home_view_model.dart: unify version deletion logic, add deleteAllMessageVersions, compute the next selected version after removals, and remove stale selection state when a message group is deleted entirely.
  • lib/core/services/chat/chat_service.dart: add clearSelectedVersion so persisted conversation version selections are removed when a message group no longer exists.
  • lib/l10n/app_en.arb: rename delete strings to current-version wording and add all-version delete labels and confirmation copy.
  • lib/l10n/app_zh.arb: add the same current-version/all-version delete wording in Chinese.
  • lib/l10n/app_zh_Hans.arb: add the same current-version/all-version delete wording in Simplified Chinese.
  • lib/l10n/app_zh_Hant.arb: add the same current-version/all-version delete wording in Traditional Chinese.
  • lib/l10n/app_localizations.dart: regenerate localization interface for the new delete strings.
  • lib/l10n/app_localizations_en.dart: regenerate English localization output.
  • lib/l10n/app_localizations_zh.dart: regenerate Chinese localization output for zh / zh_Hans / zh_Hant.
  • test/message_more_sheet_test.dart: verify that the menu shows Delete All Versions only when multiple versions exist.
  • test/home_view_model_version_selection_test.dart: verify version-selection recomputation after deleting an earlier version, deleting the selected version, and deleting all versions.

Rename the message deletion entry to "Delete This Version" and expose a separate
"Delete All Versions" action whenever the current message group has more than
one stored version. Keep the existing single-version delete path unchanged for
messages without alternate versions.

Route the new action through the shared chat content layer so both mobile and
desktop menus use the same version-aware behavior. Add explicit confirmation
copy for deleting the current version versus deleting the entire message version
group, and persist version selection cleanup when a group is removed entirely.

Update localized strings across all four ARB files, regenerate l10n output, and
add focused tests for menu visibility and version-selection recomputation after
single-version and all-version deletion flows.

Closes Chevey339#437

Files:
- lib/features/chat/widgets/message_more_sheet.dart: extend MessageMoreAction, add canDeleteAllVersions, rename the delete action to current-version semantics, and show a separate Delete All Versions entry on both mobile and desktop menus.
- lib/features/home/widgets/message_list_view.dart: pass version-count awareness into the more-actions sheet and route deleteCurrentVersion vs deleteAllVersions to separate callbacks.
- lib/features/home/pages/home_page.dart: add separate confirmation dialogs and action routing for deleting the current version versus deleting all versions in a message group.
- lib/features/home/controllers/home_page_controller.dart: add a controller entry point for deleting all versions in a message group and clear translation UI state for every removed version.
- lib/features/home/controllers/home_view_model.dart: unify version deletion logic, add deleteAllMessageVersions, compute the next selected version after removals, and remove stale selection state when a message group is deleted entirely.
- lib/core/services/chat/chat_service.dart: add clearSelectedVersion so persisted conversation version selections are removed when a message group no longer exists.
- lib/l10n/app_en.arb: rename delete strings to current-version wording and add all-version delete labels and confirmation copy.
- lib/l10n/app_zh.arb: add the same current-version/all-version delete wording in Chinese.
- lib/l10n/app_zh_Hans.arb: add the same current-version/all-version delete wording in Simplified Chinese.
- lib/l10n/app_zh_Hant.arb: add the same current-version/all-version delete wording in Traditional Chinese.
- lib/l10n/app_localizations.dart: regenerate localization interface for the new delete strings.
- lib/l10n/app_localizations_en.dart: regenerate English localization output.
- lib/l10n/app_localizations_zh.dart: regenerate Chinese localization output for zh / zh_Hans / zh_Hant.
- test/message_more_sheet_test.dart: verify that the menu shows Delete All Versions only when multiple versions exist.
- test/home_view_model_version_selection_test.dart: verify version-selection recomputation after deleting an earlier version, deleting the selected version, and deleting all versions.

Signed-off-by: Shuchen Luo <[email protected]>
@luosc luosc force-pushed the feat/437-delete-message-versions branch from cf5f3f4 to e87f2ca Compare April 10, 2026 15:49
@luosc
Copy link
Copy Markdown
Contributor Author

luosc commented Apr 10, 2026

@Chevey339 已经更新到最新基线了

@Chevey339 Chevey339 merged commit 7b93485 into Chevey339:master Apr 13, 2026
1 check passed
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.

增加一次性删除多次重roll的信息的功能

2 participants