Copy IDs: toasts for the DM menu, status popout and message copies (#597) #639
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/597-copy-id"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #597
Cause
#597 was filed on
890f6d8. At that commit nothing handledUserAction::CopyId. Daily use 17 (6db33abf,feat(core): channel, category and guild menus) has since landed ontextchat, and with itfluxer-core/src/menus/channel.rs::reduce, called fromapp.rs:316. That reducer matchesCopyId(_, id)for everyIdKind, so ontextchatall the "Copy … ID" rows already put the right text on the clipboard. The new tests below show this: they pass on the unchanged base for every surface, through to the runtime's text clipboard.The real gap on
textchatwas the confirmation. TwoCopyIdsurfaces did not show the toast the original shows:menus::pick(fluxer-ui/src/screens/main/menus/mod.rs) only askedchannel::toastandguild::toast, and neither knowscopy-user-id. The original toasts "User ID copied" (DMMenuData.tsx:497-505). The user and member menus' "Copy user ID" correctly has no toast (CopyUserIdMenuItem,suppressToast = true).CopyId. The original callsTextCopyCommands.copy(i18n, currentUserId), which toasts "Copied to clipboard" (UserAreaPopout.tsx:447-452).Also fixed while auditing: a message's Copy text / Copy message link / Copy message ID copied correctly but showed no toast, while the original's
MessageActionUtils.tsx:545-572(TextCopyCommands.copy) shows "Copied to clipboard".Fix
It follows the existing pattern: the store answers with
Effect::Clipboard(ClipboardWrite::Text), and the UI owns the toast onmenus::State.menus::dm::toast(target, item): "User ID copied" for the DM menu'scopy-user-id. "Channel ID copied" still comes fromchannel::toast, which matchesDMMenuData.tsx:489-496.menus::State::show_toast(text): the same toast, clock and timer as the copy rows.main::update: the status popout'sCopyUserIdand anyUserAction::CopyMessageput up "Copied to clipboard" (menus::guild::COPIED_TO_CLIPBOARD).fluxer-corenow says thatCopyIdcovers everyIdKind, including the user, DM and status-popout rows.fluxer-uidocuments the new toasts.There is no change to
fluxer-core's code, and no new I/O path.Copy actions
{webapp}/channels/{guild}/{channel}{webapp}/channels/{guild|@me}/{channel}/{message}{channel}-{message}){webapp}/channels/{guild}/{post}{invite}/{code}originalSrc)dailyuse_runtime)Tests
crates/fluxer-ui/tests/copy_actions.rs(new): every menu copy row (channel, category, guild, member, author, mention, self, DM, group DM), the status popout, the four message copies, the forum post link and the thread menu (a headless click). Each test goes UI message →UserAction→App::apply→ clipboard text, plus the toast. Before the fix, two of them failed on the toast (DM "Copy user ID", status popout); the text assertions passed.crates/fluxer-ui/tests/attachment_actions.rs: the lightbox's "Copy link" carries the attachment's own URL.apps/fluxer/tests/dailyuse_runtime.rs::copy_ids_reach_text_clipboard:CopyIdfor a user, a channel, a group DM and a guild, through the real runtime, todesktop_rt'sTextClipboard(fake).FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciis green locally.Not verified: the real system clipboard on Wayland, X11 and Windows. The last hop is iced's
clipboard::write, unchanged here.🤖 Generated with Claude Code
On textchat every CopyId already reaches the clipboard through menus::channel::reduce (Daily use 17); the gaps were the original's confirmations: the DM menu's "Copy user ID" ("User ID copied"), the status popout's "Copy user ID" and a message's Copy text / link / ID ("Copied to clipboard"). menus::dm::toast and menus::State::show_toast add them. Tests: fluxer-ui tests/copy_actions.rs drives every copy row from the UI through the store to the clipboard text and its toast; the lightbox's "Copy link" URL; dailyuse_runtime copy_ids_reach_text_clipboard runs CopyId through the runtime to the text clipboard. Closes #597 Refs #638 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>