Text chat 40: fluxer-core announcements, thread administration and personal notes (#325) #448

Manually merged
charles merged 7 commits from textchat-40-core-announcements-thread-admin into textchat 2026-11-13 13:51:18 +00:00
Owner

Stacked on: textchat-38-core-channel-routing

What

  • chat::announcements: can_crosspost (canCrosspostMessage rules), announcement_actions ("Publish" / disabled "Published"), Confirm::Crosspost (Shift = confirmed: true), crosspost_nudge (newest own unpublished message; per-message dismiss; "Don't show again" saved as hide_crosspost_nudge), can_follow, follow_targets, FollowChannel, crosspost_card (CrosspostSource fetched once per copy; 403/404 -> Unavailable), toast strings.
  • chat::thread_admin: thread browser (tabs, archived pages + Load more, search debounced 300 ms with relevance sort, index-not-ready retries, offset paging), thread_browser, thread_header, thread_composer_notice (Locked/Closed/Join), thread_starter (type 21; parent message fetched with FetchMessages { around, limit: 1 } when absent), thread_welcome, thread_menu (original items + ThreadPermissionUtils rules), thread_link, thread_members; EditThread (close/reopen/lock/unlock/settings under threadPatchRequirement), DeleteThread and private LeaveThread confirms, Join, RemoveThreadMember, SetThreadNotifications (exactly one flag), MuteThread; PurgeNotes with confirm and toasts.
  • chat::threads (additive): member_lists from THREAD_MEMBER_LIST_UPDATE.

Tests

tests/chat_announcements.rs (6) and tests/chat_thread_admin.rs (15), the plan's names; FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally.

Deviations / outside the Files list

  • chat/actions.rs: new Confirm::{Crosspost, DeleteThread, LeaveThread, PurgeNotes} and MessageAction::{Publish, Published}.
  • chat/mod.rs: announcements/thread_admin reducers receive &mut chat.confirm (and thread_admin &chat.threads); re-exports. selectors/mod.rs: re-exports (thread menu item exported as ThreadMenuItem; the type is thread_admin::MenuItem).
  • event.rs: new UserAction::MuteThread { thread_id, muted } (spec 18.2.5 Mute/Unmute had no port).
  • tests/chat_channel_kinds.rs: Task 38's phase5_stubs_emit_nothing no longer lists the Task 40 actions (they now act).
  • ThreadHeaderModel gains joined (the notification button shows only for members).
  • "Archived private threads" tab: MANAGE_THREADS in a text parent only, as the plan/spec say; the original also shows it to non-moderators with their own archived private threads (users/@me/..., ArchivedKind::MinePrivate).
  • Thread menu: "Delete my messages" and dev-mode "Debug thread" not built; "Copy thread ID" always shown (no developer mode here).
  • Toasts are kept as text in chat.announcements.toast / chat.thread_admin.toast (no toast mechanism in core yet).

Closes #325

🤖 Generated with Claude Code

Stacked on: textchat-38-core-channel-routing ## What - `chat::announcements`: `can_crosspost` (`canCrosspostMessage` rules), `announcement_actions` ("Publish" / disabled "Published"), `Confirm::Crosspost` (Shift = `confirmed: true`), `crosspost_nudge` (newest own unpublished message; per-message dismiss; "Don't show again" saved as `hide_crosspost_nudge`), `can_follow`, `follow_targets`, `FollowChannel`, `crosspost_card` (CrosspostSource fetched once per copy; 403/404 -> Unavailable), toast strings. - `chat::thread_admin`: thread browser (tabs, archived pages + Load more, search debounced 300 ms with relevance sort, index-not-ready retries, offset paging), `thread_browser`, `thread_header`, `thread_composer_notice` (Locked/Closed/Join), `thread_starter` (type 21; parent message fetched with `FetchMessages { around, limit: 1 }` when absent), `thread_welcome`, `thread_menu` (original items + `ThreadPermissionUtils` rules), `thread_link`, `thread_members`; EditThread (close/reopen/lock/unlock/settings under `threadPatchRequirement`), DeleteThread and private LeaveThread confirms, Join, RemoveThreadMember, SetThreadNotifications (exactly one flag), MuteThread; PurgeNotes with confirm and toasts. - `chat::threads` (additive): `member_lists` from `THREAD_MEMBER_LIST_UPDATE`. ## Tests `tests/chat_announcements.rs` (6) and `tests/chat_thread_admin.rs` (15), the plan's names; `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally. ## Deviations / outside the Files list - `chat/actions.rs`: new `Confirm::{Crosspost, DeleteThread, LeaveThread, PurgeNotes}` and `MessageAction::{Publish, Published}`. - `chat/mod.rs`: announcements/thread_admin reducers receive `&mut chat.confirm` (and thread_admin `&chat.threads`); re-exports. `selectors/mod.rs`: re-exports (thread menu item exported as `ThreadMenuItem`; the type is `thread_admin::MenuItem`). - `event.rs`: new `UserAction::MuteThread { thread_id, muted }` (spec 18.2.5 Mute/Unmute had no port). - `tests/chat_channel_kinds.rs`: Task 38's `phase5_stubs_emit_nothing` no longer lists the Task 40 actions (they now act). - `ThreadHeaderModel` gains `joined` (the notification button shows only for members). - "Archived private threads" tab: MANAGE_THREADS in a text parent only, as the plan/spec say; the original also shows it to non-moderators with their own archived private threads (`users/@me/...`, `ArchivedKind::MinePrivate`). - Thread menu: "Delete my messages" and dev-mode "Debug thread" not built; "Copy thread ID" always shown (no developer mode here). - Toasts are kept as text in `chat.announcements.toast` / `chat.thread_admin.toast` (no toast mechanism in core yet). Closes #325 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Refs #323

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Publish (crosspost) with its confirm, "Published", the publish nudge,
Follow and its targets, the crosspost source card; the thread browser,
menu, edit/close/reopen/lock/unlock/delete/join/leave/remove member,
notification level and mute, the full-view header, composer notices,
starter message and welcome; thread member lists from
THREAD_MEMBER_LIST_UPDATE; purging personal notes.

Refs #325

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Independent review: Text chat 40 (head 97237f1, diff 29bca22..97237f1)

Tests (1): all 21 tests named in the plan exist (tests/chat_announcements.rs, tests/chat_thread_admin.rs) and assert what the plan asks for: the canCrosspostMessage table (type, state, snapshots, copy, SEND_MESSAGES, author/MANAGE_MESSAGES), confirm vs confirmed, Published after CROSSPOSTED or the answer, MESSAGE_ALREADY_CROSSPOSTED toast, nudge + "Don't show again" saved as hide_crosspost_nudge, notify flags 2/4/8 exactly one, the purge toast strings (checked against DirectMessageList.tsx:82-89).
Interfaces (2): announcement_actions, can_crosspost, Confirm::Crosspost, crosspost_nudge, can_follow, follow_targets, crosspost_card, thread_header, thread_composer_notice/ThreadNotice::{Locked, Closed, Join}, thread_starter -> Option<StarterModel::{Message(Box<Message>), Deleted, Loading}>, thread_welcome, thread_browser, thread_menu, thread_members -> Vec<MemberRow> are all in selectors. No new fixtures; Task 38's stub test was updated, not deleted.
Invariants (3): fluxer-core gains no dependency, and holds no file bytes, URLs or secrets. There is no unwrap/index on server data. retry_delay handles non-finite retry_after. The starter fetch (FetchMessages { around, limit: 1 }) cannot disturb the parent's loaded window: Messages::on_around drops pages nobody is waiting for.
Review Focus (4): none of the 7 items belongs to Task 40.
CI (5): cargo xtask ci in a clean review worktree: all steps passed.

Findings

  1. minor (parity): the "Archived private threads" tab is shown only with MANAGE_THREADS. This follows the spec and the plan's test name, but the original shows it in every GUILD_TEXT parent: ThreadBrowser.tsx:369-371, with kind = moderator ? 'private' : 'joined' at :255. So ArchivedKind::MinePrivate (users/@me/threads/archived/private) is never used, and a non-moderator cannot browse the archived private threads they are in. Suggest a question/follow-up issue for Charles (spec §18.2.5 vs the original).
  2. minor: the signatures return Option where the plan wrote a bare model. thread_header, thread_welcome and thread_browser return Option<…> (reasonable: the thread may be unknown or the browser closed). ThreadHeaderModel also has an extra joined field and ThreadBrowserModel an extra parent. selectors re-exports the menu item as ThreadMenuItem, so it does not clash with chat::MenuItem. Tasks 44/48 should use these names.
  3. minor: ThreadMenuAction::Notifications(None) advertises "Default", but ThreadNotifyLevel (Task 38) has no Default variant. The UI therefore cannot send flags 0 to go back to the parent's setting, which getThreadNotificationFlag does in the original.
  4. minor: successful thread actions are matched to their request by kind (ApiResult carries no effect id). With two Request::Other actions in flight, a success can remove the other request's id, and a later failure of that request then shows no error toast. In announcements, crosspost_requests is never cleared on success, so it grows by one id per publish. Cosmetic only.
  5. minor (noted by the implementer, acceptable): the menu has no "Delete my messages" or "Debug thread", and toasts are text in state until core has a toast mechanism.

Verdict: APPROVED. No blocking findings and CI is green. Items 1 and 3 deserve follow-up issues.

## Independent review: Text chat 40 (head 97237f1, diff 29bca22..97237f1) **Tests (1):** all 21 tests named in the plan exist (`tests/chat_announcements.rs`, `tests/chat_thread_admin.rs`) and assert what the plan asks for: the canCrosspostMessage table (type, state, snapshots, copy, SEND_MESSAGES, author/MANAGE_MESSAGES), confirm vs `confirmed`, Published after `CROSSPOSTED` or the answer, MESSAGE_ALREADY_CROSSPOSTED toast, nudge + "Don't show again" saved as `hide_crosspost_nudge`, notify flags 2/4/8 exactly one, the purge toast strings (checked against `DirectMessageList.tsx:82-89`). **Interfaces (2):** `announcement_actions`, `can_crosspost`, `Confirm::Crosspost`, `crosspost_nudge`, `can_follow`, `follow_targets`, `crosspost_card`, `thread_header`, `thread_composer_notice`/`ThreadNotice::{Locked, Closed, Join}`, `thread_starter -> Option<StarterModel::{Message(Box<Message>), Deleted, Loading}>`, `thread_welcome`, `thread_browser`, `thread_menu`, `thread_members -> Vec<MemberRow>` are all in `selectors`. No new fixtures; Task 38's stub test was updated, not deleted. **Invariants (3):** fluxer-core gains no dependency, and holds no file bytes, URLs or secrets. There is no unwrap/index on server data. `retry_delay` handles non-finite `retry_after`. The starter fetch (`FetchMessages { around, limit: 1 }`) cannot disturb the parent's loaded window: `Messages::on_around` drops pages nobody is waiting for. **Review Focus (4):** none of the 7 items belongs to Task 40. **CI (5):** `cargo xtask ci` in a clean review worktree: **all steps passed**. ### Findings 1. **minor (parity):** the "Archived private threads" tab is shown only with MANAGE_THREADS. This follows the spec and the plan's test name, but the original shows it in every GUILD_TEXT parent: `ThreadBrowser.tsx:369-371`, with `kind = moderator ? 'private' : 'joined'` at `:255`. So `ArchivedKind::MinePrivate` (`users/@me/threads/archived/private`) is never used, and a non-moderator cannot browse the archived private threads they are in. Suggest a `question`/`follow-up` issue for Charles (spec §18.2.5 vs the original). 2. **minor:** the signatures return `Option` where the plan wrote a bare model. `thread_header`, `thread_welcome` and `thread_browser` return `Option<…>` (reasonable: the thread may be unknown or the browser closed). `ThreadHeaderModel` also has an extra `joined` field and `ThreadBrowserModel` an extra `parent`. `selectors` re-exports the menu item as `ThreadMenuItem`, so it does not clash with `chat::MenuItem`. Tasks 44/48 should use these names. 3. **minor:** `ThreadMenuAction::Notifications(None)` advertises "Default", but `ThreadNotifyLevel` (Task 38) has no Default variant. The UI therefore cannot send flags 0 to go back to the parent's setting, which `getThreadNotificationFlag` does in the original. 4. **minor:** successful thread actions are matched to their request by kind (`ApiResult` carries no effect id). With two `Request::Other` actions in flight, a success can remove the other request's id, and a later failure of that request then shows no error toast. In `announcements`, `crosspost_requests` is never cleared on success, so it grows by one id per publish. Cosmetic only. 5. **minor (noted by the implementer, acceptable):** the menu has no "Delete my messages" or "Debug thread", and toasts are text in state until core has a toast mechanism. **Verdict: APPROVED.** No blocking findings and CI is green. Items 1 and 3 deserve follow-up issues.
charles manually merged commit eaca13ab56 into textchat 2026-11-13 13:51:18 +00:00
Sign in to join this conversation.
No description provided.