feat(chat): add delete-all-versions action for multi-version messages#452
Merged
Chevey339 merged 1 commit intoChevey339:masterfrom Apr 13, 2026
Merged
Conversation
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]>
cf5f3f4 to
e87f2ca
Compare
Contributor
Author
|
@Chevey339 已经更新到最新基线了 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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: