refactor(client): adopt copyToClipboard helper at raw Clipboard.setData sites#1119
Open
NC1107 wants to merge 1 commit into
Open
refactor(client): adopt copyToClipboard helper at raw Clipboard.setData sites#1119NC1107 wants to merge 1 commit into
NC1107 wants to merge 1 commit into
Conversation
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.
Summary
Migrates 8 raw
Clipboard.setData(...) + ToastService.show(..., type: ToastType.success)pairs to the existingcopyToClipboard(context, text, successMessage: ...)helper inservices/clipboard_service.dart. Toast wording is preserved verbatim; the helper API is unchanged.Migrated sites
screens/settings/account_section.dart:343—_copyInviteLink(invite URL).screens/settings/account_section.dart:412— QR-code dialog "Copy invite link" button (usesdialogContext).screens/settings/about_section.dart:768— bulk copy of debug-log entries.screens/settings/about_section.dart:919— copy a single debug-log entry.screens/group_info_screen/parts/invite_section.dart:31— copy freshly-minted group invite URL.widgets/connection_status_badge.dart:464— diagnostics popover copy.widgets/message_item.dart:1441—_copyMessageText(message body or media URL).widgets/message_item.dart:1451—_copyMessageId.Skipped sites and why
screens/settings/data_storage_section.dart:84— the surroundingToastService.showomits thetype:arg, so it defaults toToastType.info. The helper hard-codessuccess, so migrating would change the toast type.widgets/image_gallery_viewer.dart:145— fallback path usesToastType.info("Save not supported here. Link copied.").widgets/message_item.dart:313, 356— both are fallback paths that surfaceToastType.info("Save not supported here yet. Link copied.", "Image copy not supported, link copied").widgets/message/media_content.dart:307— fallback path usesToastType.info.widgets/chat_input_bar/parts/keyboard_handling.dart:77— Ctrl+C / Ctrl+X keyboard handler; intentionally has no toast and isn't a "copy" UX surface.Behind the scenes
flutter/services.dartandtoast_service.dartimports from files that no longer reference them.flutter analyze --fatal-infosis clean;dart formatis a no-op on the touched files.account_section_test,about_section_test,connection_status_badge_test,message_item_test— 51/51).Test plan