Text chat 46: New forum post composer (#331) #472
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "textchat-46-ui-forum-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?
Stacked on: textchat-45-ui-forum-view
What
The new forum/media post composer (spec §18.2.1 "Create", §18.2.2), replacing Task 45's title stub in the search card's place:
forum/composer.rs: title input ("Give your post a title", 1.25 rem semibold, 100 chars, Enter moves focus to the body), X "Discard post"; body = the Text chat 25 editor viaComposerOptions { send_on_enter: false, slash_commands: false, typing: false, draft_key: DraftKey::Other(forum) }(Enter/Ctrl+Enter never send, Up never edits), upload tray above it, autocomplete popup inline; preview ("Preview"/"Edit", Markdown or "Nothing to preview yet."); cooldown hint and error strings from the store; bar with "Add images or files" (file dialog on the forum's draft), "Add emoji" (expression picker on the Emojis tab), tags, preview toggle, "Post" (disabled unlesscan_submit). While the post's files go up, their progress cards (with "Cancel upload") show in the card. Failure toast is Task 45's forum toast.forum/composer_tags.rs: "Add tags" + chosen pills (click removes) + "Required"; popout with every tag, moderated ones disabled without MANAGE_THREADS, all unchosen ones disabled at 5, "You can pick up to 5 tags."Deviations / outside the Files list (minimal)
composer/mod.rs: newpub fn editor(..)(the text box alone);view_withnow calls it.main/mod.rs: routesforum::Message::Composerwith the screen's composer state (the body islocal.messages.composer, which already follows the selected channel = forum draft, so paste, drop and emoji picks work unchanged); "Add emoji" toggles the expression picker.forum::viewtakes the composer state.app.rs: focuses the title when the composer opens and the body on title Enter (forum.composer.take_focus()).theme/icons.rs+assets/icons/{tag-bold,eye-bold}.svg(Phosphor 2.1.10 bold path data, from the fork's node_modules).toolbar::composer_stubremoved (replaced).forum-post:{forum};DraftKey::Other(forum)points at it.docs/screenshots/README.md: rows for the three new screenshots.Tests
crates/fluxer-ui/tests/forum_composer.rs:title_enter_moves_to_body,post_enabled_rules,tag_picker_limit_and_required,preview_toggle,media_placeholder_and_error,submit_emits_submit_post,discard_closes(seen failing before the implementation, then passing).forum_composer,forum_composer_tags,media_composer(goldens infixtures/golden/).FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen locally (Linux). No FLUXER_DESKTOP_TESTS tests in this task.apps/fluxerlib test binary sometimes aborts at exit (glibc mutex assertion) after all tests pass; seen on the base, about 1 run in 5.Closes #331
🤖 Generated with Claude Code
CancelUpload on a forum-post upload job put the draft back but left ForumComposer.pending as Upload(nonce); the runtime reports nothing after a cancel, so the composer stayed submitting. Forums now clears it. Also document why the post body draft is keyed by the forum id rather than the spec's forum-post:{forum}. Refs #324 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>Independent review: Text chat 46 (new forum post composer)
I reviewed
78e5dc5..251d4bbwithout relying on the implementer's notes.Plan tests: all 7 named tests are in
crates/fluxer-ui/tests/forum_composer.rs:title_enter_moves_to_body,post_enabled_rules,tag_picker_limit_and_required,preview_toggle,media_placeholder_and_error,submit_emits_submit_postanddiscard_closes. They assert the spec's strings and values:CreateForumPostcarries the name,applied_tagsand the contentAll 3 screenshots are present (
forum_composer,forum_composer_tags,media_composer), and I checked them by eye.Interfaces: the composer uses
ComposerOptions { send_on_enter: false, slash_commands: false, typing: false, draft_key: DraftKey::Other(forum) }. The core stops typing announcements for the forum composer (chat/composer.rs:273). The card border isbackground_modifier_accent_focus. The "Couldn't create the post" toast and the validation strings come from the core (ForumComposerError). The moderated-tag tooltip is ontags::pill_with(Task 45). No other task's interface is broken.forum::viewnow also takes the text-box state, and every caller in the tree is updated.Invariants: the diff only touches
fluxer-ui, docs and goldens. It adds no I/O path and no dependency. The file dialog goes throughUserAction::OpenFileDialog. It adds no fixtures, and I found no secrets, URLs or paths. The title is cut to 100 chars in the UI and to 100 UTF-16 units in the core (cut_utf16), so the title matches the server's limit.Findings
forum/composer.rsupload()picks the newest job withmax_byon the nonce string. That is right only while nonces have the same length. In practice there is one upload at a time per forum, so this is cosmetic.forum::updatedropsMessage::Composer(Body(..))(no text-box state). That is correct becausemain::updateroutes it first, but only the main screen's routing makes the body work. A future caller that bypassesmain::updatewould lose keystrokes silently.Local CI:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciin a clean review worktree passed every step (exit 0). The sporadic glibc abort (#470) did not show up in this run.Verdict: approve. There are no blocking findings and local CI is green.