Daily use 30: Notification settings modal and the muted look (#519) #584

Closed
charles wants to merge 0 commits from dailyuse-30-ui-notification-settings-modal into dailyuse
Owner

Daily use 30, spec §3.4: the guild "Notification settings" modal and the muted look.

Stacked on: dailyuse-13-core-honour-mutes, dailyuse-29-ui-channel-guild-menus

What it does

  • screens/main/modals/notification_settings.rs: a copy of GuildNotificationSettingsModal.tsx. The guild and channel menus' "Notification settings" opens it. The store still gets OpenNotificationSettings and ignores it; the open guild is view state kept in Local::menus.notification_settings.
  • What the modal shows comes from fluxer_core::notif_settings::guild_settings_modal:
    • the "Mute {guildName}" switch with its description;
    • the "Community notification settings" radio group;
    • "Suppress @everyone and @here", "Suppress all role mentions" and "Mobile push notifications";
    • "Notification overrides": the "Select a channel or category" picker (categories first, then the other channels) and the desktop table. The table has the columns "Channel or category" / All / Mentions / Nothing / Mute and a "Remove override" X on the hovered row's right edge.
  • Each control sends SetGuildNotifications { guild: GuildKey::Guild(id), change }. Picking a channel that already has an override sends nothing, as handleAddOverride does.
  • Sizes come from GuildNotificationSettingsModal.module.css, Modal.module.css .root.medium (600 px), FormSwitch.module.css, RadioGroup.module.css and Checkbox.module.css.
  • Muted look:
    • A channel row or category header muted by its own override (isChannelDirectlyMuted) is drawn at 0.5 opacity (ChannelItem.module.css:272).
    • The new fields are ChannelItem::muted and SidebarSectionModel::category_muted, taken from the core sidebar sections of Daily use 13.
    • Hiding muted channels is already done in the core channel_tree.
  • Guild rail tooltip: a muted guild shows the filled BellSlash and "Muted" / "Muted until {datetime}" (GuildListItemTooltip.tsx:216-229, GuildsLayout.module.css .guildMuted*). It comes from GuildRailItem::muted through notif_settings::{muted_until, muted_text}. The guild icon is not dimmed, as in the original.
  • The "Notification overrides" category rows use a new Phosphor icon, Folder (fill, 2.1.10). BellSlash fill was already there.

Tests

  • crates/fluxer-ui/tests/notification_settings.rs:
    • modal_rows_bind_actions: the modal opens from both menus. Every control is checked for its action and checked state. The strings are checked as drawn. A headless click on "Only mentions" reaches the store.
    • override_picker_lists_channels_and_categories
    • muted_row_dimmed
    • tooltip_shows_muted_until
    • The store's clock is fixed at 11:50 UTC so that the READY's 15-minute mute of "Quiet corner" is still running.
  • Goldens notification_settings_modal and sidebar_muted_channels are in tests/screenshots.rs and fixtures/golden/, with references in docs/screenshots/ and rows in docs/screenshots/README.md. There is no Electron capture of this modal: the references are the native renders, and the dimensions come from the CSS files above.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally: all 129 goldens pass, including the Task 29 menu goldens. No desktop (FLUXER_DESKTOP_TESTS) tests apply to this task.

Deviations

  • Left out, as the spec says (owner 7): "Unread badges", which needs the advanced unread-badge option, and "Reply mention preference", which is saved through the member profile. Their parity rows are left for Task 40.
  • The picker is iced's pick_list, not a searchable combobox. Its entries are labelled by name, as selectOptions are.
  • Only the desktop (≥ 1024 px) table layout is drawn. The row's hover background is not drawn: it equals the card's background.
  • Iced cannot show part of an element's box outside its bounds, so the remove X does not stick out past the row. Each row and the header keep 12 px of right padding, and the X sits centred on the row's right edge inside that padding.
  • The mention badge of a muted row is drawn at full opacity. A muted row has no unread pill, because the core reports it as read.
  • Files outside the task's list, each changed minimally:
    • menus/mod.rs (Daily use 29): a notification_settings state field.
    • widgets/tooltip.rs: a new tooltip_with (a label with a line under it).
    • tests/headless/mod.rs: a placed() accessor that returns text bounds.
  • DM rows' muted (DmRowModel) is not drawn here: dms/mod.rs belongs to Tasks 31 and 32.

Closes #519

🤖 Generated with Claude Code

Daily use 30, spec §3.4: the guild "Notification settings" modal and the muted look. Stacked on: dailyuse-13-core-honour-mutes, dailyuse-29-ui-channel-guild-menus ## What it does - `screens/main/modals/notification_settings.rs`: a copy of `GuildNotificationSettingsModal.tsx`. The guild and channel menus' "Notification settings" opens it. The store still gets `OpenNotificationSettings` and ignores it; the open guild is view state kept in `Local::menus.notification_settings`. - What the modal shows comes from `fluxer_core::notif_settings::guild_settings_modal`: - the "Mute {guildName}" switch with its description; - the "Community notification settings" radio group; - "Suppress @everyone and @here", "Suppress all role mentions" and "Mobile push notifications"; - "Notification overrides": the "Select a channel or category" picker (categories first, then the other channels) and the desktop table. The table has the columns "Channel or category" / All / Mentions / Nothing / Mute and a "Remove override" X on the hovered row's right edge. - Each control sends `SetGuildNotifications { guild: GuildKey::Guild(id), change }`. Picking a channel that already has an override sends nothing, as `handleAddOverride` does. - Sizes come from `GuildNotificationSettingsModal.module.css`, `Modal.module.css` `.root.medium` (600 px), `FormSwitch.module.css`, `RadioGroup.module.css` and `Checkbox.module.css`. - Muted look: - A channel row or category header muted by its own override (`isChannelDirectlyMuted`) is drawn at 0.5 opacity (`ChannelItem.module.css:272`). - The new fields are `ChannelItem::muted` and `SidebarSectionModel::category_muted`, taken from the core sidebar sections of Daily use 13. - Hiding muted channels is already done in the core `channel_tree`. - Guild rail tooltip: a muted guild shows the filled BellSlash and "Muted" / "Muted until {datetime}" (`GuildListItemTooltip.tsx:216-229`, `GuildsLayout.module.css` `.guildMuted*`). It comes from `GuildRailItem::muted` through `notif_settings::{muted_until, muted_text}`. The guild icon is not dimmed, as in the original. - The "Notification overrides" category rows use a new Phosphor icon, `Folder` (fill, 2.1.10). BellSlash fill was already there. ## Tests - `crates/fluxer-ui/tests/notification_settings.rs`: - `modal_rows_bind_actions`: the modal opens from both menus. Every control is checked for its action and checked state. The strings are checked as drawn. A headless click on "Only mentions" reaches the store. - `override_picker_lists_channels_and_categories` - `muted_row_dimmed` - `tooltip_shows_muted_until` - The store's clock is fixed at 11:50 UTC so that the READY's 15-minute mute of "Quiet corner" is still running. - Goldens `notification_settings_modal` and `sidebar_muted_channels` are in `tests/screenshots.rs` and `fixtures/golden/`, with references in `docs/screenshots/` and rows in `docs/screenshots/README.md`. There is no Electron capture of this modal: the references are the native renders, and the dimensions come from the CSS files above. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally: all 129 goldens pass, including the Task 29 menu goldens. No desktop (`FLUXER_DESKTOP_TESTS`) tests apply to this task. ## Deviations - Left out, as the spec says (owner 7): "Unread badges", which needs the advanced unread-badge option, and "Reply mention preference", which is saved through the member profile. Their parity rows are left for Task 40. - The picker is iced's `pick_list`, not a searchable combobox. Its entries are labelled by name, as `selectOptions` are. - Only the desktop (≥ 1024 px) table layout is drawn. The row's hover background is not drawn: it equals the card's background. - Iced cannot show part of an element's box outside its bounds, so the remove X does not stick out past the row. Each row and the header keep 12 px of right padding, and the X sits centred on the row's right edge inside that padding. - The mention badge of a muted row is drawn at full opacity. A muted row has no unread pill, because the core reports it as read. - Files outside the task's list, each changed minimally: - `menus/mod.rs` (Daily use 29): a `notification_settings` state field. - `widgets/tooltip.rs`: a new `tooltip_with` (a label with a line under it). - `tests/headless/mod.rs`: a `placed()` accessor that returns text bounds. - DM rows' `muted` (`DmRowModel`) is not drawn here: `dms/mod.rs` belongs to Tasks 31 and 32. Closes #519 🤖 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>
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>
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>
Refs #519

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guild's "Notification settings" modal (GuildNotificationSettingsModal.tsx),
opened by the guild and channel menus; channels and categories muted by their
own override at half opacity (ChannelItem.module.css:272); the guild tooltip's
filled BellSlash and "Muted" / "Muted until {datetime}"
(GuildListItemTooltip.tsx:216-229).

Refs #519

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

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

Independent review: Daily use 30 (notification settings modal and the muted look)

Reviewed 67276ce..a3951d6 (3 commits, fluxer-ui only) cold, against plan Task 30, spec §3.4 and the fork.

Tests and interfaces

  • All four named tests exist and assert the right things: modal_rows_bind_actions (both menus open the modal; each control sends the right SetGuildNotifications change; the checked state follows the store; the original's strings are drawn; a real click on "Only mentions" reaches the store), override_picker_lists_channels_and_categories (categories first, then channels; Pick adds OverrideChange::Add; an existing override is left alone, as handleAddOverride does), muted_row_dimmed, and tooltip_shows_muted_until ("Muted until 11/14/2026, 12:05 PM" / "Muted"). Both goldens (notification_settings_modal, sidebar_muted_channels) are in screenshots.rs, with references in docs/screenshots/.
  • Interfaces: the modal of §3.4, rows dimmed to 0.5, the hidden muted channels (the Task 13 selector) and the rail tooltip with the filled BellSlash and "Muted" / "Muted until {datetime}" are all present. GuildRailItem::muted, ChannelItem::muted and SidebarSectionModel::category_muted are additive.

Invariants: the change is limited to fluxer-ui, with no new I/O path, no new dependency and no secrets. The modal never indexes server data unchecked (next() falls back, and an unknown guild gives None). Mute sends {muted} only, through the core's existing patch. The Task 13 core helpers (guild_settings_modal, muted_until, muted_text) are reused, not duplicated.

Parity spot-checks (fork GuildNotificationSettingsModal.tsx, .module.css, GuildListItemTooltip.tsx, ChannelItem.{tsx,module.css}):

  1. Section order, strings and the 2fr/1fr×4 table match. Checkbox state matches too: an INHERIT override shows the guild's resolved level. A new override is {INHERIT, muted:false}.
  2. The remove button shows only on hover in --status-danger, at 0.8 on hover, as in the ≥1024 px media query. It sits inside 12 px of padding instead of inset-inline-end:-0.75rem; the implementer noted this, and I accept it.
  3. The tooltip's mute line comes after the name with a 14 px filled BellSlash and 13 px text, and the text is Muted until {getFormattedDateTime}, as in UseGuildListItemState.ts:32.
  4. isChannelDirectlyMuted && channelItemMutedState also applies to category headers, which is what this branch does.

Findings

  • minor: .channelItemMutedState { color: var(--text-tertiary-muted); opacity: 0.5 } comes after .channelItemSelected in the stylesheet, so a selected (or connected) muted channel is --text-tertiary-muted at 0.5 in the original. Here row_color(bright) is only alpha-scaled, so that row draws --text-primary at 0.5. The unselected case, which the golden shows, is right. Fix is a one-line colour override in sidebar.rs channel_row.
  • minor: in the original, opacity: 0.5 on the row also dims its children (mention badge, voice user-count badge). Here only the icon, label and background are scaled, so a mention badge on a muted row stays at full opacity.
  • minor (noted by the implementer): the picker is pick_list, not the searchable Combobox. The Task 29 goldens now draw "releases" dimmed and stay within tolerance. Unread badges and Reply mention preference are left to owner 7, and the parity rows to Task 40. These are not findings for this task, but the combobox gap is worth a follow-up issue if it is not tracked yet.

CI: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree passed ("xtask ci: all steps passed", exit 0). The 4 new tests and both new goldens passed.

Verdict: approve. No blocking findings and CI is green; the minors can be done in a follow-up.

## Independent review: Daily use 30 (notification settings modal and the muted look) Reviewed `67276ce..a3951d6` (3 commits, fluxer-ui only) cold, against plan Task 30, spec §3.4 and the fork. **Tests and interfaces** - All four named tests exist and assert the right things: `modal_rows_bind_actions` (both menus open the modal; each control sends the right `SetGuildNotifications` change; the checked state follows the store; the original's strings are drawn; a real click on "Only mentions" reaches the store), `override_picker_lists_channels_and_categories` (categories first, then channels; Pick adds `OverrideChange::Add`; an existing override is left alone, as `handleAddOverride` does), `muted_row_dimmed`, and `tooltip_shows_muted_until` ("Muted until 11/14/2026, 12:05 PM" / "Muted"). Both goldens (`notification_settings_modal`, `sidebar_muted_channels`) are in `screenshots.rs`, with references in `docs/screenshots/`. - Interfaces: the modal of §3.4, rows dimmed to 0.5, the hidden muted channels (the Task 13 selector) and the rail tooltip with the filled BellSlash and "Muted" / "Muted until {datetime}" are all present. `GuildRailItem::muted`, `ChannelItem::muted` and `SidebarSectionModel::category_muted` are additive. **Invariants**: the change is limited to fluxer-ui, with no new I/O path, no new dependency and no secrets. The modal never indexes server data unchecked (`next()` falls back, and an unknown guild gives `None`). Mute sends `{muted}` only, through the core's existing patch. The Task 13 core helpers (`guild_settings_modal`, `muted_until`, `muted_text`) are reused, not duplicated. **Parity spot-checks** (fork `GuildNotificationSettingsModal.tsx`, `.module.css`, `GuildListItemTooltip.tsx`, `ChannelItem.{tsx,module.css}`): 1. Section order, strings and the 2fr/1fr×4 table match. Checkbox state matches too: an INHERIT override shows the guild's resolved level. A new override is `{INHERIT, muted:false}`. 2. The remove button shows only on hover in `--status-danger`, at 0.8 on hover, as in the ≥1024 px media query. It sits inside 12 px of padding instead of `inset-inline-end:-0.75rem`; the implementer noted this, and I accept it. 3. The tooltip's mute line comes after the name with a 14 px filled BellSlash and 13 px text, and the text is `Muted until {getFormattedDateTime}`, as in `UseGuildListItemState.ts:32`. 4. `isChannelDirectlyMuted && channelItemMutedState` also applies to category headers, which is what this branch does. **Findings** - **minor**: `.channelItemMutedState { color: var(--text-tertiary-muted); opacity: 0.5 }` comes after `.channelItemSelected` in the stylesheet, so a *selected* (or connected) muted channel is `--text-tertiary-muted` at 0.5 in the original. Here `row_color(bright)` is only alpha-scaled, so that row draws `--text-primary` at 0.5. The unselected case, which the golden shows, is right. Fix is a one-line colour override in `sidebar.rs` `channel_row`. - **minor**: in the original, `opacity: 0.5` on the row also dims its children (mention badge, voice user-count badge). Here only the icon, label and background are scaled, so a mention badge on a muted row stays at full opacity. - **minor (noted by the implementer)**: the picker is `pick_list`, not the searchable `Combobox`. The Task 29 goldens now draw "releases" dimmed and stay within tolerance. Unread badges and Reply mention preference are left to owner 7, and the parity rows to Task 40. These are not findings for this task, but the combobox gap is worth a `follow-up` issue if it is not tracked yet. **CI**: `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh review worktree passed ("xtask ci: all steps passed", exit 0). The 4 new tests and both new goldens passed. **Verdict: approve.** No blocking findings and CI is green; the minors can be done in a follow-up.
Author
Owner

Merged into dailyuse and textchat at 1089e6a1 (combined merge).

Merged into `dailyuse` and `textchat` at 1089e6a1 (combined merge).
charles closed this pull request 2026-11-15 09:58:51 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.