feat(rooms): read-only announcement channels (LC-480) #462

Merged
longjacksonle merged 4 commits from feat/LC-480-announcement-channels into main 2026-06-27 20:59:16 +02:00

What

Surface read-only announcement channels (LC-480). The backend already gated posting via rooms.posting_allowed_for (all / moderators_only / admins_only, reactions unaffected), so this PR is the UX layer that makes restricted rooms read as announcement channels.

Changes

  • Banner: a strip above the timeline (megaphone + "Announcement" label + "Only admins/moderators can post in this channel.") shown to everyone whenever posting is restricted.
  • Read-only notice: the composer-replacement notice for members who cannot post is now localized and adds a "You can still react to messages." hint, with an icon. Previously it was hardcoded English.
  • Manage framing: the posting-policy intro now explains that restricting posting makes an announcement channel (read + react still allowed); the restricted options are tagged "(announcement)".
  • i18n: new banner/notice strings in en + es; removed the hardcoded English posting_locked_reason (RoomPage now carries the raw posting_policy and the template maps it to |t strings).

No new routes, data, or policy values - purely presentation + i18n on top of the existing policy.

Tests

New render test in routes_readonly_rooms.rs: a member of an admins-only room sees the banner + read-only notice with the react hint; the admin sees the banner but keeps the composer. just check, just test, just test-saas all green (ran just check after the final edit).

Verify

just verify builds the release binary clean; boot fails only on the missing mandatory SSO env (environmental, as in prior PRs).

## What Surface read-only **announcement channels** (LC-480). The backend already gated posting via `rooms.posting_allowed_for` (`all` / `moderators_only` / `admins_only`, reactions unaffected), so this PR is the UX layer that makes restricted rooms read as announcement channels. ## Changes - **Banner**: a strip above the timeline (megaphone + "Announcement" label + "Only admins/moderators can post in this channel.") shown to everyone whenever posting is restricted. - **Read-only notice**: the composer-replacement notice for members who cannot post is now localized and adds a "You can still react to messages." hint, with an icon. Previously it was hardcoded English. - **Manage framing**: the posting-policy intro now explains that restricting posting makes an announcement channel (read + react still allowed); the restricted options are tagged "(announcement)". - **i18n**: new banner/notice strings in en + es; removed the hardcoded English `posting_locked_reason` (RoomPage now carries the raw `posting_policy` and the template maps it to `|t` strings). No new routes, data, or policy values - purely presentation + i18n on top of the existing policy. ## Tests New render test in `routes_readonly_rooms.rs`: a member of an admins-only room sees the banner + read-only notice with the react hint; the admin sees the banner but keeps the composer. `just check`, `just test`, `just test-saas` all green (ran `just check` after the final edit). ## Verify `just verify` builds the release binary clean; boot fails only on the missing mandatory SSO env (environmental, as in prior PRs).
Surface restricted-posting rooms as announcement channels. The room page now shows a banner above the timeline whenever posting is restricted, and the read-only composer notice (shown to members who cannot post) is localized and gains a "you can still react" hint. RoomPage now carries the raw posting_policy and the template maps it to |t strings, replacing the hardcoded English posting_locked_reason.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Token-driven (light/dark) styles for the announcement banner (accent-tinted strip with megaphone + uppercase label) and the centered read-only composer notice.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add banner/notice strings (label, admins/mods "only X can post", react hint) in en + es. Reword the Manage posting-policy intro to explain that restricting posting makes an announcement channel (read + react still allowed), and tag the restricted options "(announcement)".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
test(rooms): assert announcement banner + read-only notice render (LC-480)
Some checks failed
check-secrets / Nosey parker (push) Successful in 4s
check-secrets / Kingfisher (push) Failing after 4s
check-secrets / TruffleHog (push) Successful in 5s
check-secrets / Nosey parker (pull_request) Successful in 7s
check-secrets / Kingfisher (pull_request) Failing after 8s
Check / clippy + fmt + tests (pull_request) Successful in 5m28s
check-secrets / TruffleHog (pull_request) Successful in 10s
Create release / Create release from merged PR (pull_request) Has been skipped
ef3e7398c9
A member of an admins-only room sees the banner + read-only notice with the react hint; the admin sees the banner but keeps the composer (no notice).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle scheduled this pull request to auto merge when all checks succeed 2026-06-27 20:55:32 +02:00
longjacksonle deleted branch feat/LC-480-announcement-channels 2026-06-27 20:59:16 +02:00
Sign in to join this conversation.
No reviewers
No labels
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
psa-systems/lets-chat!462
No description provided.