Text chat 45: Forum view and forum post panel (#330) #465

Manually merged
charles merged 0 commits from textchat-45-ui-forum-view into textchat 2026-11-13 15:32:42 +00:00
Owner

What this builds (spec §18.2.1, §18.2.2)

New module fluxer-ui::screens::main::forum (guidelines, toolbar, sort_popout, tags, post_list, post_card, post_actions, tags_modal). A selected forum or media channel shows it in place of the message view:

  • Header without the member list toggle; content column max 60 rem.
  • Collapsible guidelines (the channel topic, Markdown).
  • Search card: placeholder by permission, clear, "New post", Shift+Enter opens the composer with the title, the searching footer strings.
  • Filter row: "Sort & view" popout (view hidden for media channels), tag pills and "Clear".
  • List (gap 0.5 rem) and gallery cards (minmax(14rem, 1fr) columns computed from width, gap 0.75 rem), unread title colour, tag overflow; skeletons, empty, search-empty, error and indexing states, "Older posts" and "Load older posts".
  • Post context menu: Pin/Unpin post, Edit tags with ForumPostTagsModal.
  • A card click opens the post in the side panel (OpenThread), Shift+click the full view. In the panel the post uses PanelHeader::ForumPost and shows ForumPostActions under the starter (React to post, Follow/Following, Copy post link with toast).
  • The cards on screen are reported with ForumAction::Visible for previews and unread counts.

New Phosphor icons in assets/icons; widgets/popout.rs gains what the sort popout needs.

Tests

crates/fluxer-ui/tests/forum.rs: gallery_columns_from_width, card_elements_and_tag_overflow, card_unread_title_colour, sort_view_popout_emits_and_hides_view_for_media, tag_pills_toggle_and_clear, shift_enter_opens_composer_with_title, empty_error_indexing_strings, load_older_button, click_opens_panel_shift_click_full_view, post_actions_under_starter, visible_ids_reported.

Screenshots (goldens in fixtures/golden/): forum_list, forum_gallery, forum_sort_popout, forum_empty, forum_post_panel.

Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: green (also after merging origin/textchat; one conflict in app.rs resolved by keeping both the settings sync and the forum sync).

Closes #330

🤖 Generated with Claude Code

## What this builds (spec §18.2.1, §18.2.2) New module `fluxer-ui::screens::main::forum` (`guidelines`, `toolbar`, `sort_popout`, `tags`, `post_list`, `post_card`, `post_actions`, `tags_modal`). A selected forum or media channel shows it in place of the message view: - Header without the member list toggle; content column max 60 rem. - Collapsible guidelines (the channel topic, Markdown). - Search card: placeholder by permission, clear, "New post", Shift+Enter opens the composer with the title, the searching footer strings. - Filter row: "Sort & view" popout (view hidden for media channels), tag pills and "Clear". - List (gap 0.5 rem) and gallery cards (`minmax(14rem, 1fr)` columns computed from width, gap 0.75 rem), unread title colour, tag overflow; skeletons, empty, search-empty, error and indexing states, "Older posts" and "Load older posts". - Post context menu: Pin/Unpin post, Edit tags with `ForumPostTagsModal`. - A card click opens the post in the side panel (`OpenThread`), Shift+click the full view. In the panel the post uses `PanelHeader::ForumPost` and shows `ForumPostActions` under the starter (React to post, Follow/Following, Copy post link with toast). - The cards on screen are reported with `ForumAction::Visible` for previews and unread counts. New Phosphor icons in `assets/icons`; `widgets/popout.rs` gains what the sort popout needs. ## Tests `crates/fluxer-ui/tests/forum.rs`: `gallery_columns_from_width`, `card_elements_and_tag_overflow`, `card_unread_title_colour`, `sort_view_popout_emits_and_hides_view_for_media`, `tag_pills_toggle_and_clear`, `shift_enter_opens_composer_with_title`, `empty_error_indexing_strings`, `load_older_button`, `click_opens_panel_shift_click_full_view`, `post_actions_under_starter`, `visible_ids_reported`. Screenshots (goldens in `fixtures/golden/`): `forum_list`, `forum_gallery`, `forum_sort_popout`, `forum_empty`, `forum_post_panel`. Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`: green (also after merging `origin/textchat`; one conflict in `app.rs` resolved by keeping both the settings sync and the forum sync). Closes #330 🤖 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
Author
Owner

Review round 1, what changed per finding:

  • blocking: nothing to review (branch not pushed, work uncommitted, no PR, no ci result). Committed the Task 45 work as bbe6dcb feat(ui): forum view and post panel (Refs #330), merged origin/textchat (78e5dc5; one conflict in crates/fluxer-ui/src/app.rs, resolved by keeping both the settings sync and the forum sync), pushed textchat-45-ui-forum-view and opened this PR. Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green both before and after the merge.

No minor findings were listed.

Review round 1, what changed per finding: - **blocking: nothing to review (branch not pushed, work uncommitted, no PR, no ci result).** Committed the Task 45 work as bbe6dcb `feat(ui): forum view and post panel` (Refs #330), merged `origin/textchat` (78e5dc5; one conflict in `crates/fluxer-ui/src/app.rs`, resolved by keeping both the settings sync and the forum sync), pushed `textchat-45-ui-forum-view` and opened this PR. Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green both before and after the merge. No minor findings were listed.
Author
Owner

Independent review, Task 45 (ui-forum-view), on 78e5dc5 (task commit bbe6dcb plus the merge of origin/textchat).

Tests (plan steps): all 11 named tests are in crates/fluxer-ui/tests/forum.rs and assert what the plan asks, using the spec's values: 14 rem/0.75 rem gallery columns and 0.5 rem list gap, 3 tag pills then "+N", the unread title colour, "Sort by"/"View as" (no "View as" for media), tag toggle and Clear, Shift+Enter to the composer with the trimmed query, the empty/search-empty/error/indexing strings and "Older posts", "Load older posts", click → OpenThread and Shift+click → OpenThreadFull, the post actions under the starter with the "Post link copied" toast, and ForumAction::Visible. All 5 screenshot tests (forum_list, forum_gallery, forum_sort_popout, forum_empty, forum_post_panel) have goldens.

Interfaces: the side panel sets PanelHeader::ForumPost for forum and media posts. post_actions (ForumPostActions) is shown after the starter (id == post id) in both the panel and the full view. The tags modal (ForumPostTagsModal) sends ForumAction::EditPostTags. The Pin/Unpin post menu needs MANAGE_THREADS. ForumAction::Visible is sent from State::sync and on scroll. The header has no pins and no members toggle, and the content column is capped at 60 rem. Everything it uses from Task 39 (forum_view, post_card) builds against the merged code.

Invariants: fluxer-ui gets no new I/O. Images go only through wanted() into the existing ImageLoader path, and copying the link is a core ForumAction. No new dependencies. No new fixtures: the inline test JSON follows the server's search shape (threads, members, has_more, total_results) and post-data shape (threads: {id: {owner, first_message}}). No secrets, URLs or paths. No panics on server data: the strings[0]/[1] index in post_list::empty is only reached for Empty/EmptySearch, which always have two strings. The merge resolution in app.rs keeps both the settings sync and the forum sync.

Findings:

  • minor: forum::State::viewport is not reset when switching to another forum, so the first Visible report for the new forum is estimated from the old forum's scroll offset. It corrects itself on the next scroll event. Data is not affected.
  • minor: in tags_modal::update, Toggle does not refuse a moderated tag for non-moderators (only the view disables the pill). It cannot be reached from the UI today.
  • minor: the plan lists header.rs under Modify, but the header changes are in main/mod.rs (header_tools) and model.rs (has_members). The behaviour matches the spec.
  • minor (process): the PR has no side-by-side screenshots against Electron (CLAUDE.md asks for them on UI PRs).

CI: cargo xtask ci run locally in the review worktree: all steps passed (exit 0). Screenshot tests were skipped because FLUXER_SCREENSHOT_TESTS was not set. The implementer reports them green.

Verdict: approved, no blocking findings.

Independent review, Task 45 (ui-forum-view), on 78e5dc5 (task commit bbe6dcb plus the merge of origin/textchat). **Tests (plan steps):** all 11 named tests are in `crates/fluxer-ui/tests/forum.rs` and assert what the plan asks, using the spec's values: 14 rem/0.75 rem gallery columns and 0.5 rem list gap, 3 tag pills then "+N", the unread title colour, "Sort by"/"View as" (no "View as" for media), tag toggle and Clear, Shift+Enter to the composer with the trimmed query, the empty/search-empty/error/indexing strings and "Older posts", "Load older posts", click → `OpenThread` and Shift+click → `OpenThreadFull`, the post actions under the starter with the "Post link copied" toast, and `ForumAction::Visible`. All 5 screenshot tests (`forum_list`, `forum_gallery`, `forum_sort_popout`, `forum_empty`, `forum_post_panel`) have goldens. **Interfaces:** the side panel sets `PanelHeader::ForumPost` for forum and media posts. `post_actions` (ForumPostActions) is shown after the starter (id == post id) in both the panel and the full view. The tags modal (ForumPostTagsModal) sends `ForumAction::EditPostTags`. The Pin/Unpin post menu needs MANAGE_THREADS. `ForumAction::Visible` is sent from `State::sync` and on scroll. The header has no pins and no members toggle, and the content column is capped at 60 rem. Everything it uses from Task 39 (`forum_view`, `post_card`) builds against the merged code. **Invariants:** fluxer-ui gets no new I/O. Images go only through `wanted()` into the existing ImageLoader path, and copying the link is a core `ForumAction`. No new dependencies. No new fixtures: the inline test JSON follows the server's search shape (`threads, members, has_more, total_results`) and post-data shape (`threads: {id: {owner, first_message}}`). No secrets, URLs or paths. No panics on server data: the `strings[0]/[1]` index in `post_list::empty` is only reached for Empty/EmptySearch, which always have two strings. The merge resolution in `app.rs` keeps both the settings sync and the forum sync. **Findings:** - minor: `forum::State::viewport` is not reset when switching to another forum, so the first `Visible` report for the new forum is estimated from the old forum's scroll offset. It corrects itself on the next scroll event. Data is not affected. - minor: in `tags_modal::update`, `Toggle` does not refuse a moderated tag for non-moderators (only the view disables the pill). It cannot be reached from the UI today. - minor: the plan lists `header.rs` under Modify, but the header changes are in `main/mod.rs` (`header_tools`) and `model.rs` (`has_members`). The behaviour matches the spec. - minor (process): the PR has no side-by-side screenshots against Electron (CLAUDE.md asks for them on UI PRs). **CI:** `cargo xtask ci` run locally in the review worktree: all steps passed (exit 0). Screenshot tests were skipped because FLUXER_SCREENSHOT_TESTS was not set. The implementer reports them green. **Verdict: approved, no blocking findings.**
charles manually merged commit 8a6b78d3ba into textchat 2026-11-13 15:32:42 +00:00
Sign in to join this conversation.
No description provided.