Server admin 29: ui-channel-settings (#697) #765

Closed
charles wants to merge 0 commits from serveradmin-29-ui-channel-settings into serveradmin
Owner

Server administration 29: the channel and category settings screen, its Overview tab, and the "Duplicate channel" modal.

Stacked on: serveradmin-8-form-widgets, serveradmin-16-core-channel-settings, serveradmin-20-core-menu-rows (all three were already on origin/serveradmin when this branch was cut; origin/serveradmin with Task 24 has since been merged in).

What was built

  • screens/entity_settings/channel/mod.rs: the full-screen settings over the Task 7 shell, drawn instead of the main screen while app.admin.channel_settings is set (app.rs, UiMessage::ChannelSettings, Escape arm). The sidebar shows the store's channel_tabs (Overview / Permissions / Invites with the Gear / Shield / Ticket icons of ChannelSettingsConstants.ts) in one group with no heading, under the channel's name. "Delete channel" / "Delete category" is the danger row. The unsaved-changes bar is wired to the store's Form actions.
  • channel/overview.rs: the Overview for text, announcement, link channels and categories (CT/ChannelOverviewTab.{tsx,module.css}, SlowmodeControl.tsx, ChannelOverviewTopicEditor.tsx, SettingsControlRow.tsx). It has the name ("Category name" / "My category" for a category), the link URL, the topic (Task 8's multi-line field with the n/1,024 counter), the slowmode stop slider with its value in words (slowmode_text, as formatSlowmodeDuration), and the announcement switch (ChannelAdminAction::SetAnnouncement). Fields are grouped as the original's .settingsGroups, with the border line above every group but the first. A voice group slot is left for Task 30, and the Permissions and Invites pages are empty slots for Tasks 30 and 31.
  • The delete confirm and "Stop being an announcement channel?" (with "Convert") for the open channel are drawn over the settings screen with the generic confirm's card (confirm::over). This is needed because the main screen, where the generic confirm lives, is not drawn under the settings. confirm.rs (Task 27's file) is untouched.
  • screens/main/modals/duplicate_channel.rs: "Duplicate channel" (ChannelDuplicateModal.{tsx,module.css}). The name is prefilled with the source's and kept as typed in Local::duplicate_channel until it is sent. The helper puts the source's name in bold, the store's refusal shows under the field, and the buttons are Cancel and "Create channel". It is registered as main::Modal::DuplicateChannel with its keybinds test.

Strings (from the fork): "Channel name", "Category name", "My category", "general", "URL", "https://example.com", "Topic", "Add a topic to this channel", "Slowmode", "Wait between messages. Members with "Bypass slowmode" can bypass this.", "Off", "Announcement channel", "Lets other communities follow this channel and get copies of what you publish.", "Duplicate channel", "new-channel", "Cancel", "Create channel". The helper and confirm texts come from core.

Tests

  • crates/fluxer-ui/tests/channel_settings.rs: sidebar_tabs_by_type, overview_fields_by_type, slowmode_slider_text, topic_counter, announcement_switch_emits_action (also the confirms over the screen and Escape), category_label_is_category_name, bar_saves_and_flashes, duplicate_modal_prefilled.
  • Goldens (lavapipe): channel_settings_overview_text, channel_settings_overview_category, channel_settings_overview_link, announcement_off_confirm, duplicate_channel_modal. Copies are in docs/screenshots/*.png and rows in docs/screenshots/README.md. No Electron reference screenshot was available; the dimensions come from ChannelOverviewTab.module.css and ChannelDuplicateModal.module.css.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally. No FLUXER_DESKTOP_TESTS tests were needed or run.

Deviations

  • The sidebar title is the channel's name without the channel-type icon the original shows (ShellModel.sidebar_title is plain text; it belongs to Task 7's shell).
  • The topic is a plain multi-line field with no emoji, mention or channel autocomplete (spec section 13, Q11).
  • Files touched outside the task's list, each with a minimal change: src/message.rs (the UiMessage::ChannelSettings variant), screens/main/mod.rs (the modal's message, update arm, layer and Modal variant), and tests/keybinds.rs (the required modal-layer test).

Closes #697

🤖 Generated with Claude Code

https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K

Server administration 29: the channel and category settings screen, its Overview tab, and the "Duplicate channel" modal. Stacked on: serveradmin-8-form-widgets, serveradmin-16-core-channel-settings, serveradmin-20-core-menu-rows (all three were already on origin/serveradmin when this branch was cut; origin/serveradmin with Task 24 has since been merged in). ## What was built - `screens/entity_settings/channel/mod.rs`: the full-screen settings over the Task 7 shell, drawn instead of the main screen while `app.admin.channel_settings` is set (`app.rs`, `UiMessage::ChannelSettings`, Escape arm). The sidebar shows the store's `channel_tabs` (Overview / Permissions / Invites with the Gear / Shield / Ticket icons of `ChannelSettingsConstants.ts`) in one group with no heading, under the channel's name. "Delete channel" / "Delete category" is the danger row. The unsaved-changes bar is wired to the store's Form actions. - `channel/overview.rs`: the Overview for text, announcement, link channels and categories (`CT/ChannelOverviewTab.{tsx,module.css}`, `SlowmodeControl.tsx`, `ChannelOverviewTopicEditor.tsx`, `SettingsControlRow.tsx`). It has the name ("Category name" / "My category" for a category), the link URL, the topic (Task 8's multi-line field with the `n/1,024` counter), the slowmode stop slider with its value in words (`slowmode_text`, as `formatSlowmodeDuration`), and the announcement switch (`ChannelAdminAction::SetAnnouncement`). Fields are grouped as the original's `.settingsGroup`s, with the border line above every group but the first. A voice group slot is left for Task 30, and the Permissions and Invites pages are empty slots for Tasks 30 and 31. - The delete confirm and "Stop being an announcement channel?" (with "Convert") for the open channel are drawn **over the settings screen** with the generic confirm's card (`confirm::over`). This is needed because the main screen, where the generic confirm lives, is not drawn under the settings. `confirm.rs` (Task 27's file) is untouched. - `screens/main/modals/duplicate_channel.rs`: "Duplicate channel" (`ChannelDuplicateModal.{tsx,module.css}`). The name is prefilled with the source's and kept as typed in `Local::duplicate_channel` until it is sent. The helper puts the source's name in bold, the store's refusal shows under the field, and the buttons are Cancel and "Create channel". It is registered as `main::Modal::DuplicateChannel` with its keybinds test. Strings (from the fork): "Channel name", "Category name", "My category", "general", "URL", "https://example.com", "Topic", "Add a topic to this channel", "Slowmode", "Wait between messages. Members with \"Bypass slowmode\" can bypass this.", "Off", "Announcement channel", "Lets other communities follow this channel and get copies of what you publish.", "Duplicate channel", "new-channel", "Cancel", "Create channel". The helper and confirm texts come from core. ## Tests - `crates/fluxer-ui/tests/channel_settings.rs`: `sidebar_tabs_by_type`, `overview_fields_by_type`, `slowmode_slider_text`, `topic_counter`, `announcement_switch_emits_action` (also the confirms over the screen and Escape), `category_label_is_category_name`, `bar_saves_and_flashes`, `duplicate_modal_prefilled`. - Goldens (lavapipe): `channel_settings_overview_text`, `channel_settings_overview_category`, `channel_settings_overview_link`, `announcement_off_confirm`, `duplicate_channel_modal`. Copies are in `docs/screenshots/*.png` and rows in `docs/screenshots/README.md`. No Electron reference screenshot was available; the dimensions come from `ChannelOverviewTab.module.css` and `ChannelDuplicateModal.module.css`. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally. No FLUXER_DESKTOP_TESTS tests were needed or run. ## Deviations - The sidebar title is the channel's name without the channel-type icon the original shows (`ShellModel.sidebar_title` is plain text; it belongs to Task 7's shell). - The topic is a plain multi-line field with no emoji, mention or channel autocomplete (spec section 13, Q11). - Files touched outside the task's list, each with a minimal change: `src/message.rs` (the `UiMessage::ChannelSettings` variant), `screens/main/mod.rs` (the modal's message, update arm, layer and `Modal` variant), and `tests/keybinds.rs` (the required modal-layer test). Closes #697 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
The channel and category settings screen over the entity settings shell
(sidebar by channel_tabs, Delete channel / Delete category), the Overview
page (name, URL, topic with its counter, slowmode stop slider, announcement
switch), the delete and announcement-off confirms drawn over the screen,
and the Duplicate channel modal. Goldens channel_settings_overview_{text,
category,link}, announcement_off_confirm, duplicate_channel_modal.

Refs #697

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Refs #697

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
# Conflicts:
#	crates/fluxer-ui/README.md
#	crates/fluxer-ui/src/screens/entity_settings/mod.rs
#	crates/fluxer-ui/tests/screenshots.rs
#	docs/screenshots/README.md
Author
Owner

Independent review: Server admin 29 (ui-channel-settings)

Scope: git diff origin/serveradmin...origin/serveradmin-29-ui-channel-settings (23 files: entity_settings/channel/{mod,overview}.rs, main/modals/duplicate_channel.rs, registration in app.rs, message.rs, main/mod.rs, modals/mod.rs, tests, 5 goldens).

Plan tests (1): all 8 headless tests exist and assert what the plan names: sidebar_tabs_by_type, overview_fields_by_type, slowmode_slider_text, topic_counter ("9/1,024", capped at "1,024/1,024"), announcement_switch_emits_action (FetchFollowerStats, confirm, "Convert" sends SetAnnouncement{on:false, confirmed:true}), category_label_is_category_name, bar_saves_and_flashes (the PATCH carries the name alone; a tab change or close while dirty flashes and stays), duplicate_modal_prefilled. All 5 goldens are present in screenshots.rs, fixtures/golden/ and docs/screenshots/.
Interfaces (2): the screen, Overview and duplicate modal build on Task 16's settings_model, duplicate_model, ChannelOverviewModel, SLOWMODE_STOPS, delete_confirm and announcement_off_text without changing them; overview::view(model, voice: Option<Element>) leaves Task 30 its slot. Task 31 gets ChannelPage::Permissions.
Invariants (3): no I/O in fluxer-ui, no new dependencies, no fixtures, no secrets. helper_parts slices only at rfind boundaries, with end >= start, so it cannot panic. Field input is capped at the store's maximum.
Parity (4), checked against the fork: the slowmode description with "Bypass slowmode" (SlowmodeControl.tsx, PermissionLabelDescriptors.ts:464), formatSlowmodeDuration units and list joining, "Add a topic to this channel" / "Topic" / "URL" / "Category name" / "My category" (ChannelOverviewTab.tsx, ChannelOverviewTopicEditor.tsx), group order general → messaging → voice and their conditions, the duplicate helper texts and EXAMPLE_CHANNEL_NAME "new-channel" (ChannelDuplicateModal.tsx, I18nDisplayConstants.ts), and "Stop being an announcement channel?" with primaryVariant="danger" "Convert". All match.
Review Focus (5): item 3 (unsaved changes) is covered by bar_saves_and_flashes, and the store still decides. No other item applies.
CI (6): FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green in the review worktree at 5dd62241 ("all steps passed"; the 5 new goldens ran on lavapipe and passed).

Findings

  • minor entity_settings/channel/mod.rs confirm(): it builds ConfirmModel with kind: Kind::Delete as a placeholder, but Kind::Admin already exists for exactly this case (used by confirm.rs's admin()). Nothing draws it differently today. A later change that keys on Kind::Delete (for example the message-delete Shift tip or preview) would misdraw these confirms.
  • minor The slowmode slider has no marker labels under it. The original draws "Off", "1 minute", "1 hour" and "6 hours" at SLOWMODE_MARKER_SECONDS, and Task 8's slider::stops has no markers. This is a parity gap in the shared widget, not in this task; it could be a follow-up.
  • minor duplicate_channel::helper_parts uses rfind(" #"). A flexible-names channel whose name contains " #" (for example "a #b") makes the bold part only "#b". Cosmetic.

Verdict: APPROVED (no blocking findings, local CI green).

## Independent review: Server admin 29 (ui-channel-settings) Scope: `git diff origin/serveradmin...origin/serveradmin-29-ui-channel-settings` (23 files: `entity_settings/channel/{mod,overview}.rs`, `main/modals/duplicate_channel.rs`, registration in `app.rs`, `message.rs`, `main/mod.rs`, `modals/mod.rs`, tests, 5 goldens). **Plan tests (1):** all 8 headless tests exist and assert what the plan names: `sidebar_tabs_by_type`, `overview_fields_by_type`, `slowmode_slider_text`, `topic_counter` ("9/1,024", capped at "1,024/1,024"), `announcement_switch_emits_action` (FetchFollowerStats, confirm, "Convert" sends `SetAnnouncement{on:false, confirmed:true}`), `category_label_is_category_name`, `bar_saves_and_flashes` (the PATCH carries the name alone; a tab change or close while dirty flashes and stays), `duplicate_modal_prefilled`. All 5 goldens are present in `screenshots.rs`, `fixtures/golden/` and `docs/screenshots/`. **Interfaces (2):** the screen, Overview and duplicate modal build on Task 16's `settings_model`, `duplicate_model`, `ChannelOverviewModel`, `SLOWMODE_STOPS`, `delete_confirm` and `announcement_off_text` without changing them; `overview::view(model, voice: Option<Element>)` leaves Task 30 its slot. Task 31 gets `ChannelPage::Permissions`. **Invariants (3):** no I/O in `fluxer-ui`, no new dependencies, no fixtures, no secrets. `helper_parts` slices only at `rfind` boundaries, with `end >= start`, so it cannot panic. Field input is capped at the store's maximum. **Parity (4), checked against the fork:** the slowmode description with "Bypass slowmode" (`SlowmodeControl.tsx`, `PermissionLabelDescriptors.ts:464`), `formatSlowmodeDuration` units and list joining, "Add a topic to this channel" / "Topic" / "URL" / "Category name" / "My category" (`ChannelOverviewTab.tsx`, `ChannelOverviewTopicEditor.tsx`), group order general → messaging → voice and their conditions, the duplicate helper texts and `EXAMPLE_CHANNEL_NAME` "new-channel" (`ChannelDuplicateModal.tsx`, `I18nDisplayConstants.ts`), and "Stop being an announcement channel?" with `primaryVariant="danger"` "Convert". All match. **Review Focus (5):** item 3 (unsaved changes) is covered by `bar_saves_and_flashes`, and the store still decides. No other item applies. **CI (6):** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green in the review worktree at 5dd62241 ("all steps passed"; the 5 new goldens ran on lavapipe and passed). ### Findings - **minor** `entity_settings/channel/mod.rs` `confirm()`: it builds `ConfirmModel` with `kind: Kind::Delete` as a placeholder, but `Kind::Admin` already exists for exactly this case (used by `confirm.rs`'s `admin()`). Nothing draws it differently today. A later change that keys on `Kind::Delete` (for example the message-delete Shift tip or preview) would misdraw these confirms. - **minor** The slowmode slider has no marker labels under it. The original draws "Off", "1 minute", "1 hour" and "6 hours" at `SLOWMODE_MARKER_SECONDS`, and Task 8's `slider::stops` has no markers. This is a parity gap in the shared widget, not in this task; it could be a follow-up. - **minor** `duplicate_channel::helper_parts` uses `rfind(" #")`. A flexible-names channel whose name contains " #" (for example "a #b") makes the bold part only "#b". Cosmetic. Verdict: APPROVED (no blocking findings, local CI green).
Author
Owner

Merged into serveradmin by hand (the merge API returns 405); the commits are in the branch.

Merged into `serveradmin` by hand (the merge API returns 405); the commits are in the branch.
charles closed this pull request 2026-11-16 09:22:22 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.