Text chat 48: Announcement channels: Publish, nudge, Follow, crosspost copies (#333) #462

Manually merged
charles merged 0 commits from textchat-48-ui-announcements into textchat 2026-11-13 15:32:47 +00:00
Owner

Stacked on: textchat-40-core-announcements-thread-admin

What this builds (spec §18.2.4)

New module fluxer-ui::screens::main::announcements:

  • publish: publish::actions(&App, channel, message, shift) puts the store's announcement_actions item into message_actions where the original has it. In the hover bar it goes after Forward and before Create thread (MessageActionBar.tsx:640-652), and it reads "Published" (disabled) once the message has CROSSPOSTED. In the context menu it goes last in the interaction group (MessageContextMenu.tsx:584-591) and only while the message is unpublished. hover_bar::model and menu::model use it. The publish confirm now uses the original's strings (MessageCrosspostConfirmModal.tsx): "Publish this message?", "Every community that follows this channel gets a copy. …", "Publish". Shift skips it.
  • nudge: CrosspostPublishNudge shows under the user's newest unpublished message (crosspost_nudge). It has "Not sent to followers yet.", "Publish" (Shift skips the confirm), the dismiss X (XCircle fill) and "Don't show again". The message list draws it in line with the content.
  • follow: the header shows "Follow" after the channel name on announcement channels when can_follow (ChannelHeader.tsx:873-878, header::Tools::follow). It opens the "Follow this channel" modal: a banner (community and channel chip), the title and its line, the "Community" / "Channel" pickers ("Select a community" / "Select a channel", targets from follow_targets, with category names), the hint, the empty state, Cancel and "Follow". Submitting sends UserAction::FollowChannel and closes the modal.
  • crosspost_card: crossposted copies (IS_CROSSPOST) get the "Community" author badge (UserMessage.tsx:527-531, ChannelUserTag) and no reply line. When the source is gone (SOURCE_MESSAGE_DELETED) the text reads "[Original message deleted]". Clicking the avatar or name opens CrosspostCommunityCard beside the author (right-start), like the original's CrosspostCommunityPopout. The card has the name (or the author name without its "#channel"), description, "N online" / "N members", "Go to community" (selects the guild) or "Join community" (discoverable), a loading state, and the "no longer available" (403/404) and "Couldn't load …" states.
  • CHANNEL_FOLLOW_ADD (12) already had its system-message string (Text chat 24), so nothing was added here.

Testing

  • crates/fluxer-ui/tests/announcements.rs: publish_item_only_when_allowed, published_disabled_after_flag, publish_confirm_strings_and_shift, nudge_dismiss_and_dont_show_again, follow_button_needs_manage_webhooks, follow_modal_targets, crosspost_copy_badge_and_card_states. They run against the textchat READY and fixtures/rest/crosspost_source.json, driven through App::apply.
  • Screenshot goldens (lavapipe, this machine): announcement_publish, announcement_nudge, follow_modal, crosspost_copy. Rows were added to docs/screenshots/README.md.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci passes locally.

Deviations from the plan

  • Files outside the list:

    • screens/main/mod.rs: pub mod announcements, Message::Announcements, the modal and card overlays, header_tools.
    • screens/main/messages.rs: State::announcements, Message::Announcements, the nudge under the row.
    • fluxer-ui/README.md.
    • docs/screenshots/README.md.

    theme/icons.rs is unchanged: Publish, the nudge and the chip use the existing Megaphone, which the sidebar already uses for announcement channels. The original's custom AnnouncementChannelIcon is not bundled.

  • The community card is a popout opened from the copy's author, as in the original, not a card under the message. Icons are drawn as acronyms and the banner as the plain tint: there is no image request for non-member guilds.

  • "Join community" opens {webapp}/channels/{guild} behind the external-link warning (spec §18.2.3: no invite or discovery-join flow in this client).

  • Not built: the follow modal's age-restriction and content-warning filters (no mature/CW model in this client, §15), the success modal after following, and the publish/follow toasts. The core sets announcements.toast, but the UI has no toast surface yet.

  • Pickers are ordered by the core's follow_targets (sidebar order), not by name as in the original.

  • No Electron side-by-side screenshots: the original could not be run from here.

Closes #333

🤖 Generated with Claude Code

Stacked on: textchat-40-core-announcements-thread-admin ## What this builds (spec §18.2.4) New module `fluxer-ui::screens::main::announcements`: - `publish`: `publish::actions(&App, channel, message, shift)` puts the store's `announcement_actions` item into `message_actions` where the original has it. In the hover bar it goes after Forward and before Create thread (`MessageActionBar.tsx:640-652`), and it reads "Published" (disabled) once the message has `CROSSPOSTED`. In the context menu it goes last in the interaction group (`MessageContextMenu.tsx:584-591`) and only while the message is unpublished. `hover_bar::model` and `menu::model` use it. The publish confirm now uses the original's strings (`MessageCrosspostConfirmModal.tsx`): "Publish this message?", "Every community that follows this channel gets a copy. …", "Publish". Shift skips it. - `nudge`: `CrosspostPublishNudge` shows under the user's newest unpublished message (`crosspost_nudge`). It has "Not sent to followers yet.", "Publish" (Shift skips the confirm), the dismiss X (`XCircle` fill) and "Don't show again". The message list draws it in line with the content. - `follow`: the header shows "Follow" after the channel name on announcement channels when `can_follow` (`ChannelHeader.tsx:873-878`, `header::Tools::follow`). It opens the "Follow this channel" modal: a banner (community and channel chip), the title and its line, the "Community" / "Channel" pickers ("Select a community" / "Select a channel", targets from `follow_targets`, with category names), the hint, the empty state, Cancel and "Follow". Submitting sends `UserAction::FollowChannel` and closes the modal. - `crosspost_card`: crossposted copies (`IS_CROSSPOST`) get the "Community" author badge (`UserMessage.tsx:527-531`, `ChannelUserTag`) and no reply line. When the source is gone (`SOURCE_MESSAGE_DELETED`) the text reads "[Original message deleted]". Clicking the avatar or name opens `CrosspostCommunityCard` beside the author (right-start), like the original's `CrosspostCommunityPopout`. The card has the name (or the author name without its "#channel"), description, "N online" / "N members", "Go to community" (selects the guild) or "Join community" (discoverable), a loading state, and the "no longer available" (403/404) and "Couldn't load …" states. - `CHANNEL_FOLLOW_ADD` (12) already had its system-message string (Text chat 24), so nothing was added here. ## Testing - `crates/fluxer-ui/tests/announcements.rs`: `publish_item_only_when_allowed`, `published_disabled_after_flag`, `publish_confirm_strings_and_shift`, `nudge_dismiss_and_dont_show_again`, `follow_button_needs_manage_webhooks`, `follow_modal_targets`, `crosspost_copy_badge_and_card_states`. They run against the textchat READY and `fixtures/rest/crosspost_source.json`, driven through `App::apply`. - Screenshot goldens (lavapipe, this machine): `announcement_publish`, `announcement_nudge`, `follow_modal`, `crosspost_copy`. Rows were added to `docs/screenshots/README.md`. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` passes locally. ## Deviations from the plan - Files outside the list: - `screens/main/mod.rs`: `pub mod announcements`, `Message::Announcements`, the modal and card overlays, `header_tools`. - `screens/main/messages.rs`: `State::announcements`, `Message::Announcements`, the nudge under the row. - `fluxer-ui/README.md`. - `docs/screenshots/README.md`. `theme/icons.rs` is unchanged: Publish, the nudge and the chip use the existing `Megaphone`, which the sidebar already uses for announcement channels. The original's custom `AnnouncementChannelIcon` is not bundled. - The community card is a popout opened from the copy's author, as in the original, not a card under the message. Icons are drawn as acronyms and the banner as the plain tint: there is no image request for non-member guilds. - "Join community" opens `{webapp}/channels/{guild}` behind the external-link warning (spec §18.2.3: no invite or discovery-join flow in this client). - Not built: the follow modal's age-restriction and content-warning filters (no mature/CW model in this client, §15), the success modal after following, and the publish/follow toasts. The core sets `announcements.toast`, but the UI has no toast surface yet. - Pickers are ordered by the core's `follow_targets` (sidebar order), not by name as in the original. - No Electron side-by-side screenshots: the original could not be run from here. Closes #333 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
# Conflicts:
#	crates/fluxer-core/src/chat/mod.rs
#	crates/fluxer-core/src/chat/state.rs
#	crates/fluxer-core/src/chat/threads.rs
#	crates/fluxer-core/src/event.rs
Refs #333

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Publish/Published in the hover bar and menu at the original's
position, the publish confirm strings (Shift skips), the publish
nudge, the header Follow button and the Follow this channel modal,
and crossposted copies (Community badge, no reply line, source-deleted
text, community card). Goldens for the four screenshots.

Refs #333

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #333

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

Independent review: Text chat 48 (ui-announcements)

Reviewed git diff eacea24c..origin/textchat-48-ui-announcements at ad78308, read cold.

Plan tests (1): all 7 exist in crates/fluxer-ui/tests/announcements.rs and assert what the plan asks. The strings are the spec's and the original's, checked against the fork: "Publish this message?", the confirm body, "Not sent to followers yet.", "Don't show again", "Follow this channel", "Select a community" / "Select a channel", "[Original message deleted]", "This community is no longer available", "Couldn't load this community. Try again in a moment.". Shift skips the confirm in the bar, the menu and the nudge. All 4 screenshots exist with goldens and README rows. The goldens look right: Publish after Forward, the nudge pill, Follow in the header, the COMMUNITY badge and the card.

Interfaces (2): the Produces items of §18.2.4 are present. publish::actions wraps message_actions + announcement_actions, and hover_bar::model / menu::model keep their signatures. The CHANNEL_FOLLOW_ADD string was already in message_content/system.rs. The diff does not touch fluxer-core, so no core interface changes.

Invariants (3): fluxer-ui has no new I/O path. "Join community" is a UserAction::OpenExternal of {webapp}/channels/{guild}, which goes through the store and the link warning. No new fixtures, secrets, URLs or paths. Server data cannot panic: community_name uses rsplit_once, grouped works on ASCII digits, and every lookup returns Option.

Review Focus (4): none of the items is this task's.

CI (5): FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree: all steps passed. That covers the 7 tests and the 4 goldens on lavapipe.

Findings

  • minor: nudge::HEIGHT is defined but never added to the list's height estimate (messages.rs ~L888, which adds welcome::HEIGHT the same way). The row with the nudge is about 36 px taller than estimated, so the scroll may jump a little until the row is measured.
  • minor: in message_row::author_line, the badge's left padding is TAG_GAP - NAME_GAP = 5.6 - 6.0 = -0.4 px. A negative Padding works in iced today, but TAG_GAP.max(NAME_GAP) - NAME_GAP (or dropping the wrapper) would be clearer.
  • minor: follow::FOLLOW_CHANNEL ("Follow channel", the aria label) is declared and tested but never used by header_button. It could be its tooltip.
  • note: the gaps listed in the PR (age/content filters, follow success modal, toasts) agree with the spec's §15 exclusions and the lack of a toast UI. The follow-up issue should be linked before merge if Charles wants them.

Verdict: APPROVE. No blocking findings, and local CI is green.

## Independent review: Text chat 48 (ui-announcements) Reviewed `git diff eacea24c..origin/textchat-48-ui-announcements` at ad78308, read cold. **Plan tests (1):** all 7 exist in `crates/fluxer-ui/tests/announcements.rs` and assert what the plan asks. The strings are the spec's and the original's, checked against the fork: "Publish this message?", the confirm body, "Not sent to followers yet.", "Don't show again", "Follow this channel", "Select a community" / "Select a channel", "[Original message deleted]", "This community is no longer available", "Couldn't load this community. Try again in a moment.". Shift skips the confirm in the bar, the menu and the nudge. All 4 screenshots exist with goldens and README rows. The goldens look right: Publish after Forward, the nudge pill, Follow in the header, the COMMUNITY badge and the card. **Interfaces (2):** the Produces items of §18.2.4 are present. `publish::actions` wraps `message_actions` + `announcement_actions`, and `hover_bar::model` / `menu::model` keep their signatures. The `CHANNEL_FOLLOW_ADD` string was already in `message_content/system.rs`. The diff does not touch fluxer-core, so no core interface changes. **Invariants (3):** fluxer-ui has no new I/O path. "Join community" is a `UserAction::OpenExternal` of `{webapp}/channels/{guild}`, which goes through the store and the link warning. No new fixtures, secrets, URLs or paths. Server data cannot panic: `community_name` uses `rsplit_once`, `grouped` works on ASCII digits, and every lookup returns `Option`. **Review Focus (4):** none of the items is this task's. **CI (5):** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh review worktree: all steps passed. That covers the 7 tests and the 4 goldens on lavapipe. ### Findings - **minor**: `nudge::HEIGHT` is defined but never added to the list's height estimate (`messages.rs` ~L888, which adds `welcome::HEIGHT` the same way). The row with the nudge is about 36 px taller than estimated, so the scroll may jump a little until the row is measured. - **minor**: in `message_row::author_line`, the badge's left padding is `TAG_GAP - NAME_GAP` = 5.6 - 6.0 = -0.4 px. A negative `Padding` works in iced today, but `TAG_GAP.max(NAME_GAP) - NAME_GAP` (or dropping the wrapper) would be clearer. - **minor**: `follow::FOLLOW_CHANNEL` ("Follow channel", the aria label) is declared and tested but never used by `header_button`. It could be its tooltip. - **note**: the gaps listed in the PR (age/content filters, follow success modal, toasts) agree with the spec's §15 exclusions and the lack of a toast UI. The follow-up issue should be linked before merge if Charles wants them. **Verdict: APPROVE.** No blocking findings, and local CI is green.
charles manually merged commit 8a6b78d3ba into textchat 2026-11-13 15:32:47 +00:00
Sign in to join this conversation.
No description provided.