Text chat 19: core-dms-settings (#269) #350

Manually merged
charles merged 0 commits from textchat-19-core-dms-settings into textchat 2026-11-13 00:30:23 +00:00
Owner

What this builds

fluxer-core DMs, relationships and chat settings (spec §6.2 "DMs" and "Settings", §3.8, §9.8 core side).

  • DMs: CreateDm (one recipient opens or selects the DM; several make a group DM, capped at the instance's max_group_dm_recipients - 1), AddRecipients up to the free places, RemoveRecipient (owner only), CloseDm removes the channel locally on success, EditGroupDm (name at most 100 chars; icon static images only, sent as a data URI).
  • Relationships: from READY, RELATIONSHIP_* events and GET /users/@me/relationships (app.chat.dms.relationships); CHANNEL_RECIPIENT_ADD|REMOVE update recipients.
  • Selectors: dm_row (with the #207 avatar cluster of 2 or 3 avatars), dm_name, dm_welcome, friend_picker (friends only, query filter, selected, max).
  • Settings: ChatSettings (every Advanced chat control of §3.8 with the original's defaults) in LocalSettings::chat. Synced display settings (render_embeds, inline_attachment_media, inline_embed_media, render_reactions, render_spoilers, sanitize_urls) are read from user_settings/prefs and written with PATCH /users/@me/settings. Changes show at once and revert on failure. sanitize_urls goes through the synced preferences, and only field 82 is rewritten. Older settings files still load.

Testing

  • crates/fluxer-core/tests/chat_dms.rs has 7 tests and crates/fluxer-core/tests/chat_settings.rs has 3, as named in the plan. I wrote them first and confirmed they failed before writing the code.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci passes locally after merging the current origin/textchat (9fcc13d).
  • No desktop or display tests are involved.

Deviations / files outside the Files list

  • effect.rs: new ApiRequest::EditGroupDmIcon { channel_id, name, icon: FileRef }. The store holds no file bytes, so the runtime (Text chat 21) reads the file and builds the data: URI. Task 21 needs to execute this request.
  • event.rs: new UserAction::{OpenFriendPicker(Option<Snowflake>), ToggleFriendPick(Snowflake), CloseFriendPicker} for the friend picker modal state.
  • app.rs / chat/mod.rs / chat/state.rs: Chat::display: SyncedDisplay (the shown synced display values), the settings reducer split, and DM follow-ups (selecting a newly opened DM) after the reduce pass.
  • persist.rs takes &ChatSettings so SetChatSetting saves the local settings.
  • tests/chat_ports.rs: stubs_emit_nothing now skips CreateDm, which is no longer a stub.

Review follow-up (head 1630a19)

  • Blocking finding fixed: ChatSettings now has hide_muted_channels_by_default (default false, UserSettings.defaultHideMutedChannels; stored only, channel muting comes later) and upload_attachments_before_sending: Option<bool> (PrivacyPreferences.preuploadMessageAttachments). When it is unset, ChatSettings::uploads_before_sending(user_id) turns it on for accounts created at or after 2026-06-04T16:10:00Z, as the original does (PREUPLOAD_MESSAGE_ATTACHMENTS_DEFAULT_ON_AFTER). There are matching ChatSettingChange::{HideMutedChannelsByDefault, UploadAttachmentsBeforeSending} variants. local_chat_settings_defaults_and_persist covers both, and the new test upload_before_sending_defaults_by_account_age checks the age rule.
  • Opened follow-up #370 for the two writers of synced_preferences (Text chat 14 and 19).
  • Merged the current origin/textchat (b87bcd9). Conflicts in app.rs, channels.rs, selectors/mod.rs, README.md and tests/chat_ports.rs were resolved by keeping both sides. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci passes locally.
  • Not changed: the minor findings (the dm_row signature, a hidden second pending change, DmOpened matching and test gaps) are as noted in the review.

Closes #269

🤖 Generated with Claude Code

## What this builds `fluxer-core` DMs, relationships and chat settings (spec §6.2 "DMs" and "Settings", §3.8, §9.8 core side). - **DMs:** `CreateDm` (one recipient opens or selects the DM; several make a group DM, capped at the instance's `max_group_dm_recipients - 1`), `AddRecipients` up to the free places, `RemoveRecipient` (owner only), `CloseDm` removes the channel locally on success, `EditGroupDm` (name at most 100 chars; icon static images only, sent as a data URI). - **Relationships:** from READY, `RELATIONSHIP_*` events and `GET /users/@me/relationships` (`app.chat.dms.relationships`); `CHANNEL_RECIPIENT_ADD|REMOVE` update `recipients`. - **Selectors:** `dm_row` (with the #207 avatar cluster of 2 or 3 avatars), `dm_name`, `dm_welcome`, `friend_picker` (friends only, query filter, `selected`, `max`). - **Settings:** `ChatSettings` (every Advanced chat control of §3.8 with the original's defaults) in `LocalSettings::chat`. Synced display settings (`render_embeds`, `inline_attachment_media`, `inline_embed_media`, `render_reactions`, `render_spoilers`, `sanitize_urls`) are read from `user_settings`/prefs and written with `PATCH /users/@me/settings`. Changes show at once and revert on failure. `sanitize_urls` goes through the synced preferences, and only field 82 is rewritten. Older settings files still load. ## Testing - `crates/fluxer-core/tests/chat_dms.rs` has 7 tests and `crates/fluxer-core/tests/chat_settings.rs` has 3, as named in the plan. I wrote them first and confirmed they failed before writing the code. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` passes locally after merging the current `origin/textchat` (9fcc13d). - No desktop or display tests are involved. ## Deviations / files outside the Files list - `effect.rs`: new `ApiRequest::EditGroupDmIcon { channel_id, name, icon: FileRef }`. The store holds no file bytes, so the runtime (Text chat 21) reads the file and builds the `data:` URI. Task 21 needs to execute this request. - `event.rs`: new `UserAction::{OpenFriendPicker(Option<Snowflake>), ToggleFriendPick(Snowflake), CloseFriendPicker}` for the friend picker modal state. - `app.rs` / `chat/mod.rs` / `chat/state.rs`: `Chat::display: SyncedDisplay` (the shown synced display values), the settings reducer split, and DM follow-ups (selecting a newly opened DM) after the reduce pass. - `persist.rs` takes `&ChatSettings` so `SetChatSetting` saves the local settings. - `tests/chat_ports.rs`: `stubs_emit_nothing` now skips `CreateDm`, which is no longer a stub. ## Review follow-up (head 1630a19) - **Blocking finding fixed:** `ChatSettings` now has `hide_muted_channels_by_default` (default false, `UserSettings.defaultHideMutedChannels`; stored only, channel muting comes later) and `upload_attachments_before_sending: Option<bool>` (`PrivacyPreferences.preuploadMessageAttachments`). When it is unset, `ChatSettings::uploads_before_sending(user_id)` turns it on for accounts created at or after 2026-06-04T16:10:00Z, as the original does (`PREUPLOAD_MESSAGE_ATTACHMENTS_DEFAULT_ON_AFTER`). There are matching `ChatSettingChange::{HideMutedChannelsByDefault, UploadAttachmentsBeforeSending}` variants. `local_chat_settings_defaults_and_persist` covers both, and the new test `upload_before_sending_defaults_by_account_age` checks the age rule. - Opened follow-up #370 for the two writers of `synced_preferences` (Text chat 14 and 19). - Merged the current `origin/textchat` (b87bcd9). Conflicts in `app.rs`, `channels.rs`, `selectors/mod.rs`, `README.md` and `tests/chat_ports.rs` were resolved by keeping both sides. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` passes locally. - Not changed: the minor findings (the `dm_row` signature, a hidden second pending change, `DmOpened` matching and test gaps) are as noted in the review. Closes #269 🤖 Generated with [Claude Code](https://claude.com/claude-code)
# Conflicts:
#	crates/fluxer-proto/README.md
#	crates/fluxer-proto/src/gateway/events.rs
#	crates/fluxer-proto/src/models/channel.rs
#	crates/fluxer-proto/src/models/mod.rs
#	crates/fluxer-proto/src/models/settings.rs
#	crates/fluxer-proto/tests/models_roundtrip.rs
# Conflicts:
#	crates/fluxer-proto/tests/models_roundtrip.rs
Refs #269

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
CreateDm (one recipient opens or selects the DM, several make a group DM up
to the instance's max_group_dm_recipients - 1), AddRecipients up to the free
places, RemoveRecipient (owner), CloseDm removing the channel on success,
EditGroupDm (name <= 100 chars, static icons only, sent as a data URI by the
runtime through ApiRequest::EditGroupDmIcon), the friend picker actions,
CHANNEL_RECIPIENT_ADD|REMOVE, relationships from READY, RELATIONSHIP_* and
GET /users/@me/relationships; selectors dm_row (#207 avatar cluster),
dm_name, dm_welcome and friend_picker.

SetChatSetting keeps local changes in LocalSettings::chat and writes synced
display settings with PATCH /users/@me/settings (sanitize_urls through the
synced preferences, only field 82 rewritten), shown at once and reverted on
failure.

Refs #269

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Author
Owner

Independent review: Text chat 19 (core-dms-settings)

Scope: git diff 9fcc13d..origin/textchat-19-core-dms-settings (head 1b43f7a). Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree: all steps passed.

Checks

  1. Plan tests: all 10 named tests are present (chat_dms.rs: create_dm_one_vs_group, recipient_cap, recipient_events_update_channel, close_dm_removes_on_success, group_icon_data_uri_static_only, dm_row_cluster_two_and_three, friend_picker_filters_friends_only; chat_settings.rs: synced_display_settings_read_and_patch, local_chat_settings_defaults_and_persist, old_settings_files_load). They assert the spec's values: cap 50 so 49 others, group name ≤ 100, PATCH name/icon, static icon only (GIF/APNG refused, 10 MiB avatar limit), a cluster of 2 or 3 avatars (#207), friends only in the picker, one field per PATCH, and a revert when a write fails.
  2. Interfaces: app.chat.dms.relationships, selectors::{friend_picker, dm_row, dm_welcome}, FriendPickerModel { friends, selected, max }, DmAvatar::{User, GroupIcon, Cluster(Vec<Avatar>)}, DisplaySettings, PatchUserSettings writes and the ChatSettingChange synced variants all exist. The gap in ChatSettings is listed below.
  3. Invariants: fluxer-core gains no dependency and no I/O. EditGroupDmIcon carries a FileRef with no bytes, and the path is hidden in Debug. No new fixtures: the tests reuse the existing server-shaped ones. Server data cannot panic the client here: the cap is clamped, unknown channels and recipients are ignored, and an undecodable prefs snapshot is never written over.
  4. Review Focus 3: a sanitize_urls change decodes the account's snapshot, flips only field 82 and re-encodes it through fluxer_proto::prefs, which keeps the other fields. A change back writes the original snapshot byte for byte, and this is tested.

Findings

[blocking] ChatSettings misses two Advanced chat controls that the interface promises. Task 19's Interfaces block says "ChatSettings (local: every Advanced chat control of spec §3.8 with the original's defaults)". Spec §3.8 and the original AdvancedChatControls.tsx (HIDE_MUTED_CHANNELS_BY_DEFAULT_DESCRIPTOR, UPLOAD_ATTACHMENTS_BEFORE_SENDING_DESCRIPTOR) both include "Hide muted channels by default" and "Upload attachments before sending". Neither is in ChatSettings, in ChatSettingChange or in local_chat_settings_defaults_and_persist. Task 33 (fluxer-ui settings) cannot add core fields, and parity entries chat-settings-hide-muted-channels and chat-settings-preupload-attachments (spec §11) cannot move to done. Fix: add both fields with the original's defaults and their ChatSettingChange variants, and cover them in the defaults/persist test. Hide-muted can stay stored-only, as §11 notes.

[minor] Two writers of synced_preferences (cross-task, for whoever merges second with Text chat 14). SyncedDisplay::write rebuilds the whole snapshot from display.synced_preferences. The branch textchat-14-core-expressions keeps its own prefs.base and also PATCHes whole snapshots. If one write is in flight while the other is sent, the second can overwrite the first: picker frecency or favourites written by 14 could be replaced by an older copy, or a sanitize_urls toggle undone. The window is small (one round trip) but it touches Review Focus 3. Suggest one owner of the snapshot, for example routing the field 82 change through the expressions prefs writer or sharing its base. Please open a follow-up issue.

[minor] dm_row signature. The plan says dm_row(&App, channel) -> DmRowModel. The code returns Option<DmRowModel> and adds channel_id, status and mention_count. That is reasonable, and since Task 32 builds against merged code it is fine. Noted for the integrator.

[minor] Second pending display change hidden while in flight. take_account clears every pending change when any UserSettingsPatched arrives. With two quick toggles, the first answer briefly hides the second until its own answer arrives. This is cosmetic: no data is lost.

[minor] DmOpened is not matched to its request. creating.take() selects whichever DmOpened comes first. A profile's "Message" answer that lands while a Create DM is in flight would select the wrong channel. This is a narrow race.

[minor] Test gaps. dm_row_cluster_two_and_three comments that "Unread follows the read state" but asserts nothing about unread. The sanitize test compares only emoji_picker, favorite_gifs and skin_tone, not every field. Byte-for-byte equality is covered by the round-trip assertion and by Text chat 3's codec tests.

Verdict: changes requested. There is 1 blocking finding: the two missing Advanced chat controls in ChatSettings/ChatSettingChange. CI is green locally.

## Independent review: Text chat 19 (core-dms-settings) Scope: `git diff 9fcc13d..origin/textchat-19-core-dms-settings` (head 1b43f7a). Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh review worktree: **all steps passed**. ### Checks 1. **Plan tests**: all 10 named tests are present (`chat_dms.rs`: create_dm_one_vs_group, recipient_cap, recipient_events_update_channel, close_dm_removes_on_success, group_icon_data_uri_static_only, dm_row_cluster_two_and_three, friend_picker_filters_friends_only; `chat_settings.rs`: synced_display_settings_read_and_patch, local_chat_settings_defaults_and_persist, old_settings_files_load). They assert the spec's values: cap 50 so 49 others, group name ≤ 100, PATCH name/icon, static icon only (GIF/APNG refused, 10 MiB avatar limit), a cluster of 2 or 3 avatars (#207), friends only in the picker, one field per PATCH, and a revert when a write fails. 2. **Interfaces**: `app.chat.dms.relationships`, `selectors::{friend_picker, dm_row, dm_welcome}`, `FriendPickerModel { friends, selected, max }`, `DmAvatar::{User, GroupIcon, Cluster(Vec<Avatar>)}`, `DisplaySettings`, `PatchUserSettings` writes and the `ChatSettingChange` synced variants all exist. The gap in `ChatSettings` is listed below. 3. **Invariants**: fluxer-core gains no dependency and no I/O. `EditGroupDmIcon` carries a `FileRef` with no bytes, and the path is hidden in `Debug`. No new fixtures: the tests reuse the existing server-shaped ones. Server data cannot panic the client here: the cap is clamped, unknown channels and recipients are ignored, and an undecodable prefs snapshot is never written over. 4. **Review Focus 3**: a `sanitize_urls` change decodes the account's snapshot, flips only field 82 and re-encodes it through `fluxer_proto::prefs`, which keeps the other fields. A change back writes the original snapshot byte for byte, and this is tested. ### Findings **[blocking] `ChatSettings` misses two Advanced chat controls that the interface promises.** Task 19's Interfaces block says "`ChatSettings` (local: every Advanced chat control of spec §3.8 with the original's defaults)". Spec §3.8 and the original `AdvancedChatControls.tsx` (`HIDE_MUTED_CHANNELS_BY_DEFAULT_DESCRIPTOR`, `UPLOAD_ATTACHMENTS_BEFORE_SENDING_DESCRIPTOR`) both include **"Hide muted channels by default"** and **"Upload attachments before sending"**. Neither is in `ChatSettings`, in `ChatSettingChange` or in `local_chat_settings_defaults_and_persist`. Task 33 (fluxer-ui settings) cannot add core fields, and parity entries `chat-settings-hide-muted-channels` and `chat-settings-preupload-attachments` (spec §11) cannot move to done. Fix: add both fields with the original's defaults and their `ChatSettingChange` variants, and cover them in the defaults/persist test. Hide-muted can stay stored-only, as §11 notes. **[minor] Two writers of `synced_preferences` (cross-task, for whoever merges second with Text chat 14).** `SyncedDisplay::write` rebuilds the whole snapshot from `display.synced_preferences`. The branch `textchat-14-core-expressions` keeps its own `prefs.base` and also PATCHes whole snapshots. If one write is in flight while the other is sent, the second can overwrite the first: picker frecency or favourites written by 14 could be replaced by an older copy, or a `sanitize_urls` toggle undone. The window is small (one round trip) but it touches Review Focus 3. Suggest one owner of the snapshot, for example routing the field 82 change through the expressions prefs writer or sharing its base. Please open a `follow-up` issue. **[minor] `dm_row` signature.** The plan says `dm_row(&App, channel) -> DmRowModel`. The code returns `Option<DmRowModel>` and adds `channel_id`, `status` and `mention_count`. That is reasonable, and since Task 32 builds against merged code it is fine. Noted for the integrator. **[minor] Second pending display change hidden while in flight.** `take_account` clears every pending change when any `UserSettingsPatched` arrives. With two quick toggles, the first answer briefly hides the second until its own answer arrives. This is cosmetic: no data is lost. **[minor] `DmOpened` is not matched to its request.** `creating.take()` selects whichever `DmOpened` comes first. A profile's "Message" answer that lands while a Create DM is in flight would select the wrong channel. This is a narrow race. **[minor] Test gaps.** `dm_row_cluster_two_and_three` comments that "Unread follows the read state" but asserts nothing about unread. The sanitize test compares only emoji_picker, favorite_gifs and skin_tone, not every field. Byte-for-byte equality is covered by the round-trip assertion and by Text chat 3's codec tests. **Verdict: changes requested.** There is 1 blocking finding: the two missing Advanced chat controls in `ChatSettings`/`ChatSettingChange`. CI is green locally.
# Conflicts:
#	crates/fluxer-core/README.md
#	crates/fluxer-core/src/app.rs
#	crates/fluxer-core/src/chat/mod.rs
#	crates/fluxer-core/tests/chat_ports.rs
Refs #269

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds the two Advanced chat controls of spec §3.8 that ChatSettings missed, with the
original's defaults: UserSettings.defaultHideMutedChannels (false, stored only) and
PrivacyPreferences.preuploadMessageAttachments (unset follows the account's age,
cutoff 2026-06-04T16:10:00Z).

Refs #269

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	crates/fluxer-core/README.md
#	crates/fluxer-core/src/app.rs
#	crates/fluxer-core/src/channels.rs
#	crates/fluxer-core/src/selectors/mod.rs
#	crates/fluxer-core/tests/chat_ports.rs
Author
Owner

Independent review (second pass): Text chat 19 (core-dms-settings)

Scope: git diff b87bcd9..origin/textchat-19-core-dms-settings (head 1630a19).

Checks

  1. Plan tests: all 10 named tests are present and assert the spec's values (cap 50, so 49 others; free places when adding; name ≤ 100 and trimmed; static icons only and the 10 MiB limit; a cluster of 2 or 3 avatars; friends only; one field per PATCH; revert on failure; old files load). The new upload_before_sending_defaults_by_account_age checks the cutoff 1_780_589_400_000 ms, which is 2026-06-04T16:10:00Z, as in PrivacyPreferences.ts:11.
  2. Interfaces: relationships, friend_picker, dm_row, dm_welcome, DmAvatar::{User, GroupIcon, Cluster}, ChatSettings and the ChatSettingChange variants for the synced and local settings, including the two added this round (HideMutedChannelsByDefault, UploadAttachmentsBeforeSending), all exist. The earlier blocking finding is fixed.
  3. Invariants: no new dependency, no I/O and no file bytes in fluxer-core (EditGroupDmIcon carries a FileRef), and no new fixtures. Server data cannot panic the client: the cap is clamped and indexing is guarded.
  4. Review Focus 3: sanitize_urls rewrites only field 82, and a change back writes the original snapshot byte for byte (tested). The race between the two writers is tracked in #370.
  5. Chat_ports stubs filter: skipping CreateDm is correct. It is the only DM action that can act on the stub fixture (it opens a DM with a known user). The other DM actions do nothing for an unknown group.

Findings

  • [minor] ApiRequest::EditGroupDmIcon is not executed by Text chat 21. On textchat-21-app-textchat-runtime (PR #368), the chat request match ends in _ => Err(not_a_chat_request()) (501 CLIENT_NOT_WIRED). Once both branches merge, a new group icon fails with an error. Neither #271 nor #368 mentions it. Please add a note on #368, or open a follow-up issue, before merge.
  • [minor, pre-existing, not this branch's files] LocalSettings::chat is never written to settings.toml. fluxer-platform::settings::SettingsFile has no chat table, so every local chat setting, every draft and the recent searches are lost on restart. old_settings_files_load passes because the core test only checks the SaveSettings effect. Opened #371 (bug).
  • [minor] As in the first review: dm_row returns Option and has extra fields, and Text chat 32 builds against the merged code; there is a pending-change display flicker; DmOpened is not matched to its request.

CI

I started local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree, but it was still compiling when this review had to report, so I have no local result for head 1630a19. The implementer reports it green. The integrator should check the remote runners.

Verdict: no blocking findings. The code is approvable once CI is confirmed green.

## Independent review (second pass): Text chat 19 (core-dms-settings) Scope: `git diff b87bcd9..origin/textchat-19-core-dms-settings` (head 1630a19). ### Checks 1. **Plan tests**: all 10 named tests are present and assert the spec's values (cap 50, so 49 others; free places when adding; name ≤ 100 and trimmed; static icons only and the 10 MiB limit; a cluster of 2 or 3 avatars; friends only; one field per PATCH; revert on failure; old files load). The new `upload_before_sending_defaults_by_account_age` checks the cutoff 1_780_589_400_000 ms, which is 2026-06-04T16:10:00Z, as in `PrivacyPreferences.ts:11`. 2. **Interfaces**: `relationships`, `friend_picker`, `dm_row`, `dm_welcome`, `DmAvatar::{User, GroupIcon, Cluster}`, `ChatSettings` and the `ChatSettingChange` variants for the synced and local settings, including the two added this round (`HideMutedChannelsByDefault`, `UploadAttachmentsBeforeSending`), all exist. **The earlier blocking finding is fixed.** 3. **Invariants**: no new dependency, no I/O and no file bytes in fluxer-core (`EditGroupDmIcon` carries a `FileRef`), and no new fixtures. Server data cannot panic the client: the cap is clamped and indexing is guarded. 4. **Review Focus 3**: `sanitize_urls` rewrites only field 82, and a change back writes the original snapshot byte for byte (tested). The race between the two writers is tracked in #370. 5. **Chat_ports stubs filter**: skipping `CreateDm` is correct. It is the only DM action that can act on the stub fixture (it opens a DM with a known user). The other DM actions do nothing for an unknown group. ### Findings - **[minor] `ApiRequest::EditGroupDmIcon` is not executed by Text chat 21.** On `textchat-21-app-textchat-runtime` (PR #368), the chat request match ends in `_ => Err(not_a_chat_request())` (501 `CLIENT_NOT_WIRED`). Once both branches merge, a new group icon fails with an error. Neither #271 nor #368 mentions it. Please add a note on #368, or open a follow-up issue, before merge. - **[minor, pre-existing, not this branch's files] `LocalSettings::chat` is never written to `settings.toml`.** `fluxer-platform::settings::SettingsFile` has no `chat` table, so every local chat setting, every draft and the recent searches are lost on restart. `old_settings_files_load` passes because the core test only checks the `SaveSettings` effect. Opened #371 (bug). - **[minor] As in the first review**: `dm_row` returns `Option` and has extra fields, and Text chat 32 builds against the merged code; there is a pending-change display flicker; `DmOpened` is not matched to its request. ### CI I started local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh review worktree, but it was still compiling when this review had to report, so I have **no local result** for head 1630a19. The implementer reports it green. The integrator should check the remote runners. **Verdict: no blocking findings. The code is approvable once CI is confirmed green.**
Author
Owner

Review round 1, minor findings (no blocking findings). No code change on this branch: each finding is outside its files or already tracked. Head stays 1630a19; FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally on it.

  • ApiRequest::EditGroupDmIcon not run by the Text chat 21 runtime (crates/fluxer-core/src/effect.rs): checked and confirmed. The chat request match in apps/fluxer/src/runtime.rs on textchat-21-app-textchat-runtime ends in _ => return Err(not_a_chat_request()). The fix belongs in apps/fluxer, which is the runtime task's crate, not this one. I opened follow-up #372 and left a note on #368.
  • settings.toml has no chat table (crates/fluxer-platform/src/settings.rs): this gap was already there before this branch, and it is outside this branch's files. It is tracked in bug #371, so this PR does not change it.
  • dm_row returns Option<DmRowModel> with extra fields (crates/fluxer-core/src/selectors/sidebar.rs): carried over from the first review. No change: the merged code is the source of truth, and Text chat 32 builds against it.
  • Two writers of synced_preferences, a second pending display change hidden until its answer arrives, DmOpened not matched to its request (crates/fluxer-core/src/chat/settings.rs): carried over from the first review. All three are tracked in follow-up #370, so this PR does not change them.

🤖 Generated with Claude Code

Review round 1, minor findings (no blocking findings). No code change on this branch: each finding is outside its files or already tracked. Head stays 1630a19; `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally on it. - **`ApiRequest::EditGroupDmIcon` not run by the Text chat 21 runtime (crates/fluxer-core/src/effect.rs):** checked and confirmed. The chat request match in `apps/fluxer/src/runtime.rs` on `textchat-21-app-textchat-runtime` ends in `_ => return Err(not_a_chat_request())`. The fix belongs in `apps/fluxer`, which is the runtime task's crate, not this one. I opened follow-up #372 and left a note on #368. - **settings.toml has no chat table (crates/fluxer-platform/src/settings.rs):** this gap was already there before this branch, and it is outside this branch's files. It is tracked in bug #371, so this PR does not change it. - **`dm_row` returns `Option<DmRowModel>` with extra fields (crates/fluxer-core/src/selectors/sidebar.rs):** carried over from the first review. No change: the merged code is the source of truth, and Text chat 32 builds against it. - **Two writers of `synced_preferences`, a second pending display change hidden until its answer arrives, `DmOpened` not matched to its request (crates/fluxer-core/src/chat/settings.rs):** carried over from the first review. All three are tracked in follow-up #370, so this PR does not change them. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

Independent review (third pass): Text chat 19 (core-dms-settings)

Scope: git diff b87bcd9..origin/textchat-19-core-dms-settings (head 1630a19). Local cargo xtask ci in a fresh review worktree (tc-review-19): all steps passed (EXIT 0).

Checks

  1. Plan tests: all 10 named tests exist (chat_dms.rs: create_dm_one_vs_group, recipient_cap, recipient_events_update_channel, close_dm_removes_on_success, group_icon_data_uri_static_only, dm_row_cluster_two_and_three, friend_picker_filters_friends_only; chat_settings.rs: synced_display_settings_read_and_patch, local_chat_settings_defaults_and_persist, old_settings_files_load). They assert the spec values: cap 50 so 49 others, free places when adding, name trimmed and at most 100 characters, static icons only (GIF and APNG refused) and 10 MiB, a 2 or 3 avatar cluster, friends only, one field per PATCH, revert on failure. Defaults checked against the fork (UserSettings.ts:309-329, PrivacyPreferences.ts:11; 1_780_589_400_000 ms = 2026-06-04T16:10Z; SVG is in RASTER_FULL; group status priority online, idle, dnd as GroupDMAvatar.tsx:36).
  2. Interfaces: app.chat.dms.relationships, selectors::{friend_picker, dm_row, dm_welcome}, FriendPickerModel { friends, selected, max }, DmAvatar::{User, GroupIcon, Cluster(Vec<Avatar>)}, DmRowModel { name, avatar, subtext, unread, muted, .. }, ChatSettings in LocalSettings::chat, and ChatSettingChange variants for every synced and local setting are all present. dm_row returns Option<DmRowModel> (the plan says DmRowModel); the merged code is the source of truth for Text chat 32.
  3. Invariants: no Cargo.toml change, so no new dependency; no iced, wgpu, reqwest or tungstenite in fluxer-core; no file bytes (EditGroupDmIcon carries a FileRef); no new fixtures; the one log line carries no data. Server data cannot panic: the limit is filtered for NaN and negative values and clamped, others[0] is guarded by the match arm, and there are no unwraps on server data.
  4. Review Focus 3: sanitize_urls decodes the last server snapshot, changes only that field and re-encodes it. Setting it back writes the original snapshot byte for byte (tested). A snapshot that does not decode is never written over.

Findings

  • [minor, tracked in #372] Text chat 21's runtime does not handle ApiRequest::EditGroupDmIcon: it falls through to not_a_chat_request. Changing a group icon fails with an error, and nothing panics, until #372 lands. It is a new request variant that the plan does not name, so #368 needs to pick it up before both merge.
  • [minor, tracked in #371, outside this branch's files] settings.toml (fluxer-platform) has no [chat] table, so local chat settings are lost on restart. The core tests check only the SaveSettings effect.
  • [minor, tracked in #370] The synced preferences snapshot has two writers (Text chat 14 and 19). A sanitize_urls write made while a frecency or picker patch is still unanswered starts from the older snapshot.
  • [minor] UserSettingsPatched clears every pending change, including writes that are still on their way. A toggle can flick back until its own answer arrives. It is cosmetic and converges.

Verdict: no blocking findings; local CI green. Approvable.

## Independent review (third pass): Text chat 19 (core-dms-settings) Scope: `git diff b87bcd9..origin/textchat-19-core-dms-settings` (head 1630a19). Local `cargo xtask ci` in a fresh review worktree (`tc-review-19`): **all steps passed** (EXIT 0). ### Checks 1. **Plan tests**: all 10 named tests exist (`chat_dms.rs`: `create_dm_one_vs_group`, `recipient_cap`, `recipient_events_update_channel`, `close_dm_removes_on_success`, `group_icon_data_uri_static_only`, `dm_row_cluster_two_and_three`, `friend_picker_filters_friends_only`; `chat_settings.rs`: `synced_display_settings_read_and_patch`, `local_chat_settings_defaults_and_persist`, `old_settings_files_load`). They assert the spec values: cap 50 so 49 others, free places when adding, name trimmed and at most 100 characters, static icons only (GIF and APNG refused) and 10 MiB, a 2 or 3 avatar cluster, friends only, one field per PATCH, revert on failure. Defaults checked against the fork (`UserSettings.ts:309-329`, `PrivacyPreferences.ts:11`; 1_780_589_400_000 ms = 2026-06-04T16:10Z; SVG is in `RASTER_FULL`; group status priority online, idle, dnd as `GroupDMAvatar.tsx:36`). 2. **Interfaces**: `app.chat.dms.relationships`, `selectors::{friend_picker, dm_row, dm_welcome}`, `FriendPickerModel { friends, selected, max }`, `DmAvatar::{User, GroupIcon, Cluster(Vec<Avatar>)}`, `DmRowModel { name, avatar, subtext, unread, muted, .. }`, `ChatSettings` in `LocalSettings::chat`, and `ChatSettingChange` variants for every synced and local setting are all present. `dm_row` returns `Option<DmRowModel>` (the plan says `DmRowModel`); the merged code is the source of truth for Text chat 32. 3. **Invariants**: no Cargo.toml change, so no new dependency; no iced, wgpu, reqwest or tungstenite in fluxer-core; no file bytes (`EditGroupDmIcon` carries a `FileRef`); no new fixtures; the one log line carries no data. Server data cannot panic: the limit is filtered for NaN and negative values and clamped, `others[0]` is guarded by the match arm, and there are no unwraps on server data. 4. **Review Focus 3**: `sanitize_urls` decodes the last server snapshot, changes only that field and re-encodes it. Setting it back writes the original snapshot byte for byte (tested). A snapshot that does not decode is never written over. ### Findings - **[minor, tracked in #372]** Text chat 21's runtime does not handle `ApiRequest::EditGroupDmIcon`: it falls through to `not_a_chat_request`. Changing a group icon fails with an error, and nothing panics, until #372 lands. It is a new request variant that the plan does not name, so #368 needs to pick it up before both merge. - **[minor, tracked in #371, outside this branch's files]** `settings.toml` (fluxer-platform) has no `[chat]` table, so local chat settings are lost on restart. The core tests check only the `SaveSettings` effect. - **[minor, tracked in #370]** The synced preferences snapshot has two writers (Text chat 14 and 19). A `sanitize_urls` write made while a frecency or picker patch is still unanswered starts from the older snapshot. - **[minor]** `UserSettingsPatched` clears every pending change, including writes that are still on their way. A toggle can flick back until its own answer arrives. It is cosmetic and converges. **Verdict: no blocking findings; local CI green. Approvable.**
charles manually merged commit 188f780de1 into textchat 2026-11-13 00:30:23 +00:00
Sign in to join this conversation.
No description provided.