Thread/forum side panel composer: paste, drops, reply and picker act on the panel's thread (#621) #628
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/side-panel-composer"
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?
A thread or forum post opens in the side panel while its parent channel or forum stays the selected channel. Several things sent from the panel were resolved against the selected channel, or were wired only to the channel's composer, so they hit the wrong channel or did nothing. This is the same class of bug #624 fixed for the edit actions, and the fix works the same way: each action carries the channel of the list or composer that sent it.
What was broken
Reproduced by the new tests before the fix, for both a thread and a forum post:
app.rs) only read the channel composer's, and it always sent the clipboard back to the channel's composer. So the paste did nothing.local.messages.channel(), the selected channel, and the overlay card named that channel too.StartReply,ToggleReplyMentionandCancelReplyresolved their channel fromui.selected_channel(chat/composer.rson_user). Reply from the panel's hover bar, menu or double click looked the message up in the parent or forum and did nothing. The panel's reply bar "@ On" and "x" acted on the parent's draft.OpenExpressionswas only handled for the channel's composer. The picker was also hidden for any composer channel other than the selected one, andPickEmoji { target: Composer }inserted into the selected channel's draft.Found in the audit and fixed here:
composer_picks), so it was counted again when the thread's message was sent.The attach button ("+" → Upload a file, and the double press) already sent
FileDialog::Attach { channel_id }with the thread's id. A test now covers it.Fix
event.rs,chat/port.rs,chat/composer.rs,chat/expressions.rs): the actions now carry their channel.StartReply { channel_id, message_id, mention },ToggleReplyMention(channel),CancelReply(channel),PickTarget::Composer { channel_id }.on_userno longer readsui.selected_channelat all.main::ComposerAt::{Channel, Panel}names the screen's two composers, andComposerAt::messagewraps a composer message for either one.main::take_paste_requestsays which composer asked for the clipboard, andapp.rssends the clipboard's contents back to that composer.main::active_composeris the composer in use. That is the panel's once a thread opens in it or once it is worked in, and the channel's again once that one is worked in. Drops (main::drop_target, which the overlay card also uses), the picker shortcuts and type-to-focus go to it. Drops carry no pointer position (winit), so "the composer in use" is the stand-in. The original listens on the window from both views.expressions::shownlets it show for the panel's thread, and it closes when the panel goes. Each composer's button is drawn selected only when the picker is open for its own channel (main::expression_buttons).main::attachment_formreturns the open "Edit attachment" form of either tray. Escape closes the panel's "+" menu.Tests
crates/fluxer-ui/tests/side_panel_composer.rs(new). Each test runs for a thread of #general and for a post of the "ideas" forum, throughmain::updateas the window drives it:crates/fluxer-core/tests/chat_composer.rs:reply_and_pick_in_a_channel_not_selected.Not done
#602 (the panel and the forum composer building
ComposerOptionsfromcomposer_context) is a separate change and is not in this PR.Refs #621
🤖 Generated with Claude Code
Conflicts: - app.rs: textchat's new tick work (community icon pick) kept; the paste request is read from either composer (main::take_paste_request). - expressions/mod.rs: the pick-one mode (Daily use 32) is kept on top of PickTarget::Composer { channel_id }; `shown` counts a pick-one picker as shown, so the sync that closes a panel's picker leaves it open. - main/mod.rs: the custom status pick and the per-channel expect_store_change both kept. Semantic: MentionUser (Daily use 18) names no channel; it reads the selected channel itself now that the reducer's shared `selected` is gone. The custom status picker sets the composer buttons through main::expression_buttons. Refs #621 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>2354c737dropped; merge textchat abf0bb0670Updated to
textchate932e06c(head nowabf0bb06).Important: the previous head
2354c737was a soft-reset commit on top ofe932e06cwhose tree was the PR's tree on the old textchat (c8faabf4). It "merged textually" because it was a fast-forward, but it would have reverted everything textchat gained since (Daily use tasks, runtime, fixtures, goldens). The update merges the PR's real commit (ccf1c87f, identical tree to2354c737, based onc8faabf4) withorigin/textchat(d3cbc272) andabf0bb06takes that merged tree.git diff origin/textchat abf0bb06is now just the PR's 26 files plus one line inchat/composer.rs.Conflicts resolved:
app.rs(tick): kept textchat's community-icon pick; the paste request comes from either composer (main::take_paste_request).expressions/mod.rs: kept the status picker's pick-one mode (Daily use 32) withPickTarget::Composer { channel_id };shown()treats a pick-one picker as shown, so the sync that closes a panel's picker doesn't close it.main/mod.rs: kept both the custom-status emoji pick and the per-channelexpect_store_change.Other fixes after the merge:
MentionUser(Daily use 18) has no channel, and the reducer's sharedselectedwas removed, so it now readsui.selected_channelitself. Behaviour is unchanged: a Shift-click or "Mention" on a user in the thread panel still goes into the selected channel's composer. That case still needs its own follow-up.main::expression_buttons.Textchat added no other senders of
StartReply,ToggleReplyMention,CancelReplyorPickTarget::Composer. The media viewer's, the message actions' and the keyboard reply paths already pass their own channel. No goldens changed.FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: all steps passed (including side_panel_composer, picker_images, media_viewer_layers, status::emoji_pick_one_mode, status::custom_status_modal_binds).🤖 Generated with Claude Code