Text chat 47: Media channels (#332) #474

Manually merged
charles merged 0 commits from textchat-47-ui-media-channel into textchat 2026-11-13 17:17:48 +00:00
Owner

Text chat 47: media channels (spec §18.2.2).

Stacked on: textchat-45-ui-forum-view

What

  • screens/main/forum/media.rs (new): is_media, hides_downloads (hidesMediaDownloads), is_media_channel, policy(&App, channel) -> MediaPolicy (isMediaDownloadHidden: downloads: false in the posts of a media channel with HIDE_MEDIA_DOWNLOAD_OPTIONS, and in the channel itself; unknown channels hide nothing).
  • attachments::model applies the channel's policy on top of ctx.policy: pictures and videos lose their download button, other files keep theirs (HIDEABLE_MEDIA_TYPES = image/gif/gifv/video). So every caller (message rows in the channel, the thread panel, the full view) gets it without changes to message_row.rs.
  • Lightbox: media_viewer::channel_policy(&App); main::view passes it to media_viewer::model (Download media, Open in browser, Copy link hidden), and update ignores those three messages when hidden.
  • post_card::{play_icon, media_placeholder, GALLERY_PLAY, LIST_PLAY}: Play 20 over gallery video cards, 16 over list thumbnails; the ChatCircle placeholder when a starter has no media. The gallery-only layout and the missing "View as" were already done by Text chat 39/45; the tests pin them for media channels.
  • forum/mod.rs imports screens::main::media as main_media (the new forum::media module shares the name).

Tests

  • crates/fluxer-ui/tests/media_channel.rs: media_view_always_gallery, download_buttons_hidden_with_flag, lightbox_respects_policy, video_card_play_overlay (failed first, then pass).
  • Screenshots media_channel and media_post_no_downloads (goldens drawn on lavapipe in the Ubuntu 22.04 fluxer-native-shots image, README rows added).
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally.
  • No FLUXER_DESKTOP_TESTS tests in this task.

Deviations

  • Embeds have no download/open/copy buttons in the native client yet, so there is nothing to hide there; the policy function is ready for them.
  • The explicit MediaPolicy { downloads: false } of Text chat 22 still hides every attachment's button (its test expects that); the channel-derived policy hides only pictures and videos, like the original.
  • The sidebar and header still draw # for the media channel (the ImagesSquare icon is Text chat 43's).

Closes #332

🤖 Generated with Claude Code

Text chat 47: media channels (spec §18.2.2). Stacked on: textchat-45-ui-forum-view ## What - `screens/main/forum/media.rs` (new): `is_media`, `hides_downloads` (`hidesMediaDownloads`), `is_media_channel`, `policy(&App, channel) -> MediaPolicy` (`isMediaDownloadHidden`: `downloads: false` in the posts of a media channel with `HIDE_MEDIA_DOWNLOAD_OPTIONS`, and in the channel itself; unknown channels hide nothing). - `attachments::model` applies the channel's policy on top of `ctx.policy`: pictures and videos lose their download button, other files keep theirs (`HIDEABLE_MEDIA_TYPES` = image/gif/gifv/video). So every caller (message rows in the channel, the thread panel, the full view) gets it without changes to `message_row.rs`. - Lightbox: `media_viewer::channel_policy(&App)`; `main::view` passes it to `media_viewer::model` (Download media, Open in browser, Copy link hidden), and `update` ignores those three messages when hidden. - `post_card::{play_icon, media_placeholder, GALLERY_PLAY, LIST_PLAY}`: `Play` 20 over gallery video cards, 16 over list thumbnails; the `ChatCircle` placeholder when a starter has no media. The gallery-only layout and the missing "View as" were already done by Text chat 39/45; the tests pin them for media channels. - `forum/mod.rs` imports `screens::main::media` as `main_media` (the new `forum::media` module shares the name). ## Tests - `crates/fluxer-ui/tests/media_channel.rs`: `media_view_always_gallery`, `download_buttons_hidden_with_flag`, `lightbox_respects_policy`, `video_card_play_overlay` (failed first, then pass). - Screenshots `media_channel` and `media_post_no_downloads` (goldens drawn on lavapipe in the Ubuntu 22.04 `fluxer-native-shots` image, README rows added). - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally. - No `FLUXER_DESKTOP_TESTS` tests in this task. ## Deviations - Embeds have no download/open/copy buttons in the native client yet, so there is nothing to hide there; the policy function is ready for them. - The explicit `MediaPolicy { downloads: false }` of Text chat 22 still hides every attachment's button (its test expects that); the channel-derived policy hides only pictures and videos, like the original. - The sidebar and header still draw `#` for the media channel (the `ImagesSquare` icon is Text chat 43's). Closes #332 🤖 Generated with [Claude Code](https://claude.com/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>
Forum and media channels show the forum view (spec §18.2.1) in place of the
message view: collapsible guidelines, the search card with "New post" and
Shift+Enter, the filter row with the "Sort & view" popout and tag pills,
list and gallery cards (columns from width), skeletons, empty/search-empty/
error/indexing states, "Older posts" and "Load older posts", the post
context menu (Pin/Unpin post, Edit tags and ForumPostTagsModal). A card
click opens the post in the side panel, Shift+click the full view; the
panel uses PanelHeader::ForumPost and shows ForumPostActions under the
starter. Visible post ids are reported with ForumAction::Visible.

Tests in tests/forum.rs; screenshots forum_list, forum_gallery,
forum_sort_popout, forum_empty, forum_post_panel.

Refs #330

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	crates/fluxer-ui/src/app.rs
Media channels (spec §18.2.2): forum::media (is_media, hides_downloads,
policy), HIDE_MEDIA_DOWNLOAD_OPTIONS applied to the pictures and videos of
the posts' attachments and to the lightbox's Download, Open in browser and
Copy link; post_card::{play_icon, media_placeholder}; tests and the
media_channel and media_post_no_downloads goldens (lavapipe).

Refs #332

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

Independent review of Text chat 47 (Media channels), diff 78e5dc5..070baf4.

Plan tests: media_view_always_gallery, download_buttons_hidden_with_flag, lightbox_respects_policy and video_card_play_overlay exist in crates/fluxer-ui/tests/media_channel.rs and assert what the spec says: Grid layout, no "View as", a chosen layout that does not stick, HIDE_MEDIA_DOWNLOAD_OPTIONS 1<<15 only on media channels, a non-media file keeping its button (HIDEABLE_MEDIA_TYPES), and Play at 20/16. The goldens media_channel and media_post_no_downloads are wired and documented.
Interfaces: MediaPolicy { downloads: false } reaches the attachments (mosaic and expired media) and the lightbox, through media::policy and media_viewer::channel_policy. media_viewer::model(app, policy) and attachments::model keep their signatures. forum::media matches isMediaDownloadHidden and hidesMediaDownloads in the fork. Embeds have no download, open or copy buttons in the native client, so there is nothing to hide there.
Invariants: fluxer-ui gains no I/O, fluxer-core is untouched, there are no new fixtures or dependencies, and no URLs or paths are logged. An unknown channel falls back to the default policy, so it cannot panic.
CI: local cargo xtask ci passed with exit 0, including all 4 media_channel tests. I did not run the screenshot step (FLUXER_SCREENSHOT_TESTS) for this review: check both goldens on the Linux runner. I looked at both images and they look right: the lightbox toolbar has no Download, Open in browser or Copy link.

Findings:

  • minor: lightbox_respects_policy checks Download and OpenInBrowser but never CopyLink, although update() guards all three.
  • minor: the media_channel golden shows only the "Sunset" picture card, so no Play overlay is visible. docs/screenshots/README.md describes "Play over videos". Either reword the README row or show a video card.
  • minor (matches the original's behaviour): media::policy also returns downloads: false for the media channel itself, which has no messages, so this has no effect.

Verdict: approve (0 blocking, 3 minor).

Independent review of Text chat 47 (Media channels), diff 78e5dc5..070baf4. **Plan tests:** `media_view_always_gallery`, `download_buttons_hidden_with_flag`, `lightbox_respects_policy` and `video_card_play_overlay` exist in `crates/fluxer-ui/tests/media_channel.rs` and assert what the spec says: Grid layout, no "View as", a chosen layout that does not stick, `HIDE_MEDIA_DOWNLOAD_OPTIONS` 1<<15 only on media channels, a non-media file keeping its button (`HIDEABLE_MEDIA_TYPES`), and Play at 20/16. The goldens `media_channel` and `media_post_no_downloads` are wired and documented. **Interfaces:** `MediaPolicy { downloads: false }` reaches the attachments (mosaic and expired media) and the lightbox, through `media::policy` and `media_viewer::channel_policy`. `media_viewer::model(app, policy)` and `attachments::model` keep their signatures. `forum::media` matches `isMediaDownloadHidden` and `hidesMediaDownloads` in the fork. Embeds have no download, open or copy buttons in the native client, so there is nothing to hide there. **Invariants:** fluxer-ui gains no I/O, fluxer-core is untouched, there are no new fixtures or dependencies, and no URLs or paths are logged. An unknown channel falls back to the default policy, so it cannot panic. **CI:** local `cargo xtask ci` passed with exit 0, including all 4 media_channel tests. I did not run the screenshot step (`FLUXER_SCREENSHOT_TESTS`) for this review: check both goldens on the Linux runner. I looked at both images and they look right: the lightbox toolbar has no Download, Open in browser or Copy link. Findings: - minor: `lightbox_respects_policy` checks Download and OpenInBrowser but never `CopyLink`, although `update()` guards all three. - minor: the `media_channel` golden shows only the "Sunset" picture card, so no `Play` overlay is visible. `docs/screenshots/README.md` describes "`Play` over videos". Either reword the README row or show a video card. - minor (matches the original's behaviour): `media::policy` also returns `downloads: false` for the media channel itself, which has no messages, so this has no effect. Verdict: approve (0 blocking, 3 minor).
charles manually merged commit c1390123e5 into textchat 2026-11-13 17:17:48 +00:00
Sign in to join this conversation.
No description provided.