Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/editor-forum-edit"
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?
Two reports from Windows (#617, #616).
What was wrong
#617: Ctrl+Backspace deleted one character. The composer, the inline edit box and the forum post body are all iced
text_editors with ourwidgets::composer::binding. Anything that binding doesn't handle goes toBinding::from_key_press, which maps Backspace/Delete to one-character edits whatever the modifiers are (iced_widget 0.14.2text_editor.rs:1211). iced's editor has no word-delete. The search box is an icedtext_input, which has one, so it already worked there.#616: own forum post could not be edited. Clicking a forum post opens it in the thread side panel, and the forum stays
ui.selected_channel. The hover bar and context menu did offer Edit for the starter and for replies, butUserAction::StartEdit(message_id)(andEditLastMessage,SaveEdit,CancelEdit) found their channel throughselected_channel(crates/fluxer-core/src/chat/composer.rs,on_user). So the message was looked up in the forum, not found, and nothing happened. A regular thread in the side panel had the same problem. The full view was not affected.What changed
widgets::composer: two new keys,Key::DeleteWordBackwardandKey::DeleteWordForward, for Ctrl+Backspace and Ctrl+Delete (modifiers.jump(), so Option on macOS). The binding matches the logical key or the physical key.composer::Mirror::delete_word: with a selection, deletes just the selection. Without one, it selects withMotion::WordLeft/WordRight(the motion Ctrl+Left/Right already use) and then deletes. Word-delete therefore stops where word movement stops: UAX #29 words with punctuation and whitespace skipped, and at a line start it joins the line above. Handled in bothmain_keyandedit_key. The forum body reusesmain_key.UserAction::StartEdit { channel_id, message_id },EditLastMessage(channel),SaveEdit(channel)andCancelEdit(channel)now carry the channel of the message list or composer that sent them. This matches the original'sMessageCommands.startEdit(channelId, messageId, ...). Call sites, tests and the core/ui READMEs are updated.Tests
fluxer-ui/tests/composer.rsctrl_backspace_and_delete_by_words: checks the bindings, including Ctrl+Left/Right givingMove(WordLeft/WordRight)and Ctrl+Shift+Left/Right givingSelect(...). It then drives the key presses through the composer and the store: deleting words with punctuation, deleting mid-word, Ctrl+Delete, deleting only the selection, the line join, doing nothing at the start and end, and the inline edit box. It failed before the fix.fluxer-ui/tests/forum.rsown_post_edited_from_the_panel: opens an own post in the panel and checks that the starter and a reply offer Edit in the bar and the menu. Clicking Edit opens the post composer's inline edit (and not the forum's). Enter sendsPatchMessageto the post, and Escape cancels there. It failed before the fix: the edit never opened.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cipasses locally ("all steps passed"). No goldens changed.Not verified
Named(Backspace)or physicalCode::Backspace; we match either.Not fixed here
StartReply,ToggleReplyMention,CancelReplyandPickEmoji { target: Composer }still resolveselected_channel, so Reply in the side panel (thread or forum post) probably does nothing. It's the same cause, and a follow-up should apply the same fix.Refs #616, #617
🤖 Generated with Claude Code