Daily use 18: core user, member and DM menus (#504) #580

Closed
charles wants to merge 0 commits from dailyuse-18-core-user-dm-menus into dailyuse
Owner

Stacked on: dailyuse-15-core-friends-blocking, dailyuse-16b-core-create-invites-guilds

What

  • menus::user(&App, UserMenuContext): the spec §3.2 (e) "B" rows, in the original's order. In a guild GuildMemberContextMenu.tsx (View profile, Mention, Message / Open DM, Start voice call, Add note, Change friend nickname | Invite to community ▸, relationship rows | Report message, Block / Unblock | Roles ▸ read-only | Copy user ID). Elsewhere UserContextMenu.tsx's default menu (plus "Remove from group" for a group DM owner), and in a 1:1 DM its DM menus (renderDmOtherMenu / renderDmSelfMenu: Mark as read, Close DM in the first group, no Mention/Message). System users: View profile + Copy user ID.
  • menus::dm(&App, channel_id): DMMenuData.tsx for DMs and group DMs (Mark as read, View profile / Voice call / Add note / Change friend nickname, Pin DM / Pin group DM, Invite to community + relationship rows + Block, Close DM / Leave group, Copy user ID / Copy channel ID, last the mute row "Mute @{name}" / "Mute {groupName}" from menus::mute::item).
  • chat::dms: PinDm (pinned from READY.pinned_dms and DmPinned; toasts "Pinned DM" / "Unpinned group DM" …; "Something went wrong" / "Failed to pin DM" in pin_error, closed by CloseConfirm); CloseDm asks with Confirm::CloseDm unless confirmed (no Shift bypass), toasts "DM closed" after the confirm; an unconfirmed MessageUser for a blocked user opens Confirm::OpenBlockedDm and is held from the profiles (hold_blocked_dm, one line in app.rs). dms::confirm_text / dms::confirm_accept give the strings and accepting actions for Task 33.
  • UserAction::MentionUser: @tag user pill appended to the selected channel's composer.
  • chat::can_report_message (MessageActionUtils.tsx:114-128) and MessageAction::ReportMessage, last of the danger group.
  • InviteAction::ToCommunity { channel_id, user_id } (new variant) in invites.rs: POST invite (server defaults), open the DM if needed, send the link, toast "Invite sent for {guild}"; one at a time per user and channel; DM/send failures show the existing SendFailed modal, invite failures end quietly (as the original).

Tests

crates/fluxer-core/tests/menus_user_dm.rs: user_menu_items (table: self, friend, incoming, outgoing, blocked, stranger, bot, system × guild / DM / group owner / nowhere), user_menu_labels_and_actions (incl. from a message), start_voice_call_hidden_during_a_call_with_them, dm_menu_items, group_dm_menu_items, pin_dm_round_trip, mention_inserts_span, report_only_for_eligible_messages, invite_to_community_lists_other_guilds, close_dm_confirms_without_shift_bypass, message_blocked_user_confirms_without_shift_bypass. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally. No FLUXER_DESKTOP_TESTS tests apply.

Deviations / for the reviewer

  • Mention appends at the end (with a space if needed), not at the cursor: that is what the original's INSERT_MENTION handler does (useTextareaExpressionHandlers.ts:121-150); the plan said "at the cursor".
  • Start voice call / Voice call needs a known DM (StartCall takes a DM channel); without one the row is left out, as Task 15's friend "More" menu does.
  • Change friend nickname carries Friend { SetNickname(user, current nickname) }; the UI (Task 31) opens its modal on that row id.
  • Roles ▸ is the member's own roles as Disabled rows (no inert kind exists); editing with MANAGE_ROLES is O (7).
  • Remove from group sends RemoveRecipient directly (no confirm variant exists in 11a; the original asks "Remove {userName} from the group?").
  • USER_PINNED_DMS_UPDATE is still untyped in proto, so pins from other sessions do not sync until a proto task types it; DM list ordering by pin is not part of this task.
  • Outside the Files list (minimal): event.rs (InviteAction::ToCommunity), invites.rs (its flow), app.rs (blocked-DM gate), chat/mod.rs (export), fluxer-ui message_actions/mod.rs (label/icon/action arms for the new MessageAction) and dms/mod.rs (the DM list X sends confirmed: true, closing at once like the original's), plus their tests (chat_dms.rs, chat_actions.rs, dailyuse_ports.rs, ui dms.rs, ui message_actions.rs) updated for the new behaviour.
  • CopyId is emitted but executed by Task 17's reducer (not in this stack).

Closes #504
Refs #129, #476

🤖 Generated with Claude Code

Stacked on: dailyuse-15-core-friends-blocking, dailyuse-16b-core-create-invites-guilds ## What - `menus::user(&App, UserMenuContext)`: the spec §3.2 (e) "B" rows, in the original's order. In a guild `GuildMemberContextMenu.tsx` (View profile, Mention, Message / Open DM, Start voice call, Add note, Change friend nickname | Invite to community ▸, relationship rows | Report message, Block / Unblock | Roles ▸ read-only | Copy user ID). Elsewhere `UserContextMenu.tsx`'s default menu (plus "Remove from group" for a group DM owner), and in a 1:1 DM its DM menus (`renderDmOtherMenu` / `renderDmSelfMenu`: Mark as read, Close DM in the first group, no Mention/Message). System users: View profile + Copy user ID. - `menus::dm(&App, channel_id)`: `DMMenuData.tsx` for DMs and group DMs (Mark as read, View profile / Voice call / Add note / Change friend nickname, Pin DM / Pin group DM, Invite to community + relationship rows + Block, Close DM / Leave group, Copy user ID / Copy channel ID, last the mute row "Mute @{name}" / "Mute {groupName}" from `menus::mute::item`). - `chat::dms`: `PinDm` (`pinned` from `READY.pinned_dms` and `DmPinned`; toasts "Pinned DM" / "Unpinned group DM" …; "Something went wrong" / "Failed to pin DM" in `pin_error`, closed by `CloseConfirm`); `CloseDm` asks with `Confirm::CloseDm` unless `confirmed` (no Shift bypass), toasts "DM closed" after the confirm; an unconfirmed `MessageUser` for a blocked user opens `Confirm::OpenBlockedDm` and is held from the profiles (`hold_blocked_dm`, one line in `app.rs`). `dms::confirm_text` / `dms::confirm_accept` give the strings and accepting actions for Task 33. - `UserAction::MentionUser`: `@tag` user pill appended to the selected channel's composer. - `chat::can_report_message` (`MessageActionUtils.tsx:114-128`) and `MessageAction::ReportMessage`, last of the danger group. - `InviteAction::ToCommunity { channel_id, user_id }` (new variant) in `invites.rs`: POST invite (server defaults), open the DM if needed, send the link, toast "Invite sent for {guild}"; one at a time per user and channel; DM/send failures show the existing SendFailed modal, invite failures end quietly (as the original). ## Tests `crates/fluxer-core/tests/menus_user_dm.rs`: `user_menu_items` (table: self, friend, incoming, outgoing, blocked, stranger, bot, system × guild / DM / group owner / nowhere), `user_menu_labels_and_actions` (incl. from a message), `start_voice_call_hidden_during_a_call_with_them`, `dm_menu_items`, `group_dm_menu_items`, `pin_dm_round_trip`, `mention_inserts_span`, `report_only_for_eligible_messages`, `invite_to_community_lists_other_guilds`, `close_dm_confirms_without_shift_bypass`, `message_blocked_user_confirms_without_shift_bypass`. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally. No FLUXER_DESKTOP_TESTS tests apply. ## Deviations / for the reviewer - **Mention** appends at the end (with a space if needed), not at the cursor: that is what the original's `INSERT_MENTION` handler does (`useTextareaExpressionHandlers.ts:121-150`); the plan said "at the cursor". - **Start voice call / Voice call** needs a known DM (`StartCall` takes a DM channel); without one the row is left out, as Task 15's friend "More" menu does. - **Change friend nickname** carries `Friend { SetNickname(user, current nickname) }`; the UI (Task 31) opens its modal on that row id. - **Roles ▸** is the member's own roles as `Disabled` rows (no inert kind exists); editing with MANAGE_ROLES is O (7). - **Remove from group** sends `RemoveRecipient` directly (no confirm variant exists in 11a; the original asks "Remove {userName} from the group?"). - **USER_PINNED_DMS_UPDATE** is still untyped in proto, so pins from other sessions do not sync until a proto task types it; DM list ordering by pin is not part of this task. - Outside the Files list (minimal): `event.rs` (`InviteAction::ToCommunity`), `invites.rs` (its flow), `app.rs` (blocked-DM gate), `chat/mod.rs` (export), `fluxer-ui` `message_actions/mod.rs` (label/icon/action arms for the new `MessageAction`) and `dms/mod.rs` (the DM list X sends `confirmed: true`, closing at once like the original's), plus their tests (`chat_dms.rs`, `chat_actions.rs`, `dailyuse_ports.rs`, ui `dms.rs`, ui `message_actions.rs`) updated for the new behaviour. - `CopyId` is emitted but executed by Task 17's reducer (not in this stack). Closes #504 Refs #129, #476 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Refs #495

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every UserAction, CoreEvent, Effect, ApiRequest/ApiResult and chat::Confirm
variant of the Daily use plan (Task 11a), plus the menu types (menus::MenuModel,
MenuItem, MenuItemKind, MenuItemId, MenuModel::flatten). New actions and events
do nothing yet; the runtime answers each new request with 501 CLIENT_NOT_WIRED
and logs Effect::Window until Daily use 28. MessageUser and CloseDm take a
confirmed flag and act as before; Notification gains icon (always None).

Refs #495

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

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
New domains notif_settings, social, invites, switcher, keynav and report with
their state, Default and stub reducers wired into App::apply; stub menu
builders (channel, category, guild, user, dm, mute::item); OwnPresence, profile
notes and modal state. Relationships move from chat::dms to app.social and are
read through social::relationship.

Refs #496

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Refs #497

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixtures used: fixtures/rest/invite_guild.json, invite_group_dm.json (shaped as
fork:packages/schema/src/domains/invite/InviteSchemas.ts:42-91, Daily use 2).

Refs #501

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Settings from READY, USER_GUILD_SETTINGS_UPDATE and the patch answers;
immediate menu mutes (guild scalars, whole channel_overrides map for
channels, categories and DMs in @me), mute_config in ms, local expiry
timers, 3 s debounced modal changes, revert on failure, selectors
is_muted / muted_until / level / guild_settings_modal, and the shared
mute menu row (MuteTargetMenuItem.tsx, MuteOptions.ts,
UserGuildSettings.ts, UserGuildSettingsCommands.ts).

Refs #497

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
format_date_time shifted the end with to_offset, which panics when the
local date leaves year 9999 (a 9999-12-31T23:30Z end read east of UTC).
It now uses checked_to_offset and falls back to UTC. The
event_replaces_guild_settings test now checks the staff override is
really gone instead of an always-true assertion.

Refs #497

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Uses the existing server-shaped fixtures: rest/invite_metadata.json
(POST /channels/{id}/invites, S/invite/InviteSchemas.ts:42-91 plus the
metadata fields), rest/guild.json (POST /guilds, GuildResponse) and
gateway/guild_create.json.

Refs #502

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The invite modal (default invite at open, settings clamped to the
server's limits, link, expiry text, friends and group DMs with
Invite -> Sent through SendMessage), can_invite / invite_channel for the
menus, "Create or join a community" (name, static icon, create then
select the system channel once its GUILD_CREATE is in, join through the
accept flow), and "Leave community" (Confirm::LeaveGuild, no Shift
bypass, no delete_messages; hidden for the owner; on success the guild
goes as its GUILD_DELETE would, so a selected one leaves for the DMs).

Refs #502

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dailyuse_ports listed them among the stubs that do nothing.

Refs #502

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Table tests for the notification decision (Notification.ts:187-256) and
tests for mute consumers: unread, guild pill, hide muted channels, DM
mentions. Stubs for SidebarSection.{category_muted,muted} and
notif_settings::hides_muted_channels so the tests compile.

Refs #498

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- notif_settings::mentions_me as MessageUtils.isMentioned and
  Notification.isMessageMentionLike: blocked author no, user mention,
  @everyone unless suppressed or in an unjoined thread, own role unless
  suppressed, unmuted DM.
- notification_for follows Notification.ts:187-256: own, blocked, DND,
  SUPPRESS_NOTIFICATIONS, then thread levels (member level, parent level,
  forum new-post level, else only mentions) or mute at any level and the
  effective level.
- read_state::unread is false for a muted channel (mention counts kept);
  has_unread_messages keeps the raw answer for the new-messages bar and
  the thread menu's Mark as read.
- channel_tree: category_muted and muted rows; hide muted channels per
  guild (default_hide_muted_channels without an entry), unless selected,
  connected or with a mention; all-hidden categories hidden.
- DmRowModel.muted from the @me override; a thread is muted by its
  membership or its parent at any level.

Refs #498

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Own presence from the user settings; SetStatus / SetCustomStatus write only
their fields (optimistic, reverted on failure); reset timer; idle and afk
from CoreEvent::Idle; op 3 whenever the computed presence changes; status
popout, custom status modal and custom status selectors.

Refs #499

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed reset PATCH was re-sent at once by the same refresh, with no
limit (a request storm while offline or on 4xx/429). Remember the reset
whose write failed and skip it until READY, USER_SETTINGS_UPDATE or a
patch answer brings new settings, as StatusExpiry.handleExpiry does not
retry. The custom status test now asserts the profile popout exists.

Refs #499

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Relationship fixtures are shaped like RelationshipResponse
(packages/schema/src/domains/user/UserResponseSchemas.ts:492 of the
fork): id, type, user, nickname (nullable, always sent),
share_voice_activity, friend_shares_voice_activity.

Refs #500

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	crates/fluxer-core/src/app.rs
Refs #504

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
menus::user and menus::dm with the rows of GuildMemberContextMenu,
UserContextMenu, DMContextMenu and GroupDMContextMenu that this client
builds; Mention into the composer; Pin DM; Close DM and Open DM (blocked)
confirms; Invite to community; Report message in the message menu.

Refs #504

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

Independent review: Daily use 18 (core user, member and DM menus)

Scope: git diff ec031d4a..origin/dailyuse-18-core-user-dm-menus (098dd43).

Checks

  1. Plan tests: all present in crates/fluxer-core/tests/menus_user_dm.rs (user_menu_items table covering self, friend, incoming, outgoing, blocked, no relationship, bot and system, in a guild, in a DM, in an owned group and with no channel; dm_menu_items, group_dm_menu_items, mention_inserts_span, report_only_for_eligible_messages, invite_to_community_lists_other_guilds, close_dm_confirms_without_shift_bypass), plus extra pin, call and blocked-DM tests. The "from message" case is covered by the labels and report tests.
  2. Interfaces: menus::user(&App, UserMenuContext { user_id, guild_id, channel_id, message }) and menus::dm(&App, channel_id) exist as written. They use Confirm::CloseDm and Confirm::OpenBlockedDm, MessageAction::ReportMessage (last of the danger group) and chat::can_report_message. InviteAction::ToCommunity is an additive variant.
  3. Invariants: fluxer-core does no I/O and gains no new dependencies; no fixture changes; no secrets. Server data cannot cause a panic here: the index loops in invites.rs remove items in reverse order.
  4. Parity spot checks against the fork (ba98441b4), all of which match: the group order and conditions of GuildMemberContextMenu.tsx:77-375; renderDmOtherMenu (Close DM not red, report and block group present, UserContextMenu.tsx:434-548); the DMMenuData.tsx:468-702 groups (Remove friend red, friendly bot, Pin and Unpin labels, copy IDs, mute last); canReportMessage (MessageActionUtils.tsx:114-128, crosspost check = IS_CROSSPOST(1<<1) and SOURCE_MESSAGE_DELETED(1<<3)); INSERT_MENTION appending at the end with a leading space (useTextareaExpressionHandlers.ts:121-153; the deviation from the plan's "at cursor" follows the original); and the strings "Close your DM with {displayName}? You can reopen it anytime.", "DM closed", "You blocked {userName}. You won't be able to send messages unless you unblock them.", "Invite sent for {guildName}", "Failed to pin DM". The DM list X closing at once matches useDMListItemHandlers.tsx:132-150.
  5. Review Focus 4 (menu rows, order and conditions): met, apart from the minor points below. Review Focus 5 (Close DM, and Open DM while blocked, confirm without a Shift bypass): met.
  6. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: all steps passed (exit 0) in the review worktree.

Findings (none blocking)

  • minor: "Remove from group" sends RemoveRecipient at once. The original asks first: UserContextMenu.tsx:302-317 shows a ConfirmModal with "Remove from group", "Remove" and the danger style. No Confirm variant exists for this; please open a follow-up issue.
  • minor: "Start voice call" is left out when no DM with the user is known. The original's startCallWithUser opens the DM itself (CallMenuItems.tsx:54-80). This is the same limitation as Task 15's friend "More" menu, so it is consistent with reviewed code. It needs a follow-up issue, because the row is missing for most guild members.
  • minor: in your own DM, the user menu's "Close DM" is drawn red (close_dm sets the danger flag). The original's renderDmSelfMenu row is not red (UserContextMenu.tsx:409-417).
  • minor: Invites::community_invite_created matches InviteCreated by channel_id, not by effect id. If the invite modal's create and an "Invite to community" for the same channel run at the same time, they can take each other's invite. It is rare, but worth a note.
  • minor: USER_PINNED_DMS_UPDATE is not handled (the implementer notes it), so pins made in other sessions do not sync until the next READY. Please open a follow-up issue.

Verdict: APPROVED. No blocking findings and local CI is green. Please file follow-up issues for the first, second and last minor findings.

## Independent review: Daily use 18 (core user, member and DM menus) Scope: `git diff ec031d4a..origin/dailyuse-18-core-user-dm-menus` (098dd43). **Checks** 1. Plan tests: all present in `crates/fluxer-core/tests/menus_user_dm.rs` (`user_menu_items` table covering self, friend, incoming, outgoing, blocked, no relationship, bot and system, in a guild, in a DM, in an owned group and with no channel; `dm_menu_items`, `group_dm_menu_items`, `mention_inserts_span`, `report_only_for_eligible_messages`, `invite_to_community_lists_other_guilds`, `close_dm_confirms_without_shift_bypass`), plus extra pin, call and blocked-DM tests. The "from message" case is covered by the labels and report tests. 2. Interfaces: `menus::user(&App, UserMenuContext { user_id, guild_id, channel_id, message })` and `menus::dm(&App, channel_id)` exist as written. They use `Confirm::CloseDm` and `Confirm::OpenBlockedDm`, `MessageAction::ReportMessage` (last of the danger group) and `chat::can_report_message`. `InviteAction::ToCommunity` is an additive variant. 3. Invariants: fluxer-core does no I/O and gains no new dependencies; no fixture changes; no secrets. Server data cannot cause a panic here: the index loops in `invites.rs` remove items in reverse order. 4. Parity spot checks against the fork (ba98441b4), all of which match: the group order and conditions of `GuildMemberContextMenu.tsx:77-375`; `renderDmOtherMenu` (Close DM not red, report and block group present, `UserContextMenu.tsx:434-548`); the `DMMenuData.tsx:468-702` groups (Remove friend red, friendly bot, Pin and Unpin labels, copy IDs, mute last); `canReportMessage` (`MessageActionUtils.tsx:114-128`, crosspost check = IS_CROSSPOST(1<<1) and SOURCE_MESSAGE_DELETED(1<<3)); `INSERT_MENTION` appending at the end with a leading space (`useTextareaExpressionHandlers.ts:121-153`; the deviation from the plan's "at cursor" follows the original); and the strings "Close your DM with {displayName}? You can reopen it anytime.", "DM closed", "You blocked {userName}. You won't be able to send messages unless you unblock them.", "Invite sent for {guildName}", "Failed to pin DM". The DM list X closing at once matches `useDMListItemHandlers.tsx:132-150`. 5. Review Focus 4 (menu rows, order and conditions): met, apart from the minor points below. Review Focus 5 (Close DM, and Open DM while blocked, confirm without a Shift bypass): met. 6. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`: **all steps passed** (exit 0) in the review worktree. **Findings** (none blocking) - minor: "Remove from group" sends `RemoveRecipient` at once. The original asks first: `UserContextMenu.tsx:302-317` shows a ConfirmModal with "Remove from group", "Remove" and the danger style. No `Confirm` variant exists for this; please open a follow-up issue. - minor: "Start voice call" is left out when no DM with the user is known. The original's `startCallWithUser` opens the DM itself (`CallMenuItems.tsx:54-80`). This is the same limitation as Task 15's friend "More" menu, so it is consistent with reviewed code. It needs a follow-up issue, because the row is missing for most guild members. - minor: in your own DM, the user menu's "Close DM" is drawn red (`close_dm` sets the danger flag). The original's `renderDmSelfMenu` row is not red (`UserContextMenu.tsx:409-417`). - minor: `Invites::community_invite_created` matches `InviteCreated` by `channel_id`, not by effect id. If the invite modal's create and an "Invite to community" for the same channel run at the same time, they can take each other's invite. It is rare, but worth a note. - minor: `USER_PINNED_DMS_UPDATE` is not handled (the implementer notes it), so pins made in other sessions do not sync until the next READY. Please open a follow-up issue. **Verdict: APPROVED.** No blocking findings and local CI is green. Please file follow-up issues for the first, second and last minor findings.
Author
Owner

Merged into dailyuse at f7972c3 (combined merge of 23 Daily use tasks plus textchat).

Merged into `dailyuse` at f7972c3 (combined merge of 23 Daily use tasks plus `textchat`).
charles closed this pull request 2026-11-15 06:08:38 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.