Text chat 47: Media channels (#332) #474
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "textchat-47-ui-media-channel"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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: falsein the posts of a media channel withHIDE_MEDIA_DOWNLOAD_OPTIONS, and in the channel itself; unknown channels hide nothing).attachments::modelapplies the channel's policy on top ofctx.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 tomessage_row.rs.media_viewer::channel_policy(&App);main::viewpasses it tomedia_viewer::model(Download media, Open in browser, Copy link hidden), andupdateignores those three messages when hidden.post_card::{play_icon, media_placeholder, GALLERY_PLAY, LIST_PLAY}:Play20 over gallery video cards, 16 over list thumbnails; theChatCircleplaceholder 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.rsimportsscreens::main::mediaasmain_media(the newforum::mediamodule 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).media_channelandmedia_post_no_downloads(goldens drawn on lavapipe in the Ubuntu 22.04fluxer-native-shotsimage, README rows added).FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen locally.FLUXER_DESKTOP_TESTStests in this task.Deviations
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.#for the media channel (theImagesSquareicon is Text chat 43's).Closes #332
🤖 Generated with 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>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>Independent review of Text chat 47 (Media channels), diff 78e5dc5..070baf4.
Plan tests:
media_view_always_gallery,download_buttons_hidden_with_flag,lightbox_respects_policyandvideo_card_play_overlayexist incrates/fluxer-ui/tests/media_channel.rsand assert what the spec says: Grid layout, no "View as", a chosen layout that does not stick,HIDE_MEDIA_DOWNLOAD_OPTIONS1<<15 only on media channels, a non-media file keeping its button (HIDEABLE_MEDIA_TYPES), and Play at 20/16. The goldensmedia_channelandmedia_post_no_downloadsare wired and documented.Interfaces:
MediaPolicy { downloads: false }reaches the attachments (mosaic and expired media) and the lightbox, throughmedia::policyandmedia_viewer::channel_policy.media_viewer::model(app, policy)andattachments::modelkeep their signatures.forum::mediamatchesisMediaDownloadHiddenandhidesMediaDownloadsin 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 cipassed 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:
lightbox_respects_policychecks Download and OpenInBrowser but neverCopyLink, althoughupdate()guards all three.media_channelgolden shows only the "Sunset" picture card, so noPlayoverlay is visible.docs/screenshots/README.mddescribes "Playover videos". Either reword the README row or show a video card.media::policyalso returnsdownloads: falsefor the media channel itself, which has no messages, so this has no effect.Verdict: approve (0 blocking, 3 minor).