Daily use 12: core-notification-settings-mutes (#497) #557

Closed
charles wants to merge 0 commits from dailyuse-12-core-notification-settings-mutes into dailyuse
Owner

Stacked on: dailyuse-11b-core-state-skeleton

What

fluxer-core notification settings and mutes (plan Task 12; spec §3.2 mute submenu, §3.4, §6.2 "Mute state").

  • notif_settings::NotifSettings follows READY, USER_GUILD_SETTINGS_UPDATE and ApiResult::GuildSettingsPatched; each replaces the scope's entry whole, and changes that haven't been sent yet are applied on top. Mutes whose end_time has passed are dropped as they arrive (sanitizeGuildMute / sanitizeChannelMutes). Every mute still running gets an Effect::Schedule that unmutes it locally when it ends and writes nothing back. A timer for a mute that was replaced in the meantime does nothing.
  • UserAction::Mute / Unmute are written at once. A guild sends only {muted, mute_config}. A channel, category or DM sends the whole channel_overrides map, with null when the map is empty; DMs go to the @me scope. mute_config is {selected_time_window: ms, end_time}, or null for "Until I turn it back on" (§17 Q10).
  • UserAction::SetGuildNotifications (the modal) shows each change at once. The changes are merged and sent 3 s after the last one. An immediate write takes any waiting changes with it, as persistImmediately does. OverrideChange::Add does nothing when an override already exists; RemoveOverride drops the entry from the map.
  • When a write fails, the scope goes back to the server's last word, with the unsent changes on top.
  • Selectors:
    • is_muted: the channel's override, its parent's or its guild's; for a DM, its @me override.
    • muted_until: the target's own mute.
    • level: channel, then parent (guild channels only), then guild/@me. INHERIT and NULL are skipped; the default is ALL_MESSAGES.
    • guild_settings_modal(&App, guild) -> Option<NotifModalModel>: the original's labels, a picker with categories first, and the override rows sorted by position then id, with resolved columns and "No category".
    • muted_text: "Muted until 11/14/2026, 6:15 PM" (en-US getFormattedDateTime in the system offset) or "Muted".
  • menus::mute::item: when not muted, a "Mute …" submenu of the nine durations ("For 15 minutes" … "Until I turn it back on"), and clicking the row itself mutes until turned back on. When muted, one "Unmute …" row with the hint.

Tests

crates/fluxer-core/tests/notif_settings.rs contains every test the plan names, plus guild_settings_modal_rows and converge_example. It also has a proptest, writes_and_events_converge_to_server_state, that runs against a server model where scalars are partial and the override map is replaced. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally. I ran no desktop tests (none apply).

Deviations

  • Clock: the core had no wall clock, and computing end_time and expiry needs one. I added notif_settings::Clock { System, Fixed(Timestamp) }, which reads SystemTime, with NotifSettings::set_clock for tests. No new dependency. Daily use 14 (status expiry) could reuse it.
  • Outside the Files list (minimal changes):
    • app.rs now passes &self.channels to NotifSettings::reduce, because it needs the channel → guild mapping.
    • tests/dailyuse_ports.rs: the 11b stub assertions now skip Mute, Unmute and SetGuildNotifications. GuildSettingsPatched is only asserted not to write, and the mute row is now expected to have 9 items.
    • The fluxer-core README paragraph is updated.
  • Failure handling: the original only logs a failed write; there is no toast, so none is shown. The revert follows the plan.
  • Guild fallback level: the original falls back to the guild's default_message_notifications. The native Guild model has no such field, so the fallback is ALL_MESSAGES, as the plan says. Follow-up: #558.
  • guild_settings_modal returns Option<NotifModalModel> (the plan's interface says NotifModalModel): it is None for a guild the store does not know. Task 30 (the modal view) must handle None, e.g. by not opening the modal.
  • Matching answers to writes: GuildSettingsPatched carries no request id, so an answer retires the oldest write in flight for that scope. With two writes in flight, the first answer briefly hides the second write's optimistic change until its own answer arrives (transient; follow-up #559).

Closes #497

🤖 Generated with Claude Code

Stacked on: dailyuse-11b-core-state-skeleton ## What `fluxer-core` notification settings and mutes (plan Task 12; spec §3.2 mute submenu, §3.4, §6.2 "Mute state"). - `notif_settings::NotifSettings` follows `READY`, `USER_GUILD_SETTINGS_UPDATE` and `ApiResult::GuildSettingsPatched`; each replaces the scope's entry whole, and changes that haven't been sent yet are applied on top. Mutes whose `end_time` has passed are dropped as they arrive (`sanitizeGuildMute` / `sanitizeChannelMutes`). Every mute still running gets an `Effect::Schedule` that unmutes it locally when it ends and writes nothing back. A timer for a mute that was replaced in the meantime does nothing. - `UserAction::Mute` / `Unmute` are written at once. A guild sends only `{muted, mute_config}`. A channel, category or DM sends the **whole** `channel_overrides` map, with `null` when the map is empty; DMs go to the `@me` scope. `mute_config` is `{selected_time_window: ms, end_time}`, or `null` for "Until I turn it back on" (§17 Q10). - `UserAction::SetGuildNotifications` (the modal) shows each change at once. The changes are merged and sent 3 s after the last one. An immediate write takes any waiting changes with it, as `persistImmediately` does. `OverrideChange::Add` does nothing when an override already exists; `RemoveOverride` drops the entry from the map. - When a write fails, the scope goes back to the server's last word, with the unsent changes on top. - Selectors: - `is_muted`: the channel's override, its parent's or its guild's; for a DM, its `@me` override. - `muted_until`: the target's own mute. - `level`: channel, then parent (guild channels only), then guild/`@me`. INHERIT and NULL are skipped; the default is ALL_MESSAGES. - `guild_settings_modal(&App, guild) -> Option<NotifModalModel>`: the original's labels, a picker with categories first, and the override rows sorted by position then id, with resolved columns and "No category". - `muted_text`: "Muted until 11/14/2026, 6:15 PM" (en-US `getFormattedDateTime` in the system offset) or "Muted". - `menus::mute::item`: when not muted, a "Mute …" submenu of the nine durations ("For 15 minutes" … "Until I turn it back on"), and clicking the row itself mutes until turned back on. When muted, one "Unmute …" row with the hint. ## Tests `crates/fluxer-core/tests/notif_settings.rs` contains every test the plan names, plus `guild_settings_modal_rows` and `converge_example`. It also has a proptest, `writes_and_events_converge_to_server_state`, that runs against a server model where scalars are partial and the override map is replaced. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally. I ran no desktop tests (none apply). ## Deviations - **Clock:** the core had no wall clock, and computing `end_time` and expiry needs one. I added `notif_settings::Clock { System, Fixed(Timestamp) }`, which reads `SystemTime`, with `NotifSettings::set_clock` for tests. No new dependency. Daily use 14 (status expiry) could reuse it. - **Outside the Files list (minimal changes):** - `app.rs` now passes `&self.channels` to `NotifSettings::reduce`, because it needs the channel → guild mapping. - `tests/dailyuse_ports.rs`: the 11b stub assertions now skip Mute, Unmute and SetGuildNotifications. `GuildSettingsPatched` is only asserted not to write, and the mute row is now expected to have 9 items. - The fluxer-core README paragraph is updated. - **Failure handling:** the original only logs a failed write; there is no toast, so none is shown. The revert follows the plan. - **Guild fallback level:** the original falls back to the guild's `default_message_notifications`. The native `Guild` model has no such field, so the fallback is ALL_MESSAGES, as the plan says. Follow-up: #558. - **`guild_settings_modal` returns `Option<NotifModalModel>`** (the plan's interface says `NotifModalModel`): it is `None` for a guild the store does not know. Task 30 (the modal view) must handle `None`, e.g. by not opening the modal. - **Matching answers to writes:** `GuildSettingsPatched` carries no request id, so an answer retires the oldest write in flight for that scope. With two writes in flight, the first answer briefly hides the second write's optimistic change until its own answer arrives (transient; follow-up #559). Closes #497 🤖 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>
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>
Author
Owner

Independent review: Daily use 12 (diff a1a50d0..b9a14eb)

Local gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree: green (exit 0).

What I checked: every plan-named test exists in crates/fluxer-core/tests/notif_settings.rs and asserts the spec values (900 000 ms / 18:15 end for 15 min, {"muted":false,"mute_config":null}, the whole override map with untouched overrides byte-equal, @me scope, null config for Forever, no write on expiry, 3 s debounce with merge, revert, the nine labels). Review Focus 1 (whole channel_overrides map) holds and is tested. No new fixtures, no I/O or forbidden crates in fluxer-core. Parity spot checks against the fork, all matching: MuteOptions.ts createMuteConfig (ms plus ISO end), UserGuildSettingsCommands.ts scheduleUpdate (an immediate write takes the waiting payload with it; a failure is only logged, so not adding a toast is right and spec §6.2's "error toast" does not exist), UserGuildSettings.ts:355-435 (isMutedAtAnyLevel, resolveEffectiveMessageNotifications), GuildNotificationSettingsModal.tsx:282-305,470-623 (sort by position then id, unknown channels skipped, INHERIT rows show the guild level), MuteTargetMenuItem.tsx (the parent row mutes indefinitely).

Findings

  1. BLOCKING: server data can panic the client. notif_settings.rs format_date_time calls at.as_offset_date_time().to_offset(offset). time 0.3 panics when the shifted date falls outside year 9999, and Timestamp accepts any end up to 9999-12-31T23:59:59.999Z. Example: a mute end_time of 9999-12-31T23:30:00Z (sent by the server or another client) with a positive utc_offset. The mute stays active (end > now), so menus::mute::item (and Task 30's tooltip) calls muted_text, and that panics. I confirmed the to_offset panic with a throwaway test. Everything else in the codebase uses checked_to_offset(offset).unwrap_or(utc) (selectors/messages.rs:94, message_row.rs:273). Fix: do the same, and add a test with a year-9999 end_time and offset +01:00.
  2. minor (interface): the plan declares guild_settings_modal(&App, guild) -> NotifModalModel, but the code returns Option<NotifModalModel> (None for an unknown guild). The choice is reasonable, and Task 30 builds against the code. Please note this in the PR body so Task 30 doesn't follow the plan's signature.
  3. minor (parity, follow-up): the guild level falls back to ALL_MESSAGES. The original uses guild.effectiveMessageNotifications (Guild.ts:408-416: the guild's default_message_notifications, or ONLY_MENTIONS for large guilds). The spec and plan both say ALL_MESSAGES, so this isn't blocking here. But the proto Guild drops default_message_notifications, so Task 13's notifications will over-notify in guilds whose default is mentions-only. Suggest a follow-up issue (proto field plus fallback).
  4. minor (test): event_replaces_guild_settings has assert!(!is_muted(&app, STAFF) || stored(..).muted), which is always true because the fixture guild is muted. It checks nothing. Replace it with muted_until(Channel(STAFF)) == None.
  5. minor: GuildSettingsPatched retires the oldest in-flight write of its scope and replaces the shown settings. With two writes in flight, the first answer briefly hides the second write's change until its own answer arrives. This is transient and the proptest shows convergence. Noting it only.

Verdict: changes requested. One blocking finding (1); CI green.

## Independent review: Daily use 12 (diff a1a50d0..b9a14eb) Local gate: `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh review worktree: **green** (exit 0). What I checked: every plan-named test exists in `crates/fluxer-core/tests/notif_settings.rs` and asserts the spec values (900 000 ms / 18:15 end for 15 min, `{"muted":false,"mute_config":null}`, the whole override map with untouched overrides byte-equal, `@me` scope, null config for Forever, no write on expiry, 3 s debounce with merge, revert, the nine labels). Review Focus 1 (whole `channel_overrides` map) holds and is tested. No new fixtures, no I/O or forbidden crates in fluxer-core. Parity spot checks against the fork, all matching: `MuteOptions.ts` `createMuteConfig` (ms plus ISO end), `UserGuildSettingsCommands.ts` `scheduleUpdate` (an immediate write takes the waiting payload with it; a failure is only logged, so not adding a toast is right and spec §6.2's "error toast" does not exist), `UserGuildSettings.ts:355-435` (`isMutedAtAnyLevel`, `resolveEffectiveMessageNotifications`), `GuildNotificationSettingsModal.tsx:282-305,470-623` (sort by position then id, unknown channels skipped, INHERIT rows show the guild level), `MuteTargetMenuItem.tsx` (the parent row mutes indefinitely). ### Findings 1. **BLOCKING: server data can panic the client.** `notif_settings.rs` `format_date_time` calls `at.as_offset_date_time().to_offset(offset)`. `time` 0.3 panics when the shifted date falls outside year 9999, and `Timestamp` accepts any end up to `9999-12-31T23:59:59.999Z`. Example: a mute `end_time` of `9999-12-31T23:30:00Z` (sent by the server or another client) with a positive `utc_offset`. The mute stays active (end > now), so `menus::mute::item` (and Task 30's tooltip) calls `muted_text`, and that panics. I confirmed the `to_offset` panic with a throwaway test. Everything else in the codebase uses `checked_to_offset(offset).unwrap_or(utc)` (`selectors/messages.rs:94`, `message_row.rs:273`). Fix: do the same, and add a test with a year-9999 `end_time` and offset +01:00. 2. minor (interface): the plan declares `guild_settings_modal(&App, guild) -> NotifModalModel`, but the code returns `Option<NotifModalModel>` (`None` for an unknown guild). The choice is reasonable, and Task 30 builds against the code. Please note this in the PR body so Task 30 doesn't follow the plan's signature. 3. minor (parity, follow-up): the guild level falls back to ALL_MESSAGES. The original uses `guild.effectiveMessageNotifications` (`Guild.ts:408-416`: the guild's `default_message_notifications`, or ONLY_MENTIONS for large guilds). The spec and plan both say ALL_MESSAGES, so this isn't blocking here. But the proto `Guild` drops `default_message_notifications`, so Task 13's notifications will over-notify in guilds whose default is mentions-only. Suggest a `follow-up` issue (proto field plus fallback). 4. minor (test): `event_replaces_guild_settings` has `assert!(!is_muted(&app, STAFF) || stored(..).muted)`, which is always true because the fixture guild is muted. It checks nothing. Replace it with `muted_until(Channel(STAFF)) == None`. 5. minor: `GuildSettingsPatched` retires the oldest in-flight write of its scope and replaces the shown settings. With two writes in flight, the first answer briefly hides the second write's change until its own answer arrives. This is transient and the proptest shows convergence. Noting it only. **Verdict: changes requested.** One blocking finding (1); CI green.
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>
Author
Owner

Review round 1 addressed in 44794a8.

  • Blocking: format_date_time panic. It now uses checked_to_offset(offset).unwrap_or(utc), like the rest of the codebase. The new unit test notif_settings::tests::format_date_time_past_year_9999_does_not_panic failed first with "local datetime out of valid range". It covers an end of 9999-12-31T23:30Z read at +02:00, which falls back to UTC, and at -02:00.
  • Minor: guild_settings_modal returns Option. The PR body now says so under Deviations, for Task 30: it returns None for an unknown guild.
  • Minor: guild fallback level. Follow-up #558: a proto field for default_message_notifications and large-guild ONLY_MENTIONS, then the fallback. It is linked from the PR body.
  • Minor: always-true assertion in event_replaces_guild_settings. It now asserts that the stored guild entry no longer has the local STAFF override.
  • Minor: two in-flight writes. Follow-up #559 (transient, the store converges). It is linked from the PR body.

FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally.

🤖 Generated with Claude Code

Review round 1 addressed in 44794a8. - **Blocking: `format_date_time` panic.** It now uses `checked_to_offset(offset).unwrap_or(utc)`, like the rest of the codebase. The new unit test `notif_settings::tests::format_date_time_past_year_9999_does_not_panic` failed first with "local datetime out of valid range". It covers an end of 9999-12-31T23:30Z read at +02:00, which falls back to UTC, and at -02:00. - **Minor: `guild_settings_modal` returns `Option`.** The PR body now says so under Deviations, for Task 30: it returns `None` for an unknown guild. - **Minor: guild fallback level.** Follow-up #558: a proto field for `default_message_notifications` and large-guild ONLY_MENTIONS, then the fallback. It is linked from the PR body. - **Minor: always-true assertion in `event_replaces_guild_settings`.** It now asserts that the stored guild entry no longer has the local STAFF override. - **Minor: two in-flight writes.** Follow-up #559 (transient, the store converges). It is linked from the PR body. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

Independent review (round 2): Daily use 12 (diff a1a50d0..44794a8)

Local gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree (du-review-12, its own target dir): green (exit 0, "all steps passed").

What I checked:

  • Plan tests. All 12 tests the plan names are in crates/fluxer-core/tests/notif_settings.rs and assert the spec's values: 15 min = selected_time_window 900 000 and end_time 18:15Z; a guild mute sends only {muted, mute_config}; the whole override map is sent with the untouched overrides byte-equal; DMs go to @me; Forever sends mute_config: null and no timer; an expiry writes nothing and a stale timer is a no-op; expired mutes are dropped on READY; channel → category → guild inheritance with INHERIT/NULL skipped; the event and the answer replace the entry; a 3 s debounce with merge, and an immediate write that takes the pending changes; failure reverts; the nine labels, the row-click Forever, and the "Muted until 11/14/2026, 6:15 PM" / "Muted" hints. The proptest writes_and_events_converge_to_server_state runs against a server model that replaces the map whole.
  • Round-1 fix. format_date_time now uses checked_to_offset(offset).unwrap_or(utc), and the unit test covers 9999-12-31T23:30Z at ±02:00. The event_replaces_guild_settings assertion is no longer always true. #558 and #559 exist (label follow-up, milestone Daily use) and are linked from the body.
  • Interfaces. MuteTarget/MuteDuration writes, is_muted, muted_until, level and menus::mute::item(&App, MuteTarget, &str) -> MenuItem match the plan. guild_settings_modal returns Option<NotifModalModel>, and the PR body records that for Task 30.
  • Invariants. No new dependency, fixture or I/O in fluxer-core. The override round-trip keeps unread_badges/flags (the map comes from the stored entry). The far-future end_time → Effect::Schedule path is safe: tokio::time::sleep clamps it. No secrets.
  • Parity spot checks against the fork, all matching: MuteOptions.ts createMuteConfig; TimeWindowPresets.ts:82-139 and the "For {n} hour(s)" strings; OverlayContextMenu.tsx:163-174 getMutedText; MuteTargetMenuItem.tsx (parent row = indefinite); the own-level isMuted of ChannelMenuItems.tsx:181, CategoryMenuItems.tsx:23 and GuildMenuItems.tsx:39; UserGuildSettings.ts:356-435 (isMutedAtAnyLevel, resolveEffectiveMessageNotifications); the GuildNotificationSettingsModal.tsx:258-281 handlers (Add is a no-op when the override exists; the override mute sends {muted} only).
  • Review Focus 1 (the whole channel_overrides map, never clobbered) holds and is tested.

Findings

  1. minor (parity, not in the spec): in the original, a category mute from the menu also writes collapsed: true and is debounced rather than immediate (CategoryMenuItems.tsx:26-36, no persistImmediately). The native client mutes the category at once and leaves it expanded. Spec §3.2 doesn't mention the collapse, so this doesn't block here. I suggest a follow-up issue, perhaps folded into Task 17, which owns collapsing.
  2. minor (parity edge): the original's isWholeGuildMuted(null) also treats a top-level muted in the @me scope as muting every DM (UserGuildSettings.ts:356-358, 401-407). The native is_muted for a DM reads only the DM's override. No UI surface sets the @me top-level mute, so the practical impact is nil. Worth a line in #558 or its own follow-up.
  3. minor (note): notif_settings::Clock::System is the first wall-clock read in fluxer-core. It isn't I/O, and tests fix it with set_clock. Task 14 (status expiry, "today at 14:30") should reuse it rather than add a second clock.

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

🤖 Generated with Claude Code

## Independent review (round 2): Daily use 12 (diff a1a50d0..44794a8) Local gate: `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh review worktree (`du-review-12`, its own target dir): **green** (exit 0, "all steps passed"). What I checked: - **Plan tests.** All 12 tests the plan names are in `crates/fluxer-core/tests/notif_settings.rs` and assert the spec's values: 15 min = `selected_time_window` 900 000 and `end_time` 18:15Z; a guild mute sends only `{muted, mute_config}`; the whole override map is sent with the untouched overrides byte-equal; DMs go to `@me`; Forever sends `mute_config: null` and no timer; an expiry writes nothing and a stale timer is a no-op; expired mutes are dropped on READY; channel → category → guild inheritance with INHERIT/NULL skipped; the event and the answer replace the entry; a 3 s debounce with merge, and an immediate write that takes the pending changes; failure reverts; the nine labels, the row-click Forever, and the "Muted until 11/14/2026, 6:15 PM" / "Muted" hints. The proptest `writes_and_events_converge_to_server_state` runs against a server model that replaces the map whole. - **Round-1 fix.** `format_date_time` now uses `checked_to_offset(offset).unwrap_or(utc)`, and the unit test covers 9999-12-31T23:30Z at ±02:00. The `event_replaces_guild_settings` assertion is no longer always true. #558 and #559 exist (label `follow-up`, milestone Daily use) and are linked from the body. - **Interfaces.** `MuteTarget`/`MuteDuration` writes, `is_muted`, `muted_until`, `level` and `menus::mute::item(&App, MuteTarget, &str) -> MenuItem` match the plan. `guild_settings_modal` returns `Option<NotifModalModel>`, and the PR body records that for Task 30. - **Invariants.** No new dependency, fixture or I/O in fluxer-core. The override round-trip keeps `unread_badges`/`flags` (the map comes from the stored entry). The far-future `end_time` → `Effect::Schedule` path is safe: `tokio::time::sleep` clamps it. No secrets. - **Parity spot checks** against the fork, all matching: `MuteOptions.ts` `createMuteConfig`; `TimeWindowPresets.ts:82-139` and the "For {n} hour(s)" strings; `OverlayContextMenu.tsx:163-174` `getMutedText`; `MuteTargetMenuItem.tsx` (parent row = indefinite); the own-level `isMuted` of `ChannelMenuItems.tsx:181`, `CategoryMenuItems.tsx:23` and `GuildMenuItems.tsx:39`; `UserGuildSettings.ts:356-435` (`isMutedAtAnyLevel`, `resolveEffectiveMessageNotifications`); the `GuildNotificationSettingsModal.tsx:258-281` handlers (Add is a no-op when the override exists; the override mute sends `{muted}` only). - **Review Focus 1** (the whole `channel_overrides` map, never clobbered) holds and is tested. ### Findings 1. **minor (parity, not in the spec):** in the original, a category mute from the menu also writes `collapsed: true` and is debounced rather than immediate (`CategoryMenuItems.tsx:26-36`, no `persistImmediately`). The native client mutes the category at once and leaves it expanded. Spec §3.2 doesn't mention the collapse, so this doesn't block here. I suggest a `follow-up` issue, perhaps folded into Task 17, which owns collapsing. 2. **minor (parity edge):** the original's `isWholeGuildMuted(null)` also treats a top-level `muted` in the `@me` scope as muting every DM (`UserGuildSettings.ts:356-358, 401-407`). The native `is_muted` for a DM reads only the DM's override. No UI surface sets the `@me` top-level mute, so the practical impact is nil. Worth a line in #558 or its own follow-up. 3. **minor (note):** `notif_settings::Clock::System` is the first wall-clock read in fluxer-core. It isn't I/O, and tests fix it with `set_clock`. Task 14 (status expiry, "today at 14:30") should reuse it rather than add a second clock. **Verdict: approve.** No blocking findings, and the local CI is green. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

Independent review, round 3: Daily use 12 (44794a8)

I read the diff a1a50d0..44794a8 without relying on the earlier reviews.

Tests (plan Step 1): all 12 named tests exist and assert what the plan says, with the spec's values: 900 000 / 3 600 000 ms windows, ISO end_time, the whole channel_overrides map (4 entries, the others sent unchanged), {muted, mute_config} only for a guild, the @me scope for DMs, mute_config: null for Forever, the 3 s debounce with merging and immediate writes taking pending changes, revert on failure, the nine labels with the "Muted until 11/14/2026, 6:15 PM" and "Muted" hints, and the convergence proptest. There is also a year-9999 no-panic unit test.

Interfaces: MuteTarget, MuteDuration, GuildNotifChange and OverrideChange are used as Task 11a defined them. is_muted, muted_until, level and menus::mute::item(&App, MuteTarget, &str) -> MenuItem match the plan. guild_settings_modal returns Option<NotifModalModel>, which differs from the plan but is listed in the PR (see below).

Invariants: no forbidden dependencies and no I/O in fluxer-core. No new fixtures. ChannelOverride keeps unread_badges and flags, so a whole-map write does not clear them (Review Focus 1 holds for this task). Time arithmetic saturates or is checked, so server data cannot cause a panic. No secrets.

Parity, checked against fluxer-soundboard:

  • TimeWindowPresets.ts BASE_PRESETS give 15m/30m/1h/3h/4h/8h/24h/3d/never, and "For {oneHour} hour" is singular. Matches.
  • MuteOptions.ts createMuteConfig uses ms and now + value ISO. Matches.
  • UserGuildSettings.ts:401-435: isMutedAtAnyLevel checks guild, then parent, then channel; resolveEffectiveMessageNotifications skips NULL/INHERIT. Matches.
  • UserGuildSettingsCommands.ts scheduleUpdate resets a 3 s timer on each change, and an immediate write cancels the timer and flushes the merged payload. Matches.
  • GuildNotificationSettingsModal.tsx:296-305 sorts by position, then by id string. Matches.

Findings (none blocking):

  • minor: guild_settings_modal returns Option<NotifModalModel> instead of NotifModalModel (documented). Task 30 must handle None.
  • minor: notif_settings::Clock::System reads SystemTime::now(). No other fluxer-core module does; they derive "now" from data. It is injectable and the tests fix it. However, fixtures/gateway/dailyuse_ready.json:705 has a mute ending 2026-11-14T12:02Z, so with the default clock any devserver or screenshot run from today on drops that mute on READY. Tasks 26a, 28 and 30 should set Clock::Fixed (or have the runtime supply the time) wherever they rely on that mute.
  • minor (parity, follow-up): the original's isMutedAtAnyLevel(null, …) also honours a top-level @me mute (isWholeGuildMuted(null)). Native is_muted for DMs reads only the override. The spec's §6.2 wording allows this, but it still needs a follow-up issue, as round 2 noted.
  • minor: overrides for channels the client does not know are left out of the modal table. The original sorts them last but has no channel to show either. No action needed.
  • Existing follow-ups #558 and #559 confirmed relevant.

CI: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci at 44794a8 in a fresh worktree (du-review-12): all steps passed (livekit-interop skipped as usual).

Verdict: APPROVED (0 blocking).

## Independent review, round 3: Daily use 12 (44794a8) I read the diff `a1a50d0..44794a8` without relying on the earlier reviews. **Tests (plan Step 1):** all 12 named tests exist and assert what the plan says, with the spec's values: 900 000 / 3 600 000 ms windows, ISO `end_time`, the whole `channel_overrides` map (4 entries, the others sent unchanged), `{muted, mute_config}` only for a guild, the `@me` scope for DMs, `mute_config: null` for Forever, the 3 s debounce with merging and immediate writes taking pending changes, revert on failure, the nine labels with the "Muted until 11/14/2026, 6:15 PM" and "Muted" hints, and the convergence proptest. There is also a year-9999 no-panic unit test. **Interfaces:** `MuteTarget`, `MuteDuration`, `GuildNotifChange` and `OverrideChange` are used as Task 11a defined them. `is_muted`, `muted_until`, `level` and `menus::mute::item(&App, MuteTarget, &str) -> MenuItem` match the plan. `guild_settings_modal` returns `Option<NotifModalModel>`, which differs from the plan but is listed in the PR (see below). **Invariants:** no forbidden dependencies and no I/O in fluxer-core. No new fixtures. `ChannelOverride` keeps `unread_badges` and `flags`, so a whole-map write does not clear them (Review Focus 1 holds for this task). Time arithmetic saturates or is checked, so server data cannot cause a panic. No secrets. **Parity, checked against fluxer-soundboard:** - `TimeWindowPresets.ts` BASE_PRESETS give 15m/30m/1h/3h/4h/8h/24h/3d/never, and "For {oneHour} hour" is singular. Matches. - `MuteOptions.ts` `createMuteConfig` uses ms and `now + value` ISO. Matches. - `UserGuildSettings.ts:401-435`: `isMutedAtAnyLevel` checks guild, then parent, then channel; `resolveEffectiveMessageNotifications` skips NULL/INHERIT. Matches. - `UserGuildSettingsCommands.ts` `scheduleUpdate` resets a 3 s timer on each change, and an immediate write cancels the timer and flushes the merged payload. Matches. - `GuildNotificationSettingsModal.tsx:296-305` sorts by position, then by id string. Matches. **Findings (none blocking):** - minor: `guild_settings_modal` returns `Option<NotifModalModel>` instead of `NotifModalModel` (documented). Task 30 must handle `None`. - minor: `notif_settings::Clock::System` reads `SystemTime::now()`. No other fluxer-core module does; they derive "now" from data. It is injectable and the tests fix it. However, `fixtures/gateway/dailyuse_ready.json:705` has a mute ending `2026-11-14T12:02Z`, so with the default clock any devserver or screenshot run from today on drops that mute on READY. Tasks 26a, 28 and 30 should set `Clock::Fixed` (or have the runtime supply the time) wherever they rely on that mute. - minor (parity, follow-up): the original's `isMutedAtAnyLevel(null, …)` also honours a top-level `@me` mute (`isWholeGuildMuted(null)`). Native `is_muted` for DMs reads only the override. The spec's §6.2 wording allows this, but it still needs a follow-up issue, as round 2 noted. - minor: overrides for channels the client does not know are left out of the modal table. The original sorts them last but has no channel to show either. No action needed. - Existing follow-ups #558 and #559 confirmed relevant. **CI:** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` at 44794a8 in a fresh worktree (du-review-12): **all steps passed** (livekit-interop skipped as usual). **Verdict: APPROVED** (0 blocking).
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:56 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.