Text chat 39: fluxer-core forums and media channels #324

Closed
opened 2026-11-12 18:16:19 +00:00 by charles · 0 comments
Owner

Plan: docs/superpowers/plans/2026-11-12-textchat.md, section "Task 39". Spec: §18 of docs/superpowers/specs/2026-11-12-fluxer-native-textchat-design.md (channel types, added 2026-11-12 when Charles overruled #286 Q4).

Task 39: fluxer-core forums and media channels

Issue: (to be created)

Files:

  • Modify: crates/fluxer-core/src/chat/forums.rs, crates/fluxer-core/src/chat/uploads.rs (forum post jobs only: the ForumPostUploadSpec path next to Text chat 12's)
  • Test: crates/fluxer-core/tests/chat_forums.rs

Interfaces:

  • Consumes: Text chat 11 (Draft, content::to_wire), 12 (uploads, FileRef, limits), 13 (reaction toggle for the default reaction), 18, 38.

  • Produces: spec §18.2.1, §18.2.2 and §18.4 "chat::forums": ForumState per forum; selectors::forum_view(&App, forum) -> ForumViewModel { kind: ForumKind::{Forum, Media}, guidelines: Option<String>, can_post, search: SearchBoxModel { query, state, count }, sort, layout, layout_choice_visible, tags: Vec<TagPill { tag, selected }>, sections: Vec<PostSection { title: Option<String> /* "Older posts" */, posts: Vec<Snowflake> }>, state: ListState::{Loading, Ready, Empty, EmptySearch, Failed, Indexing}, can_load_older, composer: Option<ForumComposerModel> }; selectors::post_card(&App, post) -> PostCardModel { name, pinned, new, tags: Vec<ForumTag> /* ≤3 */, extra_tags, author, preview: PostPreview::{Text(String), Deleted, Loading}, media: Option<CardMedia { attachment, video }>, reaction: Option<DefaultReactionModel { emoji, count, me, enabled }>, message_count, unread: Option<UnreadLabel::{Count(u32), Some}>, last_activity, open }; sort keys (id vs last activity), pinned first, active then archived; archived/search through SearchThreads (offset paging 25, NotReady → retry after retry_after_s via Effect::Schedule, unavailable → ArchivedThreads { kind: Public } fallback), text search debounced 300 ms; PostData for visible posts without a loaded starter (≤100 per call, each post once); forum unreads: op 28 batches (≤40, 4 per 5 s, 15 s timeout) for visible posts, FORUM_UNREADS applied only while the ack id matches and the user is not a member; composer: title ≤100, body Draft (draft key forum-post:{forum}), tags ≤5 with REQUIRE_TAG, moderated tags only with MANAGE_THREADS, media channels need an image/video file, slowmode from default_thread_rate_limit_per_user, errors with the original's strings, submit → CreateForumPost (no files) or UploadCommand::StartForumPost; success opens the post (OpenThread), failure keeps the draft and sets the toast text; default reaction toggles the reaction on the starter (message_id == post id), disabled when locked/archived; follow = join/leave; pin post (EditThread { flags: PINNED }, one per forum) and edit tags (EditThread { applied_tags }); copy post link (Effect::Clipboard, {webapp}/channels/{guild}/{post}; verify the original's link format in ForumPostActions.tsx).

  • Step 1: Write failing tests: active_posts_from_store_sorted_by_activity_and_creation, pinned_first_then_active_then_older_posts, layout_default_list_media_always_grid, sort_and_layout_override_per_forum, tag_filter_match_some_and_all, archived_loaded_by_search_offset_25, search_debounced_300ms_relevance, not_ready_202_retries_after, search_unavailable_falls_back_to_archived_public, post_data_requested_once_per_post_chunked_100, card_preview_deleted_starter, card_media_skips_spoiler_nsfw_expired, forum_unreads_batches_40_rate_limited, forum_unreads_ignored_when_member_or_ack_changed, composer_validation_strings, require_tag_and_moderated_tags, media_post_needs_image_or_video, `submit_json_witho

🤖 Generated with Claude Code

Plan: `docs/superpowers/plans/2026-11-12-textchat.md`, section "Task 39". Spec: §18 of `docs/superpowers/specs/2026-11-12-fluxer-native-textchat-design.md` (channel types, added 2026-11-12 when Charles overruled #286 Q4). ### Task 39: `fluxer-core` forums and media channels **Issue:** (to be created) **Files:** - Modify: `crates/fluxer-core/src/chat/forums.rs`, `crates/fluxer-core/src/chat/uploads.rs` (forum post jobs only: the `ForumPostUploadSpec` path next to Text chat 12's) - Test: `crates/fluxer-core/tests/chat_forums.rs` **Interfaces:** - Consumes: Text chat 11 (`Draft`, `content::to_wire`), 12 (uploads, `FileRef`, limits), 13 (reaction toggle for the default reaction), 18, 38. - Produces: spec §18.2.1, §18.2.2 and §18.4 "chat::forums": `ForumState` per forum; `selectors::forum_view(&App, forum) -> ForumViewModel { kind: ForumKind::{Forum, Media}, guidelines: Option<String>, can_post, search: SearchBoxModel { query, state, count }, sort, layout, layout_choice_visible, tags: Vec<TagPill { tag, selected }>, sections: Vec<PostSection { title: Option<String> /* "Older posts" */, posts: Vec<Snowflake> }>, state: ListState::{Loading, Ready, Empty, EmptySearch, Failed, Indexing}, can_load_older, composer: Option<ForumComposerModel> }`; `selectors::post_card(&App, post) -> PostCardModel { name, pinned, new, tags: Vec<ForumTag> /* ≤3 */, extra_tags, author, preview: PostPreview::{Text(String), Deleted, Loading}, media: Option<CardMedia { attachment, video }>, reaction: Option<DefaultReactionModel { emoji, count, me, enabled }>, message_count, unread: Option<UnreadLabel::{Count(u32), Some}>, last_activity, open }`; sort keys (id vs last activity), pinned first, active then archived; archived/search through `SearchThreads` (offset paging 25, `NotReady` → retry after `retry_after_s` via `Effect::Schedule`, unavailable → `ArchivedThreads { kind: Public }` fallback), text search debounced 300 ms; `PostData` for visible posts without a loaded starter (≤100 per call, each post once); forum unreads: op 28 batches (≤40, 4 per 5 s, 15 s timeout) for visible posts, `FORUM_UNREADS` applied only while the ack id matches and the user is not a member; composer: title ≤100, body `Draft` (draft key `forum-post:{forum}`), tags ≤5 with `REQUIRE_TAG`, moderated tags only with MANAGE_THREADS, media channels need an image/video file, slowmode from `default_thread_rate_limit_per_user`, errors with the original's strings, submit → `CreateForumPost` (no files) or `UploadCommand::StartForumPost`; success opens the post (`OpenThread`), failure keeps the draft and sets the toast text; default reaction toggles the reaction on the starter (`message_id == post id`), disabled when locked/archived; follow = join/leave; pin post (`EditThread { flags: PINNED }`, one per forum) and edit tags (`EditThread { applied_tags }`); copy post link (`Effect::Clipboard`, `{webapp}/channels/{guild}/{post}`; verify the original's link format in `ForumPostActions.tsx`). - [ ] **Step 1: Write failing tests**: `active_posts_from_store_sorted_by_activity_and_creation`, `pinned_first_then_active_then_older_posts`, `layout_default_list_media_always_grid`, `sort_and_layout_override_per_forum`, `tag_filter_match_some_and_all`, `archived_loaded_by_search_offset_25`, `search_debounced_300ms_relevance`, `not_ready_202_retries_after`, `search_unavailable_falls_back_to_archived_public`, `post_data_requested_once_per_post_chunked_100`, `card_preview_deleted_starter`, `card_media_skips_spoiler_nsfw_expired`, `forum_unreads_batches_40_rate_limited`, `forum_unreads_ignored_when_member_or_ack_changed`, `composer_validation_strings`, `require_tag_and_moderated_tags`, `media_post_needs_image_or_video`, `submit_json_witho 🤖 Generated with [Claude Code](https://claude.com/claude-code)
charles added this to the Text chat milestone 2026-11-12 18:16:19 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#324
No description provided.