Repository navigation
Add archive action to chat list long-press and desktop context menus - #217
Conversation
iebb
left a comment
There was a problem hiding this comment.
Reviewed e8bb01d against master 066c2d6 in an isolated credential-free snapshot; all 21 changed-file blobs (including regenerated locales) match. The new Archive entry uses owned icons and the existing non-destructive addChatToList/chatListArchive behavior. 59 focused preview/model/localization tests pass; scoped formatting/analyzer, 8 locales x 3827 keys, generated assets, visible strings, and registration anchors pass. Exact-head Quality CI is green.
Before approval/merge, complete .github/pull_request_template.md as required by AGENTS.md: select exactly one Telegram API Terms classification, explain the affected behavior, check the basic evidence items, and mark section 1.4 exception checks not applicable if classifying this ordinary explicit archive action as compliant/unchanged. The current Summary/Test plan omits that mandatory classification/checklist. The source review finds this consistent with ordinary explicit archive behavior; that does not replace the required contribution declaration.
Please also pin the production archive request (chat ID/list and account ownership across delayed menu dismissal), rather than only a stand-in callback, in focused coverage. No Telegram account or native operation was exercised. Direct Git fetching is currently unavailable, so no local commit, merge, or push was made. This is a legitimate improvement, not a rejection/closure.
- Long-pressing an unarchived chat in the main chat list now offers Archive in the preview action menu (between Pin and Mute), dispatching addChatToList -> chatListArchive. - The desktop right-click context menu gets the same Archive item (after Mute); DesktopChatContextMenu._menuHeight updated for the extra row. - Pin the foreground ChatPreviewOwner when opening the preview or desktop context menu; showChatListPreview re-checks owner.isCurrent after the delayed dismissal transition, and ChatListViewModel.archive verifies owner.isCurrent and dispatches through owner.query so an account switch or client replacement mid-dismissal drops the request instead of mutating the replacement account. - New l10n key chatListArchive across all 8 locales.
e8bb01d to
079e7d8
Compare
|
Updated and rebased onto current
|
iebb
left a comment
There was a problem hiding this comment.
Re-reviewed 079e7d8. The required declaration and production request/account-ownership tests requested earlier are now present. All 61 supplied/adjacent menu/model/localization tests pass, including dispatch through the pinned client and suppression during delayed-dismissal account/session replacement.
One additional failing-first boundary exposed a null-owner fallback: archive(chat, owner:null) dispatched addChatToList/chatListArchive through the later active account. The intended maintainer merge repairs this narrowly: owner is a required nullable argument, a missing or expired owner fails closed, and the request uses only owner.query (never a foreground-client fallback). A new archive_owner_boundary_test.dart drives the actual shared proxy transport and proves no request escapes. The repaired focused set passes 62 tests. Repair files are only lib/chats/chat_list_view_model.dart and that regression test; other reviewed PR files are unchanged. This confirmation covers the repaired intended integration, not approval to merge the unmodified head.
Independently reviewed the actual production diff and affected entry points. The completed contribution template is present; classification is compliant/unchanged, with no Section 1.4 feature or required exception guard. No authentication, protocol/native, storage-schema, release/deployment, or official-build flag path changes. Credential-free snapshots use secrets_example.dart only. The combined intended master tree 6202d9cf8812ed9ca91a39422039a4cfbcee0102 passes all 3,449 unit/widget tests (one existing skip), formatting of 999 files with zero changes, full analysis, 8 locales x 3830 keys / 9 generated locale assets, visible-string and registration checks, and explicit false/true/invalid build-flag tests. Current exact-head Quality is green. Platform evidence here is shared Flutter layout/navigation/selection testing, not native-device QA; no Telegram, real account, deployment, or store action was used.
Change
Main-list chat rows lacked an explicit Archive entry in the mobile long-press preview menu and the desktop right-click context menu.
_showChatPreviewinlib/chats/chat_list_view.dart): adds aChatListPreviewAction(label: AppStringKeys.chatListArchive, icon: HeroAppIcons.archiveBox, onSelected: () => _model.archive(chat, owner: owner))row between Pin and Mute.DesktopChatContextMenuinlib/chats/chat_list_view.dart): adds a_DesktopChatContextMenuItem(key: ValueKey('desktop-chat-context-archive'), icon: HeroAppIcons.archiveBox, label: AppStringKeys.chatListArchive, onTap: () => _select(onArchive))row after Mute and updates_menuHeightfor the extra38pxrow.lib/chats/chat_list_preview.dart,lib/chats/chat_list_view_model.dart,lib/chats/chat_list_view.dart): pins the foregroundChatPreviewOwner(_TdChatPreviewAccounts.pinActiveOwner()) when opening the preview or desktop context menu.showChatListPreviewre-checksowner.isCurrentafterawait route.completed(the reverse transition), andChatListViewModel.archive(chat, {owner})verifies!_disposedandowner.isCurrentbefore dispatchingaddChatToList(chatListArchive) throughowner.query(bound toowner.clientId), so an account switch, session replacement, slot close, or shutdown during delayed dismissal suppresses the action instead of archiving on the replacement account.chatListArchiveacross all 8 locales (lib/l10n/app_localizations.dart,translations/strings/<locale>/strings.xml, regeneratedassets/l10n/<locale>.json).showChatListPreview) and desktop (DesktopChatContextMenu).Telegram API Terms classification
Follow the contribution and agentic review rules. Select exactly one classification and explain it below.
This is an agentic source-code review classification. Every store version must remain compliant with applicable Telegram API Terms; the guarded-source exception does not apply to store distribution or review.
allowTelegramTosViolations(I_DONT_FUCKING_CARE_ABOUT_TOS), disabled in official builds, and available only in an explicitly enabled self-build.Reason and affected Telegram behavior: Exposes an explicit user-triggered Archive action (
addChatToListwithchatListArchive) in the chat-list menus, matching the existing unarchive path (addChatToListwithchatListMain). Does not modify read receipts, typing indicators, online status, self-destructing media, or message retention, and introduces no section 1.4 behavior.Basic checks (every PR)
Check each item after verification. If a check is inapplicable, explain why in the evidence below before checking it.
dart format --output=none --set-exit-if-changedon the 6 changed.dartfiles (CI Dart SDK 3.12.2 / Flutter 3.44.2,Formatted 6 files (0 changed)).flutter analyzeon the 6 changed.dartfiles (No issues found!).flutter test --concurrency=4.Commands, results, platform/build/UI evidence, and reasons for inapplicable checks:
~/.cache/dart3122/bin/dart format --output=none --set-exit-if-changed lib/chats/chat_list_preview.dart lib/chats/chat_list_view.dart lib/chats/chat_list_view_model.dart lib/components/app_icons.dart lib/l10n/app_localizations.dart test/chat_list_preview_test.dart→Formatted 6 files (0 changed)PATH=/tmp/flutter-3.44.2/bin:$PATH flutter analyze lib/chats/chat_list_preview.dart lib/chats/chat_list_view.dart lib/chats/chat_list_view_model.dart lib/components/app_icons.dart lib/l10n/app_localizations.dart test/chat_list_preview_test.dart→No issues found!PATH=/tmp/flutter-3.44.2/bin:$PATH flutter test --no-pub -j 1 test/chat_list_preview_test.dart test/chat_list_view_model_lifecycle_test.dart test/l10n_completeness_test.dart→ 61/61 passed:test/chat_list_preview_test.dart(34 passed, includingdesktop context menu archive dispatches addChatToList/chatListArchive to the pinned owner,chat preview offers archive and dismisses before invoking, andpreview archive is suppressed when account ownership changes during delayed dismissal)test/chat_list_view_model_lifecycle_test.dart(7 passed)test/l10n_completeness_test.dart(20 passed)e8bb01d9,ChatListViewModel.archivetook noownerand dispatched throughTdClient.shared.query(resolving the current foreground client afterroute.completed), so switching accounts or replacing the slot's client during the 220ms reverse transition dispatchedaddChatToList(chat_id: 42, chatListArchive)to the replacement account instead of dropping it.python3 tool/check_l10n_strings.py→No visible UI string literals outside lib/l10n.python3 translations/tools/check.py→8 locales x 3830 keys (11 counted): OKpython3 translations/tools/gen_assets.py --check→9 locale assets are up to datepython3 tool/gen_registration_anchors.py --check→ exit 0Section 1.4 exception checks
Not applicable
Agentic reviewer confirmation
Agentic code reviewer only: record this confirmation in the PR review or check these boxes before approval.