Daily use 29: Channel, category and guild context menus (#518) #571

Closed
charles wants to merge 0 commits from dailyuse-29-ui-channel-guild-menus into dailyuse
Owner

Stacked on: dailyuse-17-core-channel-guild-menus

What

Right-click menus of the sidebar and the guild rail (spec §3.2 (a)-(d)), drawn from the store's MenuModels of Daily use 17:

  • screens/main/menus/{mod,channel,guild}.rs: Target::{Channel, Category, Guild}, menus::State (in Local::menus), menus::Message::{Open, Close, Submenu, Pick(row), PickSub { row, item }}, menus::model, menus::items (the shared MenuModel -> context_menu::Item conversion: order kept, one separator between groups, disabled rows, the "Hide muted channels" checkbox, the mute row as a submenu whose own click mutes until turned back on), menus::update, menus::over.
  • Right press on a guild channel's row, a category header (sidebar.rs), a guild icon (guild_rail.rs) and the guild header (the sidebar's guild name, the original's GuildHeader) opens the menu at the cursor (via the existing message_actions::row_input, which corrects for the scrollable's offset).
  • Rows are picked by index and resolved against a freshly built model, so what is acted on is what the store says now; a pick closes the menu.
  • Toasts as the original: "Channel link copied", "Link copied to clipboard" (link channel's "Copy link"), "Channel ID copied", "Category ID copied", "Copied to clipboard" (guild ID goes through TextCopyCommands.copy without its own text, GuildMenuData.tsx:265-268), 3 s, through the forum's existing toast (forum::toast_over, made pub(crate)).
  • Escape (app.rs) and a click outside close the menu; opening it closes the participant/stream menus and vice versa.
  • Icons at the row ends as ContextMenuIcons.tsx (Eye, UserPlus, Link, Bell, BellSlash for Unmute, CaretDown/CaretRight for collapse, SignOut, Snowflake, ChatCircle); two new Phosphor icons megaphone-simple-fill (Follow channel) and arrow-square-out-regular (Open link) from @phosphor-icons/core 2.1.1.

Tests

  • crates/fluxer-ui/tests/menus_channel_guild.rs (dailyuse READY): right_press_opens_menu_at_cursor (sidebar header, category, channel rows, voice rows, rail icon; position = cursor; the opened menu draws), model_to_items_preserves_order_and_separators, disabled_category_mark_read_does_nothing, mute_submenu_click_parent_mutes_forever (click in the drawn menu, then the 15-minute duration from the submenu), voice_row_open_chat, copy_rows_show_their_toast, outside_click_closes.
  • Goldens channel_menu, channel_menu_mute_submenu, category_menu, guild_menu (dailyuse READY), rendered on lavapipe in the fluxer-native-shots:u2204 image; the whole screenshot suite (127) passes there. Reference images in docs/screenshots/, rows in its README. No Electron side-by-side is available here; dimensions come from ContextMenu.module.css via widgets::context_menu (Daily use 8).
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally. No FLUXER_DESKTOP_TESTS tests are involved.

Deviations / notes for the reviewer

  • header.rs is untouched: the "guild header" of the original is the sidebar's guild name (GuildHeader.tsx), so the trigger is in sidebar.rs.
  • Outside the Files list (minimal): app.rs (the Local::menus field and one Escape arm), forum/mod.rs (toast_over made pub(crate) to reuse the existing toast), tests/voice_sidebar.rs (one assertion said "no right-press reacts in a collapsed category"; it now checks for no participant menu, since rows open their own menus), crates/fluxer-ui/README.md.
  • The actions the menus emit whose UI lands later (OpenNotificationSettings -> Task 30, Invite(Create) -> 34b, LeaveGuild confirm -> 33) are sent as is.
  • docs/parity/dailyuse.md does not exist yet (Task 40); no parity rows added here.

Closes #518

🤖 Generated with Claude Code

Stacked on: dailyuse-17-core-channel-guild-menus ## What Right-click menus of the sidebar and the guild rail (spec §3.2 (a)-(d)), drawn from the store's `MenuModel`s of Daily use 17: - `screens/main/menus/{mod,channel,guild}.rs`: `Target::{Channel, Category, Guild}`, `menus::State` (in `Local::menus`), `menus::Message::{Open, Close, Submenu, Pick(row), PickSub { row, item }}`, `menus::model`, `menus::items` (the shared `MenuModel -> context_menu::Item` conversion: order kept, one separator between groups, disabled rows, the "Hide muted channels" checkbox, the mute row as a submenu whose own click mutes until turned back on), `menus::update`, `menus::over`. - Right press on a guild channel's row, a category header (`sidebar.rs`), a guild icon (`guild_rail.rs`) and the guild header (the sidebar's guild name, the original's `GuildHeader`) opens the menu at the cursor (via the existing `message_actions::row_input`, which corrects for the scrollable's offset). - Rows are picked by index and resolved against a freshly built model, so what is acted on is what the store says now; a pick closes the menu. - Toasts as the original: "Channel link copied", "Link copied to clipboard" (link channel's "Copy link"), "Channel ID copied", "Category ID copied", "Copied to clipboard" (guild ID goes through `TextCopyCommands.copy` without its own text, `GuildMenuData.tsx:265-268`), 3 s, through the forum's existing toast (`forum::toast_over`, made `pub(crate)`). - Escape (`app.rs`) and a click outside close the menu; opening it closes the participant/stream menus and vice versa. - Icons at the row ends as `ContextMenuIcons.tsx` (Eye, UserPlus, Link, Bell, BellSlash for Unmute, CaretDown/CaretRight for collapse, SignOut, Snowflake, ChatCircle); two new Phosphor icons `megaphone-simple-fill` (Follow channel) and `arrow-square-out-regular` (Open link) from `@phosphor-icons/core` 2.1.1. ## Tests - `crates/fluxer-ui/tests/menus_channel_guild.rs` (dailyuse READY): `right_press_opens_menu_at_cursor` (sidebar header, category, channel rows, voice rows, rail icon; position = cursor; the opened menu draws), `model_to_items_preserves_order_and_separators`, `disabled_category_mark_read_does_nothing`, `mute_submenu_click_parent_mutes_forever` (click in the drawn menu, then the 15-minute duration from the submenu), `voice_row_open_chat`, `copy_rows_show_their_toast`, `outside_click_closes`. - Goldens `channel_menu`, `channel_menu_mute_submenu`, `category_menu`, `guild_menu` (dailyuse READY), rendered on lavapipe in the `fluxer-native-shots:u2204` image; the whole screenshot suite (127) passes there. Reference images in `docs/screenshots/`, rows in its README. No Electron side-by-side is available here; dimensions come from `ContextMenu.module.css` via `widgets::context_menu` (Daily use 8). - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally. No `FLUXER_DESKTOP_TESTS` tests are involved. ## Deviations / notes for the reviewer - `header.rs` is untouched: the "guild header" of the original is the sidebar's guild name (`GuildHeader.tsx`), so the trigger is in `sidebar.rs`. - Outside the Files list (minimal): `app.rs` (the `Local::menus` field and one Escape arm), `forum/mod.rs` (`toast_over` made `pub(crate)` to reuse the existing toast), `tests/voice_sidebar.rs` (one assertion said "no right-press reacts in a collapsed category"; it now checks for no participant menu, since rows open their own menus), `crates/fluxer-ui/README.md`. - The actions the menus emit whose UI lands later (`OpenNotificationSettings` -> Task 30, `Invite(Create)` -> 34b, `LeaveGuild` confirm -> 33) are sent as is. - `docs/parity/dailyuse.md` does not exist yet (Task 40); no parity rows added here. Closes #518 🤖 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>
menus::{channel, category, guild} build the original's desktop menus
(AM/ChannelContextMenu.tsx, ChannelMenuData.tsx:429-632,
CategoryMenuData.tsx:263-339, GuildMenuData.tsx:314-497) with the "B"
rows of spec 3.2 (a)-(d). MarkCategoryRead and MarkGuildRead ack in
bulk through POST /read-states/ack; CopyId, CopyChannelLink and the
link channel's "Copy link" write the clipboard. Collapsed categories
are synced as the category override's `collapsed`
(UserGuildSettingsCommands.ts:198-246), written debounced 3 s with the
whole override map; "Hide muted channels" likewise. The sidebar reads
notif_settings::is_collapsed and emits UserAction::ToggleCategory
instead of keeping a local set.

New UserAction variants: CopyLinkChannelUrl, OpenNotificationSettings,
OpenFollowChannel (the last two open UI-owned modals).

Refs #503

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A right press on a guild channel's row, a category header, a guild icon
or the guild header opens the store's menu (Daily use 17) at the cursor,
drawn by widgets::context_menu with the original's icons; the mute row
mutes until turned back on when clicked and opens its durations when
hovered; the copy rows put up the original's toasts; Escape and a click
outside close it. Icons megaphone-simple-fill and arrow-square-out-regular
added from @phosphor-icons/core 2.1.1.

Refs #518

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Four new goldens from the dailyuse scenario's READY
(fixtures/gateway/dailyuse_ready.json): channel_menu (#general's menu),
channel_menu_mute_submenu (its nine durations open), category_menu
(Lobby) and guild_menu (Forked, from the rail), with their reference
images and README rows. Rendered on lavapipe in the
fluxer-native-shots:u2204 (Ubuntu 22.04) image, like the Linux runner;
the whole suite (127 tests) passes there unchanged.

Refs #518

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

Independent review: Daily use 29 (channel, category and guild menus)

Reviewed 6db33abf..af170c2 cold. Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree: all steps passed (exit 0).

What I checked

  • Plan tests exist and assert what the plan says: right_press_opens_menu_at_cursor (sidebar guild header, category, text and voice rows, rail guild icon only; position equals cursor), model_to_items_preserves_order_and_separators (labels equal to the core builders for all four targets, no leading or trailing separator), mute_submenu_click_parent_mutes_forever (parent click gives Mute(Channel, Forever); hover opens 9 durations; the first gives Minutes(15)), voice_row_open_chat. All four goldens are present (channel_menu, channel_menu_mute_submenu, category_menu, guild_menu) with docs/screenshots copies. There are extra tests for the copy toasts and for closing on an outside click.
  • Interfaces: builds on core Task 17 (fluxer_core::menus::{channel, category, guild, MenuModel, MenuRow}) as it is. The shared MenuModel → context_menu::Item conversion is in menus/mod.rs, as the plan says. Every core item id (copy-*, mark-read, open-chat, open-link, follow-channel, invite-*, unmute, notification-settings, toggle-collapse*, leave-community, hide-muted-channels) is mapped.
  • Invariants: no new I/O in fluxer-ui. The clipboard write is core's Effect::Clipboard (menus/channel.rs reduce). No new fixtures, no secrets. A pick on a stale or out-of-range index returns None and does not panic.
  • Parity spot checks against the fork: "Channel link copied" / "Channel ID copied" (ChannelMenuData.tsx:94-104), "Category ID copied" (CategoryMenuData.tsx:66-68), "Link copied to clipboard" (CommonMessageDescriptors.ts:394), "Copied to clipboard" for the community ID (TextCopyCommands.copy, GuildMenuData.tsx:266). The guild header opens GuildContextMenu (GuildHeader.tsx:65-111). A click on the submenu trigger acts (ContextMenu.tsx:485-497). All match.

Findings

  1. minor: the toast time is stale. menus::pick stamps the toast with local.messages.now_unix, but Shell::update only refreshes that value on a Snapshot (app.rs:528), not before main::update. A copy does not dirty the store, so how long the toast stays depends on when the next snapshot arrives: it can vanish right away in a busy guild, or stay until the next gateway event in a quiet one. The tests set now_unix by hand, so they don't catch this. Fix: refresh now_unix before main::update (or stamp in the shell), plus a timer to hide the toast after 3 s. The forum toast already has the second half of this problem.
  2. minor (parity): the "Hide muted channels" checkbox closes the menu. pick closes on every row, toggles included. In the original, CheckboxItem defaults to closeOnChange = false and closeOnClick={false} (ContextMenu.tsx:624-646, DataMenuRenderer.tsx:86-96), so the menu stays open with the box toggled.
  3. minor: rows can shift under the cursor. The menu is rebuilt from the live store on every frame and picks go by index, so if the channel is read elsewhere while the menu is open, "Mark as read" disappears and every row moves up. The original keeps the initial visibility (preserveInitialMarkAsReadVisibility; spec: "unread when opened"). Picks stay consistent with what is drawn, so no wrong action is sent. This belongs to Task 17's builder signature; follow-up material.
  4. minor (test strength): two assertions are conditional and do not run on the fixture. The Leave community danger check is skipped when the row is absent, and disabled_category_mark_read_does_nothing is skipped when Lobby has unreads. They pass vacuously.
  5. note (plan): Task 31 adds menus/{user,dm}.rs, which need pub mod lines and Target variants in this task's menus/mod.rs, but Task 31 does not list 29 under Depends on. The orchestrator should serialise them.

None of these breaks an interface or an invariant, or touches user data. Suggest follow-up issues for 1 to 3.

Verdict: APPROVE (0 blocking findings, local CI green).

## Independent review: Daily use 29 (channel, category and guild menus) Reviewed `6db33abf..af170c2` cold. Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh review worktree: **all steps passed (exit 0)**. **What I checked** - Plan tests exist and assert what the plan says: `right_press_opens_menu_at_cursor` (sidebar guild header, category, text and voice rows, rail guild icon only; position equals cursor), `model_to_items_preserves_order_and_separators` (labels equal to the core builders for all four targets, no leading or trailing separator), `mute_submenu_click_parent_mutes_forever` (parent click gives `Mute(Channel, Forever)`; hover opens 9 durations; the first gives `Minutes(15)`), `voice_row_open_chat`. All four goldens are present (`channel_menu`, `channel_menu_mute_submenu`, `category_menu`, `guild_menu`) with `docs/screenshots` copies. There are extra tests for the copy toasts and for closing on an outside click. - Interfaces: builds on core Task 17 (`fluxer_core::menus::{channel, category, guild, MenuModel, MenuRow}`) as it is. The shared `MenuModel → context_menu::Item` conversion is in `menus/mod.rs`, as the plan says. Every core item id (`copy-*`, `mark-read`, `open-chat`, `open-link`, `follow-channel`, `invite-*`, `unmute`, `notification-settings`, `toggle-collapse*`, `leave-community`, `hide-muted-channels`) is mapped. - Invariants: no new I/O in fluxer-ui. The clipboard write is core's `Effect::Clipboard` (`menus/channel.rs` reduce). No new fixtures, no secrets. A pick on a stale or out-of-range index returns `None` and does not panic. - Parity spot checks against the fork: "Channel link copied" / "Channel ID copied" (`ChannelMenuData.tsx:94-104`), "Category ID copied" (`CategoryMenuData.tsx:66-68`), "Link copied to clipboard" (`CommonMessageDescriptors.ts:394`), "Copied to clipboard" for the community ID (`TextCopyCommands.copy`, `GuildMenuData.tsx:266`). The guild header opens `GuildContextMenu` (`GuildHeader.tsx:65-111`). A click on the submenu trigger acts (`ContextMenu.tsx:485-497`). All match. **Findings** 1. **minor**: the toast time is stale. `menus::pick` stamps the toast with `local.messages.now_unix`, but `Shell::update` only refreshes that value on a `Snapshot` (`app.rs:528`), not before `main::update`. A copy does not dirty the store, so how long the toast stays depends on when the next snapshot arrives: it can vanish right away in a busy guild, or stay until the next gateway event in a quiet one. The tests set `now_unix` by hand, so they don't catch this. Fix: refresh `now_unix` before `main::update` (or stamp in the shell), plus a timer to hide the toast after 3 s. The forum toast already has the second half of this problem. 2. **minor (parity)**: the "Hide muted channels" checkbox closes the menu. `pick` closes on every row, toggles included. In the original, `CheckboxItem` defaults to `closeOnChange = false` and `closeOnClick={false}` (`ContextMenu.tsx:624-646`, `DataMenuRenderer.tsx:86-96`), so the menu stays open with the box toggled. 3. **minor**: rows can shift under the cursor. The menu is rebuilt from the live store on every frame and picks go by index, so if the channel is read elsewhere while the menu is open, "Mark as read" disappears and every row moves up. The original keeps the initial visibility (`preserveInitialMarkAsReadVisibility`; spec: "unread when opened"). Picks stay consistent with what is drawn, so no wrong action is sent. This belongs to Task 17's builder signature; follow-up material. 4. **minor (test strength)**: two assertions are conditional and do not run on the fixture. The `Leave community` danger check is skipped when the row is absent, and `disabled_category_mark_read_does_nothing` is skipped when Lobby has unreads. They pass vacuously. 5. **note (plan)**: Task 31 adds `menus/{user,dm}.rs`, which need `pub mod` lines and `Target` variants in this task's `menus/mod.rs`, but Task 31 does not list 29 under `Depends on`. The orchestrator should serialise them. None of these breaks an interface or an invariant, or touches user data. Suggest follow-up issues for 1 to 3. **Verdict: APPROVE** (0 blocking findings, local CI green).
Author
Owner

Review: Daily use 29 (git diff 6db33ab..af170c2)

Checked

  • Plan tests: right_press_opens_menu_at_cursor, model_to_items_preserves_order_and_separators, mute_submenu_click_parent_mutes_forever (parent click gives Mute(Channel, Forever), first duration gives Minutes(15)) and voice_row_open_chat are all present. The goldens channel_menu, channel_menu_mute_submenu, category_menu and guild_menu are in screenshots.rs, fixtures/golden/ and docs/screenshots/.
  • Interfaces: a right press on a channel row, a category header, a guild icon or the guild name in the sidebar header opens the menu at the cursor. The mute submenu, the toasts, Escape (app.rs) and a click outside all work. The rows come from fluxer_core::menus::{channel,category,guild} in the model's order, with separators between groups.
  • Invariants: no new I/O path, no secrets, no new dependencies. Picks resolve by index against a freshly built model and return None for an out-of-range index, so they cannot panic.
  • Parity, checked against the fork: the toast strings "Channel link copied", "Channel ID copied", "Category ID copied" and "Link copied to clipboard" (ChannelMenuData.tsx:94-104,264-280,399-402, CategoryMenuData.tsx:66-68,236-239, CommonMessageDescriptors.ts:394). The guild ID uses TextCopyCommands.copy's "Copied to clipboard" (GuildMenuData.tsx:265-268). The mute group comes last in CategoryContextMenu.tsx and GuildContextMenu.tsx, and the row icons match ContextMenuIcons.tsx (Eye fill, Snowflake regular, Link bold, ArrowSquareOut regular, UserPlus, Bell, SignOut, ChatCircle).
  • Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: green (EXIT=0) at af170c2.

Findings

  1. blocking: in menus/mod.rs:403-407, pick stamps the copy toast with local.messages.now_unix. That value is only refreshed when a snapshot arrives (app.rs:528). The pick's own action (CopyId or CopyChannelLink) is dispatched, which sets dirty (runtime.rs:823) and publishes a snapshot, and that snapshot sets now_unix to the real time. So if the previous snapshot was 3 s or more old (any quiet moment), the toast has already expired when it would first be drawn, and "Channel ID copied" and the others never appear. The tests set now_unix by hand, so they do not catch this. Fix: stamp with the wall clock (app.rs's now_unix()), or start the toast's clock on the next snapshot, as forum::State::sync does.
  2. minor: no timer clears the toast. It disappears only on the next snapshot, so in a quiet session it can stay well past 3 s. The forum toast already behaves this way; a one-shot subscription while a toast is up would fix both.
  3. minor: disabled_category_mark_read_does_nothing tests nothing in this fixture. Lobby holds the unread #general, so its "Mark as read" is enabled (see the category_menu golden) and the if body never runs. Pick a category with nothing unread, or assert that the row is disabled.
  4. minor: the menu is rebuilt every frame. The original's guild menu passes preserveInitialMarkAsReadVisibility: true (GuildContextMenu.tsx), so its "Mark as read" stays while the menu is open. Here the row disappears if the guild becomes read during that time.
  5. minor: opening a stream menu (mod.rs:550-561) does not clear local.menus.open, although opening a participant menu does. The context-menu backdrop makes it hard to hit in practice.

Verdict: changes requested (1 blocking finding: the copy toasts usually do not show).

## Review: Daily use 29 (`git diff 6db33ab..af170c2`) **Checked** - Plan tests: `right_press_opens_menu_at_cursor`, `model_to_items_preserves_order_and_separators`, `mute_submenu_click_parent_mutes_forever` (parent click gives `Mute(Channel, Forever)`, first duration gives `Minutes(15)`) and `voice_row_open_chat` are all present. The goldens `channel_menu`, `channel_menu_mute_submenu`, `category_menu` and `guild_menu` are in `screenshots.rs`, `fixtures/golden/` and `docs/screenshots/`. - Interfaces: a right press on a channel row, a category header, a guild icon or the guild name in the sidebar header opens the menu at the cursor. The mute submenu, the toasts, Escape (`app.rs`) and a click outside all work. The rows come from `fluxer_core::menus::{channel,category,guild}` in the model's order, with separators between groups. - Invariants: no new I/O path, no secrets, no new dependencies. Picks resolve by index against a freshly built model and return `None` for an out-of-range index, so they cannot panic. - Parity, checked against the fork: the toast strings "Channel link copied", "Channel ID copied", "Category ID copied" and "Link copied to clipboard" (`ChannelMenuData.tsx:94-104,264-280,399-402`, `CategoryMenuData.tsx:66-68,236-239`, `CommonMessageDescriptors.ts:394`). The guild ID uses `TextCopyCommands.copy`'s "Copied to clipboard" (`GuildMenuData.tsx:265-268`). The mute group comes last in `CategoryContextMenu.tsx` and `GuildContextMenu.tsx`, and the row icons match `ContextMenuIcons.tsx` (Eye fill, Snowflake regular, Link bold, ArrowSquareOut regular, UserPlus, Bell, SignOut, ChatCircle). - Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`: green (EXIT=0) at af170c2. **Findings** 1. **blocking**: in `menus/mod.rs:403-407`, `pick` stamps the copy toast with `local.messages.now_unix`. That value is only refreshed when a snapshot arrives (`app.rs:528`). The pick's own action (`CopyId` or `CopyChannelLink`) is dispatched, which sets `dirty` (`runtime.rs:823`) and publishes a snapshot, and that snapshot sets `now_unix` to the real time. So if the previous snapshot was 3 s or more old (any quiet moment), the toast has already expired when it would first be drawn, and "Channel ID copied" and the others never appear. The tests set `now_unix` by hand, so they do not catch this. Fix: stamp with the wall clock (`app.rs`'s `now_unix()`), or start the toast's clock on the next snapshot, as `forum::State::sync` does. 2. minor: no timer clears the toast. It disappears only on the next snapshot, so in a quiet session it can stay well past 3 s. The forum toast already behaves this way; a one-shot subscription while a toast is up would fix both. 3. minor: `disabled_category_mark_read_does_nothing` tests nothing in this fixture. Lobby holds the unread #general, so its "Mark as read" is enabled (see the `category_menu` golden) and the `if` body never runs. Pick a category with nothing unread, or assert that the row is disabled. 4. minor: the menu is rebuilt every frame. The original's guild menu passes `preserveInitialMarkAsReadVisibility: true` (`GuildContextMenu.tsx`), so its "Mark as read" stays while the menu is open. Here the row disappears if the guild becomes read during that time. 5. minor: opening a stream menu (`mod.rs:550-561`) does not clear `local.menus.open`, although opening a participant menu does. The context-menu backdrop makes it hard to hit in practice. **Verdict: changes requested** (1 blocking finding: the copy toasts usually do not show).
The copy toast was stamped with the screen's clock, the last snapshot's
time, so in a quiet session it had expired before it was first drawn. It
now waits for the copy's own snapshot to start its 3 s (as the forum's
does), and a timer in the shell clears it when the time is over.

