Daily use 11a: core daily-use ports (#495) #553

Closed
charles wants to merge 0 commits from dailyuse-11a-core-dailyuse-ports into dailyuse
Owner

What

Daily use 11a lands every port the later core tasks fill, so that after it no task edits event.rs or effect.rs except to fill a stub.

  • UserAction: every variant of the plan's Interfaces block (mutes, guild notification modal, hide muted, category/guild mark read, status and custom status, Friend { action, surface, confirmed }, friends page, Invite(InviteAction), AddGuild(AddGuildAction), leave guild/group, pin/close DM, copy ID/link, collapse, default hide-muted, Switcher, Navigate, Report, profile modal and notes, attachment actions, MentionUser, NotificationClicked, seek/rate, DismissModerationFailure), with their payload types (MuteTarget, MuteDuration + ALL, GuildKey, GuildNotifChange/OverrideChange, StatusDuration + ALL, CustomStatusDraft, FriendAction, FriendSurface, FriendsTab, InviteAction, InviteSettings (default 7 days / no limit), AddGuildAction/AddGuildStep, IdKind, SwitcherAction, Dir, NavAction, ReportAction, ProfileTab, MediaItem) in event.rs, re-exported from the crate root. MarkRead and CloseConfirm unchanged.
  • CoreEvent::Idle(IdleState { idle_for }); Effect::Window(WindowCommand::Raise); Notification.icon: Option<Url> (always None).
  • ApiRequest/ApiResult for every endpoint of Daily use 4 and 5 (guild settings, read-states ack, relationship verbs, invites, create/leave guild, leave group DM -> existing ChannelClosed, report flow/submission/legacy, notes, DM pin). The runtime answers each with 501 CLIENT_NOT_WIRED; Effect::Window is logged and ignored (both until Daily use 28).
  • chat::Confirm gains Relationship { action: RelationshipConfirm, user_id }, OpenBlockedDm, CloseDm, LeaveGroup, LeaveGuild, DeleteAttachment; all close with CloseConfirm. The UI confirm modal draws none of them (until Daily use 33).
  • fluxer_core::menus: MenuModel, MenuItem (+ action, with_danger, with_hint), MenuItemKind::{Action, Toggle, Submenu, Disabled}, MenuItemId (a kebab-case name, Cow<'static, str>), MenuRow, MenuModel::flatten() / is_empty().
  • README: "Daily use ports" section.

Tests

crates/fluxer-core/tests/dailyuse_ports.rs: menu_flatten_drops_empty_groups_and_separators, new_confirm_variants_close_with_close_confirm, new_actions_are_ignored_until_implemented (every new action and the new events/answers emit nothing), existing_tests_untouched (MarkRead, CloseConfirm, MessageUser, CloseDm as before), plus mute_and_status_durations_in_menu_order and notification_icon_and_window_raise_exist. Written first and seen failing (commit 935a0d9). FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally. No desktop (FLUXER_DESKTOP_TESTS=1) test applies.

Deviations from the plan

  • UserAction::MessageUser(Snowflake) and CloseDm(Snowflake) existed with tuple shapes; the plan reshapes them to { user_id, confirmed } / { channel_id, confirmed }. Callers and the existing tests that construct them (core chat_dms, chat_ports, profiles; ui dms, profile_popout; app profile) and Notification literals (core notifications, platform example/tests/unit test, runtime unit test) were updated mechanically; no assertion changed.
  • Outside the Files list, to compile: CoreEvent::Idle arms in messages.rs/session.rs (exhaustive matches), the two pattern updates in chat/dms.rs/profiles.rs, a RelationshipConfirm pub use in chat/mod.rs, the UI callers above, icon: None in fluxer-platform.
  • Added beyond the Interfaces block (close actions for core-held modals so later tasks need not edit event.rs): UserAction::CloseStatusPopout, CloseProfileModal, InviteAction::Close, AddGuildAction::{Open(AddGuildStep), Back, Close, SetName, SetIcon, Create, SetInviteLink, Join} (the plan names only the type), GuildNotifChange::Override { channel_id, change: OverrideChange::{Add, Level, Mute} } for the plan's level|mute.
  • GuildKey is defined in core (same as fluxer_api::GuildKey, which core cannot depend on). ApiRequest::CreateGuild { name, icon: Option<FileRef> } carries the file (like EditGroupDmIcon) rather than a data URI.
  • MenuItemId is a string newtype rather than an enum, so the builder tasks (17, 18) can name their rows without editing menus/mod.rs.

Closes #495

🤖 Generated with Claude Code

## What Daily use 11a lands every port the later core tasks fill, so that after it no task edits `event.rs` or `effect.rs` except to fill a stub. - `UserAction`: every variant of the plan's Interfaces block (mutes, guild notification modal, hide muted, category/guild mark read, status and custom status, `Friend { action, surface, confirmed }`, friends page, `Invite(InviteAction)`, `AddGuild(AddGuildAction)`, leave guild/group, pin/close DM, copy ID/link, collapse, default hide-muted, `Switcher`, `Navigate`, `Report`, profile modal and notes, attachment actions, `MentionUser`, `NotificationClicked`, seek/rate, `DismissModerationFailure`), with their payload types (`MuteTarget`, `MuteDuration` + `ALL`, `GuildKey`, `GuildNotifChange`/`OverrideChange`, `StatusDuration` + `ALL`, `CustomStatusDraft`, `FriendAction`, `FriendSurface`, `FriendsTab`, `InviteAction`, `InviteSettings` (default 7 days / no limit), `AddGuildAction`/`AddGuildStep`, `IdKind`, `SwitcherAction`, `Dir`, `NavAction`, `ReportAction`, `ProfileTab`, `MediaItem`) in `event.rs`, re-exported from the crate root. `MarkRead` and `CloseConfirm` unchanged. - `CoreEvent::Idle(IdleState { idle_for })`; `Effect::Window(WindowCommand::Raise)`; `Notification.icon: Option<Url>` (always `None`). - `ApiRequest`/`ApiResult` for every endpoint of Daily use 4 and 5 (guild settings, read-states ack, relationship verbs, invites, create/leave guild, leave group DM -> existing `ChannelClosed`, report flow/submission/legacy, notes, DM pin). The runtime answers each with 501 `CLIENT_NOT_WIRED`; `Effect::Window` is logged and ignored (both until Daily use 28). - `chat::Confirm` gains `Relationship { action: RelationshipConfirm, user_id }`, `OpenBlockedDm`, `CloseDm`, `LeaveGroup`, `LeaveGuild`, `DeleteAttachment`; all close with `CloseConfirm`. The UI confirm modal draws none of them (until Daily use 33). - `fluxer_core::menus`: `MenuModel`, `MenuItem` (+ `action`, `with_danger`, `with_hint`), `MenuItemKind::{Action, Toggle, Submenu, Disabled}`, `MenuItemId` (a kebab-case name, `Cow<'static, str>`), `MenuRow`, `MenuModel::flatten()` / `is_empty()`. - README: "Daily use ports" section. ## Tests `crates/fluxer-core/tests/dailyuse_ports.rs`: `menu_flatten_drops_empty_groups_and_separators`, `new_confirm_variants_close_with_close_confirm`, `new_actions_are_ignored_until_implemented` (every new action and the new events/answers emit nothing), `existing_tests_untouched` (MarkRead, CloseConfirm, MessageUser, CloseDm as before), plus `mute_and_status_durations_in_menu_order` and `notification_icon_and_window_raise_exist`. Written first and seen failing (commit 935a0d9). `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally. No desktop (`FLUXER_DESKTOP_TESTS=1`) test applies. ## Deviations from the plan - `UserAction::MessageUser(Snowflake)` and `CloseDm(Snowflake)` existed with tuple shapes; the plan reshapes them to `{ user_id, confirmed }` / `{ channel_id, confirmed }`. Callers and the existing tests that construct them (core `chat_dms`, `chat_ports`, `profiles`; ui `dms`, `profile_popout`; app `profile`) and `Notification` literals (core `notifications`, platform example/tests/unit test, runtime unit test) were updated mechanically; no assertion changed. - Outside the Files list, to compile: `CoreEvent::Idle` arms in `messages.rs`/`session.rs` (exhaustive matches), the two pattern updates in `chat/dms.rs`/`profiles.rs`, a `RelationshipConfirm` `pub use` in `chat/mod.rs`, the UI callers above, `icon: None` in `fluxer-platform`. - Added beyond the Interfaces block (close actions for core-held modals so later tasks need not edit `event.rs`): `UserAction::CloseStatusPopout`, `CloseProfileModal`, `InviteAction::Close`, `AddGuildAction::{Open(AddGuildStep), Back, Close, SetName, SetIcon, Create, SetInviteLink, Join}` (the plan names only the type), `GuildNotifChange::Override { channel_id, change: OverrideChange::{Add, Level, Mute} }` for the plan's `level|mute`. - `GuildKey` is defined in core (same as `fluxer_api::GuildKey`, which core cannot depend on). `ApiRequest::CreateGuild { name, icon: Option<FileRef> }` carries the file (like `EditGroupDmIcon`) rather than a data URI. - `MenuItemId` is a string newtype rather than an enum, so the builder tasks (17, 18) can name their rows without editing `menus/mod.rs`. Closes #495 🤖 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>
Author
Owner

Independent review: Daily use 11a (core daily-use ports)

I reviewed git diff 863726f..origin/dailyuse-11a-core-dailyuse-ports (95b0926) without relying on the implementer's notes.

1. Plan tests. All four tests named in the plan are in crates/fluxer-core/tests/dailyuse_ports.rs: menu_flatten_drops_empty_groups_and_separators, new_confirm_variants_close_with_close_confirm, new_actions_are_ignored_until_implemented and existing_tests_untouched. Two extra tests cover the duration and invite defaults and the Notification icon, Window and request ports. The failing-first commit is 935a0d9.

2. Interfaces. Every UserAction variant in the Interfaces block exists with the listed fields. This includes Friend { action, surface, confirmed }, all 9 FriendAction variants, the 4 FriendSurface variants, the 7 InviteAction variants (plus Close), the reshaped MessageUser { user_id, confirmed } and CloseDm { channel_id, confirmed }, and the attachment actions over MediaItem.

  • MarkRead and CloseConfirm are unchanged.
  • These are present: CoreEvent::Idle(IdleState { idle_for }), Effect::Window(WindowCommand::Raise), ClipboardWrite::Image(MediaRef) (already existed), and Notification.icon: Option<Url> (always None).
  • The six chat::Confirm variants have the fields the plan names, and RelationshipConfirm has its six actions.
  • menus::{MenuModel, MenuItem, MenuItemKind::{Action, Toggle, Submenu{items,on_press}, Disabled}, MenuItemId, MenuRow} and flatten() match the plan.
  • I compared every endpoint in Tasks 4 and 5 with the new ApiRequest/ApiResult pairs. Each one is present. UpdateMemberVoice and the existing ack, profile and meme requests are reused rather than duplicated.
  • The downstream names in Tasks 11b, 12, 14, 15, 16a/b, 17–21, 23, 24 and 25 match: MuteDuration, GuildNotifChange (with OverrideChange for "level|mute"), SwitcherAction, NavAction, ReportAction and ProfileTab.

3. Invariants.

  • fluxer-core gains no iced, wgpu, winit, reqwest or tungstenite dependency and does no I/O. GuildKey is redefined in core because core cannot depend on fluxer-api, which is correct.
  • The runtime answers every new request with 501 CLIENT_NOT_WIRED and logs and ignores Effect::Window.
  • perform_chat's match stays exhaustive.
  • The UI confirm match still compiles and draws nothing for the new variants.
  • There are no new fixtures and no synced-settings writes. No secrets or absolute paths appear: the test FileRef path is a relative icon.png.
  • DeleteAttachment returns Some from message(), so it closes on CloseConfirm or on a channel switch, like the other message confirms. The other five close through is_daily_use.

4. Parity spot-checks in the fork, all matching:

  • TimeWindowPresets.ts:82-92: the presets are 15m, 30m, 1h, 3h, 4h, 8h, 24h, 3d and never. They match MuteDuration::ALL, and without never they match StatusDuration::ALL (UserAreaPopout.tsx:107 uses the same presets).
  • InviteModal.tsx:214-216,280: the defaults are max_age 604800, max_uses 0 and temporary false. They match InviteSettings::default().
  • NotificationsIpc.ts:175-183: the window is restored, shown and focused. This matches the WindowCommand::Raise doc.

5. Review Focus. Item 5 (confirms) only depends on this task for the store variants. They exist, and LeaveGroup, CloseDm and OpenBlockedDm carry confirmed for Tasks 15, 18 and 33.

6. Local gate. I ran FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in the review worktree. It exited 0 (green).

Findings

  • minor, crates/fluxer-core/src/effect.rs: the batch ack request is named ApiRequest::AckReadStates(ReadStatesAck), but the plan text for Task 22a (#303) and Task 28 calls it ApiRequest::ReadStatesAck. The type and its behaviour are right; only the name differs. Those tasks must build against the code's name. You could rename it now or add a note in the PR body.
  • minor, existing tests: as the plan's Interfaces require, the reshaped MessageUser and CloseDm changed the literals in the existing tests chat_dms, chat_ports, profiles, the UI dms and profile_popout tests, and the app test profile. I checked each one: only the literal shapes changed and no assertion was changed.
  • note: MenuItemId as a Cow<'static, str> newtype is fine. The plan does not fix its shape, and it keeps Tasks 17 and 18 out of menus/mod.rs. The AddGuildAction set (Open(step), Back, Close, SetName, SetIcon, Create, SetInviteLink, Join) covers Task 16b's landing, create and join flow.

Verdict: APPROVE. There are no blocking findings, and the local CI gate is green.

## Independent review: Daily use 11a (core daily-use ports) I reviewed `git diff 863726f..origin/dailyuse-11a-core-dailyuse-ports` (95b0926) without relying on the implementer's notes. **1. Plan tests.** All four tests named in the plan are in `crates/fluxer-core/tests/dailyuse_ports.rs`: `menu_flatten_drops_empty_groups_and_separators`, `new_confirm_variants_close_with_close_confirm`, `new_actions_are_ignored_until_implemented` and `existing_tests_untouched`. Two extra tests cover the duration and invite defaults and the Notification icon, Window and request ports. The failing-first commit is 935a0d9. **2. Interfaces.** Every `UserAction` variant in the Interfaces block exists with the listed fields. This includes `Friend { action, surface, confirmed }`, all 9 `FriendAction` variants, the 4 `FriendSurface` variants, the 7 `InviteAction` variants (plus `Close`), the reshaped `MessageUser { user_id, confirmed }` and `CloseDm { channel_id, confirmed }`, and the attachment actions over `MediaItem`. - `MarkRead` and `CloseConfirm` are unchanged. - These are present: `CoreEvent::Idle(IdleState { idle_for })`, `Effect::Window(WindowCommand::Raise)`, `ClipboardWrite::Image(MediaRef)` (already existed), and `Notification.icon: Option<Url>` (always `None`). - The six `chat::Confirm` variants have the fields the plan names, and `RelationshipConfirm` has its six actions. - `menus::{MenuModel, MenuItem, MenuItemKind::{Action, Toggle, Submenu{items,on_press}, Disabled}, MenuItemId, MenuRow}` and `flatten()` match the plan. - I compared every endpoint in Tasks 4 and 5 with the new `ApiRequest`/`ApiResult` pairs. Each one is present. `UpdateMemberVoice` and the existing ack, profile and meme requests are reused rather than duplicated. - The downstream names in Tasks 11b, 12, 14, 15, 16a/b, 17–21, 23, 24 and 25 match: `MuteDuration`, `GuildNotifChange` (with `OverrideChange` for "level|mute"), `SwitcherAction`, `NavAction`, `ReportAction` and `ProfileTab`. **3. Invariants.** - fluxer-core gains no iced, wgpu, winit, reqwest or tungstenite dependency and does no I/O. `GuildKey` is redefined in core because core cannot depend on fluxer-api, which is correct. - The runtime answers every new request with 501 `CLIENT_NOT_WIRED` and logs and ignores `Effect::Window`. - `perform_chat`'s match stays exhaustive. - The UI confirm `match` still compiles and draws nothing for the new variants. - There are no new fixtures and no synced-settings writes. No secrets or absolute paths appear: the test `FileRef` path is a relative `icon.png`. - `DeleteAttachment` returns `Some` from `message()`, so it closes on `CloseConfirm` or on a channel switch, like the other message confirms. The other five close through `is_daily_use`. **4. Parity spot-checks** in the fork, all matching: - `TimeWindowPresets.ts:82-92`: the presets are 15m, 30m, 1h, 3h, 4h, 8h, 24h, 3d and never. They match `MuteDuration::ALL`, and without never they match `StatusDuration::ALL` (`UserAreaPopout.tsx:107` uses the same presets). - `InviteModal.tsx:214-216,280`: the defaults are max_age 604800, max_uses 0 and temporary false. They match `InviteSettings::default()`. - `NotificationsIpc.ts:175-183`: the window is restored, shown and focused. This matches the `WindowCommand::Raise` doc. **5. Review Focus.** Item 5 (confirms) only depends on this task for the store variants. They exist, and `LeaveGroup`, `CloseDm` and `OpenBlockedDm` carry `confirmed` for Tasks 15, 18 and 33. **6. Local gate.** I ran `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in the review worktree. It exited 0 (green). ### Findings - **minor**, `crates/fluxer-core/src/effect.rs`: the batch ack request is named `ApiRequest::AckReadStates(ReadStatesAck)`, but the plan text for Task 22a (#303) and Task 28 calls it `ApiRequest::ReadStatesAck`. The type and its behaviour are right; only the name differs. Those tasks must build against the code's name. You could rename it now or add a note in the PR body. - **minor**, existing tests: as the plan's Interfaces require, the reshaped `MessageUser` and `CloseDm` changed the literals in the existing tests `chat_dms`, `chat_ports`, `profiles`, the UI `dms` and `profile_popout` tests, and the app test `profile`. I checked each one: only the literal shapes changed and no assertion was changed. - **note**: `MenuItemId` as a `Cow<'static, str>` newtype is fine. The plan does not fix its shape, and it keeps Tasks 17 and 18 out of `menus/mod.rs`. The `AddGuildAction` set (Open(step), Back, Close, SetName, SetIcon, Create, SetInviteLink, Join) covers Task 16b's landing, create and join flow. **Verdict: APPROVE.** There are no blocking findings, and the local CI gate 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:09:01 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.