Text chat 32: DMs and group DMs (#282) #394

Manually merged
charles merged 0 commits from textchat-32-ui-dms into textchat 2026-11-13 10:58:19 +00:00
Owner

What this builds (Text chat spec §3.7, §9.8)

  • DM list (screens/main/dms/mod.rs, cloned from DirectMessageList.tsx, DMListItem.tsx, DirectMessageList.module.css): "Direct messages" section header with the "Create DM" +, rows 2.625 rem from selectors::dm_row (32 px picture, name, "{n} members" for groups), unread pill, the close X on hover (CloseDm).
  • Group avatar cluster (#207, widgets/group_avatar.rs, GroupDMAvatar.tsx:228-473): 0.70 x the edge for two, 0.68 x for three (cluster at most 32 px), each later avatar cut out of the earlier ones 2 px wide, the group's status dot. A small custom widget draws it (each avatar in its own layer); the cut-outs are painted in the surface colour, as avatar::view_on already does for the presence surround.
  • Header (header.rs): the 32 px DM / group picture, Pins (OpenPins), "Create group DM" in a DM with a friend (opens the picker with them picked), "Add friends to group" while a group has room, and the members toggle for group DMs ("Show members" / "Hide members", now the original's casing).
  • Group DM member list (dms::member_groups, ChannelMembers.tsx:533-570): the user and recipients, Online then Offline, owner crowned.
  • "Select friends" modal (dms/friend_picker.rs, CreateDMModal.tsx, AddFriendsToGroupModal.tsx, FriendSelector.module.css): search, friends by first letter, checkboxes, the cap (others dimmed once max are picked), "Create DM" / "Create group DM" / "Add".
  • Group settings modal (dms/group_settings.rs, EditGroupModal.tsx): "Group icon" with "Upload icon"/"Change icon" (emits OpenFileDialog(FileDialog::GroupIcon); the store holds the pick), "Remove icon", "Group name" capped at 100, "Save" emits EditGroupDm.
  • Welcome sections (dms/welcome.rs, DMWelcomeSection, GroupDMWelcomeSection, PersonalNotesWelcomeSection + CSS): heads the first row of the message list once the history reaches the start ("Say hi to {name}. Your DM starts here.", "Welcome to {name}. Add friends to get the group going." with "Edit group" and "Add friends to group").
  • Icons note-pencil-bold, user-plus-bold added through theme::icons.

Tests

  • crates/fluxer-ui/tests/dms.rs: dm_row_close_emits (headless click on the X, tiny-skia), cluster_geometry, picker_cap_and_buttons, group_settings_emits_edit, welcome_strings, header_buttons_by_kind, all on the devserver textchat READY.
  • Screenshots dm_list, friend_picker, group_dm_welcome, group_settings (goldens rendered on lavapipe in the fluxer-native-shots:u2204 image; copies in docs/screenshots/). No Electron reference was captured; dimensions come from the fork CSS files named above.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally.

Deviations from the plan

  • Files outside the Files list, kept minimal: screens/main/model.rs (the sidebar carries dms: Option<Vec<DmRowModel>> from the store instead of its own DmAvatar; group DM members toggle), screens/main/media.rs (request cluster / picker avatars), screens/main/messages.rs (welcome heads the first row, Message::Dms), app.rs (Local::dms), widgets/mod.rs, tests main_model.rs and media.rs (follow the new DM row model; the DM row avatar URL is the store's 128 px one). calls/dm_header.rs needed no change.
  • The group icon goes through the store's Effect::OpenFileDialog (executed by the runtime, Text chat 21), not a UI-side Dialogs call; a picked icon is shown by file name (the UI never reads files).
  • Left out, tracked in #383: DM welcome friend request buttons and mutual communities (no relationship actions in core), the leave-group confirmation, icon preview/crop, muted rows, Escape on the DM modals.

Stacked on: origin/textchat-19-core-dms-settings (already merged into textchat at the base, 188f780).

Closes #282

🤖 Generated with Claude Code

## What this builds (Text chat spec §3.7, §9.8) - **DM list** (`screens/main/dms/mod.rs`, cloned from `DirectMessageList.tsx`, `DMListItem.tsx`, `DirectMessageList.module.css`): "Direct messages" section header with the "Create DM" +, rows 2.625 rem from `selectors::dm_row` (32 px picture, name, "{n} members" for groups), unread pill, the close X on hover (`CloseDm`). - **Group avatar cluster** (#207, `widgets/group_avatar.rs`, `GroupDMAvatar.tsx:228-473`): 0.70 x the edge for two, 0.68 x for three (cluster at most 32 px), each later avatar cut out of the earlier ones 2 px wide, the group's status dot. A small custom widget draws it (each avatar in its own layer); the cut-outs are painted in the surface colour, as `avatar::view_on` already does for the presence surround. - **Header** (`header.rs`): the 32 px DM / group picture, Pins (`OpenPins`), "Create group DM" in a DM with a friend (opens the picker with them picked), "Add friends to group" while a group has room, and the members toggle for group DMs ("Show members" / "Hide members", now the original's casing). - **Group DM member list** (`dms::member_groups`, `ChannelMembers.tsx:533-570`): the user and recipients, Online then Offline, owner crowned. - **"Select friends" modal** (`dms/friend_picker.rs`, `CreateDMModal.tsx`, `AddFriendsToGroupModal.tsx`, `FriendSelector.module.css`): search, friends by first letter, checkboxes, the cap (others dimmed once `max` are picked), "Create DM" / "Create group DM" / "Add". - **Group settings modal** (`dms/group_settings.rs`, `EditGroupModal.tsx`): "Group icon" with "Upload icon"/"Change icon" (emits `OpenFileDialog(FileDialog::GroupIcon)`; the store holds the pick), "Remove icon", "Group name" capped at 100, "Save" emits `EditGroupDm`. - **Welcome sections** (`dms/welcome.rs`, `DMWelcomeSection`, `GroupDMWelcomeSection`, `PersonalNotesWelcomeSection` + CSS): heads the first row of the message list once the history reaches the start ("Say hi to **{name}**. Your DM starts here.", "Welcome to **{name}**. Add friends to get the group going." with "Edit group" and "Add friends to group"). - Icons `note-pencil-bold`, `user-plus-bold` added through `theme::icons`. ## Tests - `crates/fluxer-ui/tests/dms.rs`: `dm_row_close_emits` (headless click on the X, tiny-skia), `cluster_geometry`, `picker_cap_and_buttons`, `group_settings_emits_edit`, `welcome_strings`, `header_buttons_by_kind`, all on the devserver `textchat` READY. - Screenshots `dm_list`, `friend_picker`, `group_dm_welcome`, `group_settings` (goldens rendered on lavapipe in the `fluxer-native-shots:u2204` image; copies in `docs/screenshots/`). No Electron reference was captured; dimensions come from the fork CSS files named above. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally. ## Deviations from the plan - Files outside the Files list, kept minimal: `screens/main/model.rs` (the sidebar carries `dms: Option<Vec<DmRowModel>>` from the store instead of its own `DmAvatar`; group DM members toggle), `screens/main/media.rs` (request cluster / picker avatars), `screens/main/messages.rs` (welcome heads the first row, `Message::Dms`), `app.rs` (`Local::dms`), `widgets/mod.rs`, tests `main_model.rs` and `media.rs` (follow the new DM row model; the DM row avatar URL is the store's 128 px one). `calls/dm_header.rs` needed no change. - The group icon goes through the store's `Effect::OpenFileDialog` (executed by the runtime, Text chat 21), not a UI-side `Dialogs` call; a picked icon is shown by file name (the UI never reads files). - Left out, tracked in #383: DM welcome friend request buttons and mutual communities (no relationship actions in core), the leave-group confirmation, icon preview/crop, muted rows, Escape on the DM modals. Stacked on: origin/textchat-19-core-dms-settings (already merged into textchat at the base, 188f780). Closes #282 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Tests dm_row_close_emits, cluster_geometry, picker_cap_and_buttons,
group_settings_emits_edit, welcome_strings, header_buttons_by_kind, and
the screenshots dm_list, friend_picker, group_dm_welcome, group_settings,
on the devserver textchat scenario's READY.

Refs #282

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The DM list ("Direct messages" with "Create DM", 2.625 rem rows from
selectors::dm_row with the close X on hover and the unread pill), the
group avatar cluster (#207), the header's DM picture and buttons (Pins,
Create group DM / Add friends to group, the group members toggle), the
group DM member list, the "Select friends" modal, the group settings
modal and the DM / group welcome sections. Goldens rendered on lavapipe
(fluxer-native-shots:u2204).

Refs #282

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The group DM welcome and group settings screenshots now show the rich
composer (buttons, taller box), so the list ends higher up. Redrawn on
lavapipe in the fluxer-native-shots:u2204 image.

Refs #282

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

Independent review of Task 32 (ui-dms) at 049ebf8. I reviewed only this task's own changes, diffed against the merged textchat parent 67da1c7.

Findings

  • (minor) docs/screenshots/group-dm-welcome.png and group-settings.png still hold the pre-regeneration images. Commit 049ebf8 redrew only fixtures/golden/, so the docs copies no longer match the goldens.
  • (minor) The plan's Files list says to modify calls/dm_header.rs and member_list.rs, but neither was touched. The header buttons are in header.rs and the group member list is dms::member_groups through model.rs. The behaviour is present, so this is a deviation from the plan, not a defect.
  • (minor) The relayed request "remove the cap" is still open. The friend-picker cap (max from selectors::friend_picker / remaining_slots) and the "full group hides Add friends" rule are unchanged. If that is the cap Charles meant, it needs its own change in fluxer-core.

Checked, no issues

  • All six tests the plan names exist in crates/fluxer-ui/tests/dms.rs and assert the plan's values: 2.625 rem = 42 px rows, 0.70 / 0.68 ratios, 32 px three-member max, 2 px cut-out, name cut at 100 chars (maxLength={100}, EditGroupModal.tsx:183). The four screenshot tests are present.
  • The welcome strings match the fork's sources (DMWelcomeSection.tsx:294, GroupDMWelcomeSection.tsx:88, CreateDMModal.tsx:25).
  • The interfaces in the Interfaces block exist.
  • No changes to fluxer-core, fluxer-proto, Cargo.toml or Cargo.lock.
  • No new I/O in fluxer-ui: the group icon goes through UserAction::OpenFileDialog(FileDialog::GroupIcon).
  • I found no panic paths on server data: group_avatar::slots handles any count and size is clamped to be finite.
  • No secrets or paths in fixtures.

Local CI: NOT completed. My cargo xtask ci run ended during clippy (exit 144) while another review's build was sharing the machine. I can't confirm it is green from this review.

Verdict: no blocking findings in the code. Not approved, because my local CI run did not finish.

Independent review of Task 32 (ui-dms) at 049ebf8. I reviewed only this task's own changes, diffed against the merged textchat parent 67da1c7. **Findings** - (minor) `docs/screenshots/group-dm-welcome.png` and `group-settings.png` still hold the pre-regeneration images. Commit 049ebf8 redrew only `fixtures/golden/`, so the docs copies no longer match the goldens. - (minor) The plan's Files list says to modify `calls/dm_header.rs` and `member_list.rs`, but neither was touched. The header buttons are in `header.rs` and the group member list is `dms::member_groups` through `model.rs`. The behaviour is present, so this is a deviation from the plan, not a defect. - (minor) The relayed request "remove the cap" is still open. The friend-picker cap (`max` from `selectors::friend_picker` / `remaining_slots`) and the "full group hides Add friends" rule are unchanged. If that is the cap Charles meant, it needs its own change in fluxer-core. **Checked, no issues** - All six tests the plan names exist in `crates/fluxer-ui/tests/dms.rs` and assert the plan's values: 2.625 rem = 42 px rows, 0.70 / 0.68 ratios, 32 px three-member max, 2 px cut-out, name cut at 100 chars (`maxLength={100}`, EditGroupModal.tsx:183). The four screenshot tests are present. - The welcome strings match the fork's sources (DMWelcomeSection.tsx:294, GroupDMWelcomeSection.tsx:88, CreateDMModal.tsx:25). - The interfaces in the Interfaces block exist. - No changes to fluxer-core, fluxer-proto, Cargo.toml or Cargo.lock. - No new I/O in fluxer-ui: the group icon goes through `UserAction::OpenFileDialog(FileDialog::GroupIcon)`. - I found no panic paths on server data: `group_avatar::slots` handles any count and size is clamped to be finite. - No secrets or paths in fixtures. **Local CI:** NOT completed. My `cargo xtask ci` run ended during clippy (exit 144) while another review's build was sharing the machine. I can't confirm it is green from this review. **Verdict:** no blocking findings in the code. Not approved, because my local CI run did not finish.
Author
Owner

Review round 1: what changed for each finding

  1. docs/screenshots out of date (minor). Fixed: docs/screenshots/group-dm-welcome.png and group-settings.png are now copies of the regenerated fixtures/golden/group_dm_welcome.png and group_settings.png.
  2. Plan file list (calls/dm_header.rs, member_list.rs) (minor). No code change. As the finding says, the behaviour is there: the header buttons are in dms/header.rs, and the group member list goes through dms::member_groups. I left those two files alone because the work fitted the existing modules better there. Only the plan's file list is out of date.
  3. "remove the cap" (minor). No code change yet. The request doesn't say which cap it means. The group DM cap (group_cap / remaining_slots, and the "Add friends" button hidden in a full group) is the server's own max_group_dm_recipients limit. If the client drops it, the server still rejects oversized groups. I opened #423 (question) to ask Charles which cap he meant and how far to go, and the fluxer-core change will follow once he answers.

Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: all steps passed.

Review round 1: what changed for each finding 1. **docs/screenshots out of date** (minor). Fixed: docs/screenshots/group-dm-welcome.png and group-settings.png are now copies of the regenerated fixtures/golden/group_dm_welcome.png and group_settings.png. 2. **Plan file list (calls/dm_header.rs, member_list.rs)** (minor). No code change. As the finding says, the behaviour is there: the header buttons are in `dms/header.rs`, and the group member list goes through `dms::member_groups`. I left those two files alone because the work fitted the existing modules better there. Only the plan's file list is out of date. 3. **"remove the cap"** (minor). No code change yet. The request doesn't say which cap it means. The group DM cap (`group_cap` / `remaining_slots`, and the "Add friends" button hidden in a full group) is the server's own `max_group_dm_recipients` limit. If the client drops it, the server still rejects oversized groups. I opened #423 (question) to ask Charles which cap he meant and how far to go, and the fluxer-core change will follow once he answers. Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`: all steps passed.
049ebf8 redrew fixtures/golden/group_dm_welcome.png and group_settings.png
for the Task 25 composer, but left the copies in docs/screenshots behind.
This commit copies the new goldens over them.

Refs #282

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

Independent review of Task 32 (ui-dms), round 2, at 6a707ad. I reviewed only this task's own commits (bbdde34, 0cad139, 1bdd163, 049ebf8, 6a707ad) and read the code cold.

Findings

  • (minor) "remove the cap" is still not done. No code changed: the friend-picker cap (remaining_slots / group_cap, which reads the server's max_group_dm_recipients) and the rule that hides "Add friends to group" in a full group are as before. This review run was started by the same request, "remove the cap", again with no detail, so question #423 (which cap, and whether to drop it completely or only stop hiding "Add friends") still needs Charles's answer. That change belongs in fluxer-core, outside this UI task, so it does not block this PR.
  • (minor, carried over) The plan's Files list names calls/dm_header.rs and member_list.rs, but the work is in dms/mod.rs (header_model, member_groups). The behaviour is all there. Only the plan's list is out of date.

Round 1 fix verified

  • docs/screenshots/group-dm-welcome.png and group-settings.png are now byte-for-byte the same as fixtures/golden/group_dm_welcome.png and group_settings.png (checked with cmp). dm-list.png and friend-picker.png also match their goldens.

Checked, no issues

  • All six tests the plan names are in crates/fluxer-ui/tests/dms.rs: dm_row_close_emits, cluster_geometry, picker_cap_and_buttons, group_settings_emits_edit, welcome_strings and header_buttons_by_kind. They check the spec values: rows of 42 px (2.625 rem), cluster ratios of 0.70 for two and 0.68 for three, a three-member cluster of at most 32 px, a 2 px cut-out, the name cut at 100 characters, and the original's strings. The four screenshot tests are there.
  • Every name in the Interfaces block exists.
  • Crate rules: this task changes nothing in fluxer-core, fluxer-proto, Cargo.toml or Cargo.lock. It adds no I/O to fluxer-ui: the group icon goes through UserAction::OpenFileDialog(FileDialog::GroupIcon), and the picked file reaches the core only as a FileRef. The new dms and group_avatar code has no unwrap, expect or indexing on server data, and slots handles any count. There are no secrets, upload URLs or real paths. The only path is a made-up /tmp/beach.png in a test FileRef.
  • No Review Focus item belongs to Task 32.

Local CI: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree: all steps passed (fmt, clippy, deny, core-isolation, parity, test, vendored-tests and screenshot-tests; livekit-interop was skipped because FLUXER_LIVEKIT_TESTS is not set).

Verdict: approved. There are no blocking findings and CI is green. The cap change follows #423.

Independent review of Task 32 (ui-dms), round 2, at 6a707ad. I reviewed only this task's own commits (bbdde34, 0cad139, 1bdd163, 049ebf8, 6a707ad) and read the code cold. **Findings** - (minor) "remove the cap" is still not done. No code changed: the friend-picker cap (`remaining_slots` / `group_cap`, which reads the server's `max_group_dm_recipients`) and the rule that hides "Add friends to group" in a full group are as before. This review run was started by the same request, "remove the cap", again with no detail, so question #423 (which cap, and whether to drop it completely or only stop hiding "Add friends") still needs Charles's answer. That change belongs in fluxer-core, outside this UI task, so it does not block this PR. - (minor, carried over) The plan's Files list names `calls/dm_header.rs` and `member_list.rs`, but the work is in `dms/mod.rs` (`header_model`, `member_groups`). The behaviour is all there. Only the plan's list is out of date. **Round 1 fix verified** - `docs/screenshots/group-dm-welcome.png` and `group-settings.png` are now byte-for-byte the same as `fixtures/golden/group_dm_welcome.png` and `group_settings.png` (checked with cmp). `dm-list.png` and `friend-picker.png` also match their goldens. **Checked, no issues** - All six tests the plan names are in `crates/fluxer-ui/tests/dms.rs`: `dm_row_close_emits`, `cluster_geometry`, `picker_cap_and_buttons`, `group_settings_emits_edit`, `welcome_strings` and `header_buttons_by_kind`. They check the spec values: rows of 42 px (2.625 rem), cluster ratios of 0.70 for two and 0.68 for three, a three-member cluster of at most 32 px, a 2 px cut-out, the name cut at 100 characters, and the original's strings. The four screenshot tests are there. - Every name in the Interfaces block exists. - Crate rules: this task changes nothing in fluxer-core, fluxer-proto, Cargo.toml or Cargo.lock. It adds no I/O to fluxer-ui: the group icon goes through `UserAction::OpenFileDialog(FileDialog::GroupIcon)`, and the picked file reaches the core only as a `FileRef`. The new dms and group_avatar code has no unwrap, expect or indexing on server data, and `slots` handles any count. There are no secrets, upload URLs or real paths. The only path is a made-up `/tmp/beach.png` in a test `FileRef`. - No Review Focus item belongs to Task 32. **Local CI:** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh review worktree: all steps passed (fmt, clippy, deny, core-isolation, parity, test, vendored-tests and screenshot-tests; livekit-interop was skipped because FLUXER_LIVEKIT_TESTS is not set). **Verdict:** approved. There are no blocking findings and CI is green. The cap change follows #423.
charles manually merged commit 9cf9a6825c into textchat 2026-11-13 10:58:19 +00:00
Sign in to join this conversation.
No description provided.