Also: a guild menu that opened with "Mark as read" keeps the row while it
is open (preserveInitialMarkAsReadVisibility), opening a stream menu
closes the channel/guild menu, and the disabled category "Mark as read"
test now marks Lobby read so it tests something.

Refs #518

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

Review round 1 fixes, in b696526:

  • blocking: copy toast expired before it was drawn (menus/mod.rs): fixed. A pick now puts up the toast with no start time; menus::State::sync(now_unix), called from the shell on every snapshot, starts its 3 s clock, as forum::State::sync does. The copy's own snapshot therefore starts it at the real time. Test: copy_toast_starts_with_the_next_snapshot (stale clock 1000, snapshot at 5000, shows until 5003). It fails to build on the old code.
  • minor: no timer clears the toast: fixed. State::toast_until() gives the end time, and the shell runs a one-shot ToastAt timer while a toast runs (a short-lived thread, like the image retry timer). When it fires, UiMessage::ToastDue moves the screen clock on and calls sync, which removes the toast. The forum toast is unchanged.
  • minor: disabled_category_mark_read_does_nothing tested nothing: fixed. The test marks Lobby read first, then asserts without conditions that the row is disabled, drawn disabled, and that picking it does nothing.
  • minor: guild Mark as read disappears while the menu is open: fixed. Open::keep_mark_read records whether the guild menu opened with the row. menus::open_model puts it back first while that menu stays open, as preserveInitialMarkAsReadVisibility: true does. Test: guild_mark_read_stays_while_the_menu_is_open.
  • minor: stream menu does not clear local.menus.open: fixed. Test: stream_menu_closes_the_channel_menu.

FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally. On the first run, the fluxer lib tests crashed with SIGSEGV at process exit after all 82 passed. That is the known flake (#549, #304), and the rerun passed.

Review round 1 fixes, in b696526: - **blocking: copy toast expired before it was drawn** (menus/mod.rs): fixed. A pick now puts up the toast with no start time; `menus::State::sync(now_unix)`, called from the shell on every snapshot, starts its 3 s clock, as `forum::State::sync` does. The copy's own snapshot therefore starts it at the real time. Test: `copy_toast_starts_with_the_next_snapshot` (stale clock 1000, snapshot at 5000, shows until 5003). It fails to build on the old code. - **minor: no timer clears the toast**: fixed. `State::toast_until()` gives the end time, and the shell runs a one-shot `ToastAt` timer while a toast runs (a short-lived thread, like the image retry timer). When it fires, `UiMessage::ToastDue` moves the screen clock on and calls `sync`, which removes the toast. The forum toast is unchanged. - **minor: disabled_category_mark_read_does_nothing tested nothing**: fixed. The test marks Lobby read first, then asserts without conditions that the row is disabled, drawn disabled, and that picking it does nothing. - **minor: guild Mark as read disappears while the menu is open**: fixed. `Open::keep_mark_read` records whether the guild menu opened with the row. `menus::open_model` puts it back first while that menu stays open, as `preserveInitialMarkAsReadVisibility: true` does. Test: `guild_mark_read_stays_while_the_menu_is_open`. - **minor: stream menu does not clear local.menus.open**: fixed. Test: `stream_menu_closes_the_channel_menu`. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally. On the first run, the `fluxer` lib tests crashed with SIGSEGV at process exit after all 82 passed. That is the known flake (#549, #304), and the rerun passed.
Author
Owner

Independent review: Daily use 29 (b696526, diff 6db33ab..origin/dailyuse-29-ui-channel-guild-menus)

Checked

  • Plan tests are all present and assert the planned behaviour: right_press_opens_menu_at_cursor, model_to_items_preserves_order_and_separators, mute_submenu_click_parent_mutes_forever (Forever on the parent, Minutes(15) for the first duration, 9 durations), voice_row_open_chat. The goldens channel_menu, channel_menu_mute_submenu, category_menu and guild_menu are in screenshots.rs, fixtures/golden/ and docs/screenshots/. The extra tests for the earlier review findings are present too.
  • Interfaces: right press on channel rows, category headers, rail icons and the guild header opens at the cursor. The mute submenu works. Toasts go through the existing forum::toast_over. Escape (app.rs) and an outside click close the menu.
  • Invariants: no new I/O in fluxer-ui (the toast timer is a sleep thread like retry_due), no fixtures added, no secrets, and an unknown target gives an empty model with no panic.
  • Parity spot-checks against the fork:
    • Toast strings match ChannelMenuData.tsx:94-104, CategoryMenuData.tsx:66-68, CommonMessageDescriptors.ts:394 and TextCopyCommands.ts:11 ("Copied to clipboard" for the community ID).
    • Icons match ContextMenuIcons.tsx: Eye fill, UserPlus fill, ArrowSquareOut regular, Snowflake regular, CaretDown bold.
    • preserveInitialMarkAsReadVisibility is checked below.
  • Local gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci passed on b696526 (all steps, including the four new goldens on lavapipe).

Findings

  1. blocking: the channel menu's "Mark as read" does not follow "unread when opened" (spec §3.2 (a); ChannelContextMenu.tsx:31 passes preserveInitialMarkAsReadVisibility: true, ChannelMenuData.tsx:217-218). menus::open_model keeps the row only for Target::Guild. For a channel, the open menu is rebuilt from the live read_state::has_unread_messages, so the row disappears when the channel is acked while the menu is open (for example, the selected channel getting a message) and appears when a message lands in an unread-when-closed channel. Apart from the parity gap, the rows below it move by one. Pick(index) is resolved against a model rebuilt from the newest store (pick -> open_model -> action_at), so a snapshot between the draw and the click makes a click on "Notification settings" run the mute row or "Copy channel link" instead. Fix: record the opening state for channels as for guilds (and both ways, see 2). Also add a test where the channel becomes read and then unread while its menu is open.
  2. minor: the guild menu keeps "Mark as read" one way only. The original uses initialHasGuildUnread both ways (GuildMenuData.tsx:157-158): a guild that was read when its menu opened shows no "Mark as read" even if it becomes unread while the menu is open. Here, open_model adds the row when it was there at opening, but fluxer_core::menus::guild also adds it when the guild becomes unread later. This is the same row-shift problem as 1, on a smaller scale.
  3. minor (note): the plan lists screens/main/header.rs for the guild header. The trigger is on the sidebar title in sidebar.rs instead, which is where the guild header is drawn. That is fine, and the test covers it.

Verdict: changes requested (1 blocking: channel "Mark as read" must keep its opening state; ci green).

Daily use reviewer (independent)

## Independent review: Daily use 29 (b696526, diff 6db33ab..origin/dailyuse-29-ui-channel-guild-menus) **Checked** - Plan tests are all present and assert the planned behaviour: `right_press_opens_menu_at_cursor`, `model_to_items_preserves_order_and_separators`, `mute_submenu_click_parent_mutes_forever` (Forever on the parent, `Minutes(15)` for the first duration, 9 durations), `voice_row_open_chat`. The goldens `channel_menu`, `channel_menu_mute_submenu`, `category_menu` and `guild_menu` are in `screenshots.rs`, `fixtures/golden/` and `docs/screenshots/`. The extra tests for the earlier review findings are present too. - Interfaces: right press on channel rows, category headers, rail icons and the guild header opens at the cursor. The mute submenu works. Toasts go through the existing `forum::toast_over`. Escape (`app.rs`) and an outside click close the menu. - Invariants: no new I/O in fluxer-ui (the toast timer is a sleep thread like `retry_due`), no fixtures added, no secrets, and an unknown target gives an empty model with no panic. - Parity spot-checks against the fork: - Toast strings match `ChannelMenuData.tsx:94-104`, `CategoryMenuData.tsx:66-68`, `CommonMessageDescriptors.ts:394` and `TextCopyCommands.ts:11` ("Copied to clipboard" for the community ID). - Icons match `ContextMenuIcons.tsx`: Eye fill, UserPlus fill, ArrowSquareOut regular, Snowflake regular, CaretDown bold. - `preserveInitialMarkAsReadVisibility` is checked below. - Local gate: `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` passed on b696526 (all steps, including the four new goldens on lavapipe). **Findings** 1. **blocking**: the channel menu's "Mark as read" does not follow "unread when opened" (spec §3.2 (a); `ChannelContextMenu.tsx:31` passes `preserveInitialMarkAsReadVisibility: true`, `ChannelMenuData.tsx:217-218`). `menus::open_model` keeps the row only for `Target::Guild`. For a channel, the open menu is rebuilt from the live `read_state::has_unread_messages`, so the row disappears when the channel is acked while the menu is open (for example, the selected channel getting a message) and appears when a message lands in an unread-when-closed channel. Apart from the parity gap, the rows below it move by one. `Pick(index)` is resolved against a model rebuilt from the newest store (`pick` -> `open_model` -> `action_at`), so a snapshot between the draw and the click makes a click on "Notification settings" run the mute row or "Copy channel link" instead. Fix: record the opening state for channels as for guilds (and both ways, see 2). Also add a test where the channel becomes read and then unread while its menu is open. 2. **minor**: the guild menu keeps "Mark as read" one way only. The original uses `initialHasGuildUnread` both ways (`GuildMenuData.tsx:157-158`): a guild that was read when its menu opened shows no "Mark as read" even if it becomes unread while the menu is open. Here, `open_model` adds the row when it was there at opening, but `fluxer_core::menus::guild` also adds it when the guild becomes unread later. This is the same row-shift problem as 1, on a smaller scale. 3. **minor** (note): the plan lists `screens/main/header.rs` for the guild header. The trigger is on the sidebar title in `sidebar.rs` instead, which is where the guild header is drawn. That is fine, and the test covers it. **Verdict: changes requested** (1 blocking: channel "Mark as read" must keep its opening state; ci green). Daily use reviewer (independent)
Author
Owner

Round 2 fixes (commit 67276ce):

  • blocking, menus/mod.rs, channel "Mark as read": Open::keep_mark_read is replaced by Open::mark_read: Option<bool>, the opening state for channel and guild menus (None for a category, whose row is always there and only toggles disabled). open_model now keeps the row exactly as it was when the menu opened: it adds it back (channel menu: first row of the second group, after a voice channel's "Open chat"; guild menu: first row) if the target became read, and removes it if the target became unread. Rows keep their indices, so Pick(index) runs the row that was drawn. Tests (failing before the fix): channel_mark_read_stays_while_the_menu_is_open (drawn rows unchanged after MarkRead; picking the drawn "Notification settings" index gives OpenNotificationSettings; the drawn "Mark as read" still gives MarkRead) and channel_read_when_opened_gains_no_mark_read (a MESSAGE_CREATE under the open menu adds no row).
  • minor, guild menu one way only: fixed by the same change (both ways, initialHasGuildUnread). Test: guild_read_when_opened_gains_no_mark_read.
  • minor, sidebar.rs vs header.rs: no change; the guild header is drawn as the sidebar title in sidebar.rs, and the trigger stays there (covered by the existing right-press test).

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

Round 2 fixes (commit 67276ce): - **blocking, menus/mod.rs, channel "Mark as read"**: `Open::keep_mark_read` is replaced by `Open::mark_read: Option<bool>`, the opening state for channel and guild menus (`None` for a category, whose row is always there and only toggles disabled). `open_model` now keeps the row exactly as it was when the menu opened: it adds it back (channel menu: first row of the second group, after a voice channel's "Open chat"; guild menu: first row) if the target became read, and removes it if the target became unread. Rows keep their indices, so `Pick(index)` runs the row that was drawn. Tests (failing before the fix): `channel_mark_read_stays_while_the_menu_is_open` (drawn rows unchanged after MarkRead; picking the drawn "Notification settings" index gives OpenNotificationSettings; the drawn "Mark as read" still gives MarkRead) and `channel_read_when_opened_gains_no_mark_read` (a MESSAGE_CREATE under the open menu adds no row). - **minor, guild menu one way only**: fixed by the same change (both ways, `initialHasGuildUnread`). Test: `guild_read_when_opened_gains_no_mark_read`. - **minor, sidebar.rs vs header.rs**: no change; the guild header is drawn as the sidebar title in sidebar.rs, and the trigger stays there (covered by the existing right-press test). Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`: all steps passed.
The open menu's "Mark as read" now stays there or away as it was when the menu
opened, for channel menus as well as guild menus and both ways
(preserveInitialMarkAsReadVisibility, ChannelMenuData.tsx:217-218,
GuildMenuData.tsx:157-158), so a read-state change under an open menu no longer
moves its rows and a Pick runs the row that was drawn.

Refs #518

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

Independent review: Daily use 29 (67276ce, diff 6db33ab..origin/dailyuse-29-ui-channel-guild-menus)

Checked

  1. Plan tests: right_press_opens_menu_at_cursor, model_to_items_preserves_order_and_separators, mute_submenu_click_parent_mutes_forever (row click -> Mute(Channel, Forever), first duration -> Minutes(15), 9 durations), voice_row_open_chat (row 0 -> SelectChannel) and the goldens channel_menu, channel_menu_mute_submenu, category_menu, guild_menu are all present and assert what the plan asks for. The new tests (channel_mark_read_stays_while_the_menu_is_open, channel_read_when_opened_gains_no_mark_read, guild_read_when_opened_gains_no_mark_read) cover the previous blocking finding.
  2. Interfaces: right press on channel rows (guild channels only), category headers, rail guild icons and the sidebar's guild header opens the menu at the cursor. Mute submenu, copy toasts through the forum toast, and Escape/outside click closing all work. Rows come straight from fluxer_core::menus::{channel, category, guild}, so the order is the core's.
  3. Invariants: no new I/O. The toast timer copies retry_due's shell-side subscription pattern in app.rs. There are no secrets, tokens or paths in the code or tests. Nothing panics on server data: a missing target or guild gives an empty model and nothing is drawn, and stale indices resolve to None in action_at.
  4. Parity spot checks (fluxer-soundboard):
    • preserveInitialMarkAsReadVisibility: true is passed by ChannelContextMenu.tsx:31 and GuildContextMenu.tsx:26 but not by CategoryContextMenu. This matches Open::mark_read (None for a category).
    • The toast strings "Channel link copied" (ChannelMenuData.tsx:95), "Channel ID copied" (:103), "Category ID copied" (CategoryMenuData.tsx:67), "Link copied to clipboard" (CommonMessageDescriptors.ts:395) and "Copied to clipboard" (TextCopyCommands, guild ID) all match.
    • The desktop category menu draws the mute row last, after the data groups (CategoryContextMenu.tsx:27-39), as the golden does.
  5. Review Focus: item 4 belongs to Tasks 17/18 (core). This UI keeps the core's order and separators and adds no rows.
  6. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a clean review worktree: all steps passed (exit 0).

Findings

  • minor: open_model puts "Mark as read" back at hard-coded group indices (guild group 0, channel group 1). This is correct for today's core builders, but it will silently break if the core's group layout changes. A shared constant or a core helper would be safer. Not blocking.
  • minor: if the target disappears while its menu is open (channel deleted, guild left), over draws nothing but state.open stays Some until the next Escape or open. Harmless.
  • minor: the plan lists header.rs under Modify, but the guild header trigger is in sidebar.rs (where the title is built). The behaviour is there, so this is fine.

Verdict: approve. No blocking findings, and local CI is green.

## Independent review: Daily use 29 (67276ce, diff 6db33ab..origin/dailyuse-29-ui-channel-guild-menus) **Checked** 1. Plan tests: `right_press_opens_menu_at_cursor`, `model_to_items_preserves_order_and_separators`, `mute_submenu_click_parent_mutes_forever` (row click -> `Mute(Channel, Forever)`, first duration -> `Minutes(15)`, 9 durations), `voice_row_open_chat` (row 0 -> `SelectChannel`) and the goldens `channel_menu`, `channel_menu_mute_submenu`, `category_menu`, `guild_menu` are all present and assert what the plan asks for. The new tests (`channel_mark_read_stays_while_the_menu_is_open`, `channel_read_when_opened_gains_no_mark_read`, `guild_read_when_opened_gains_no_mark_read`) cover the previous blocking finding. 2. Interfaces: right press on channel rows (guild channels only), category headers, rail guild icons and the sidebar's guild header opens the menu at the cursor. Mute submenu, copy toasts through the forum toast, and Escape/outside click closing all work. Rows come straight from `fluxer_core::menus::{channel, category, guild}`, so the order is the core's. 3. Invariants: no new I/O. The toast timer copies `retry_due`'s shell-side subscription pattern in `app.rs`. There are no secrets, tokens or paths in the code or tests. Nothing panics on server data: a missing target or guild gives an empty model and nothing is drawn, and stale indices resolve to `None` in `action_at`. 4. Parity spot checks (fluxer-soundboard): - `preserveInitialMarkAsReadVisibility: true` is passed by `ChannelContextMenu.tsx:31` and `GuildContextMenu.tsx:26` but not by `CategoryContextMenu`. This matches `Open::mark_read` (`None` for a category). - The toast strings "Channel link copied" (`ChannelMenuData.tsx:95`), "Channel ID copied" (`:103`), "Category ID copied" (`CategoryMenuData.tsx:67`), "Link copied to clipboard" (`CommonMessageDescriptors.ts:395`) and "Copied to clipboard" (`TextCopyCommands`, guild ID) all match. - The desktop category menu draws the mute row last, after the data groups (`CategoryContextMenu.tsx:27-39`), as the golden does. 5. Review Focus: item 4 belongs to Tasks 17/18 (core). This UI keeps the core's order and separators and adds no rows. 6. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a clean review worktree: **all steps passed** (exit 0). **Findings** - minor: `open_model` puts "Mark as read" back at hard-coded group indices (guild group 0, channel group 1). This is correct for today's core builders, but it will silently break if the core's group layout changes. A shared constant or a core helper would be safer. Not blocking. - minor: if the target disappears while its menu is open (channel deleted, guild left), `over` draws nothing but `state.open` stays `Some` until the next Escape or open. Harmless. - minor: the plan lists `header.rs` under Modify, but the guild header trigger is in `sidebar.rs` (where the title is built). The behaviour is there, so this is fine. **Verdict: approve.** No blocking findings, and local CI is green.
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:43 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.