Create channel and Create category (#663) #707

Closed
charles wants to merge 0 commits from feat-663-create-channel into textchat
Owner

Closes #663

Creating channels and categories in a community, pulled forward from sub-project 7, matching the fork's main (ba98441b, the fluxer-soundboard checkout): ChannelCreateModal.{tsx,module.css}, CategoryCreateModal.tsx, ChannelCreateModalUtils.ts, ForumChannelTypeOptions.ts, ChannelListContextMenu.tsx, ChannelItem.tsx, GuildMenuData.tsx, lib/forms (handleError), and the server's ChannelOperationsService.createChannel / ChannelHelpers / ChannelValidators for the devserver.

What was missing (cause): the feature was deliberately left out of Daily use (docs/parity/dailyuse.md "later (7)"): no request type, no endpoint, no core flow, no entry points. Also, fluxer-api reported a validation refusal as the top-level "Input Validation Error", so a refused name could not be shown as the original shows it.

What it does now

  • Entry points, each only with MANAGE_CHANNELS: the guild menu (rail icon and header) gets "Create channel" and "Create category" after "Invite members"; a right press on the channel list's empty area opens the original's channel-list menu (Hide muted channels; Create channel, Create category; Invite people); a hovered category row shows the "+" (tooltip "Create channel", permission checked on the category) which opens the channel modal under it.
  • Channel modal: "Channel type" Text, Voice, Announcement, Link, plus Forum and Media in a guild with threads; "Channel name" (100 chars, the type's icon in the field); "URL" for a link channel; Cancel / "Create channel". Category modal: "Name", Cancel / "Create category".
  • Request: POST /guilds/{id}/channels with every field (null where unset), the name as typed, voice defaults (64000 bitrate, user_limit 0, connection limit 5), link URL; category type: 4, no parent.
  • Errors as the original: the browser's "Please fill out this field." / "Please enter a URL." before sending; afterwards the server's message under the name (permission, MAX_GUILD_CHANNELS, MAX_CATEGORY_CHANNELS, the name's validation messages), else "An unexpected error occurred. Try again.".
  • After creation: the modal closes; the channel enters the store only by CHANNEL_CREATE; a text, voice, announcement, forum or media channel is opened once its CHANNEL_CREATE is in, whichever arrives first.
  • Devserver: the endpoint with the server's permission check, name normalisation (text/announcement/forum/media lower-case-with-dashes), parent and limit checks and their codes/messages; CHANNEL_CREATE; later READYs list created channels.
  • Parity: the guild-menu row moved to done; new rows, including what stays later (7): the "Private channel" switch and its members/roles step (permission overwrites), the header dropdown (native has none).

How it was verified

  • proto: exact bodies + spec contract against each Guild*ChannelCreateRequest branch.
  • api (wiremock): body, answer, refusals keep code and message, validation messages joined.
  • devserver: success (CHANNEL_CREATE, normalised names, later READY), refusals (403, empty name, each parent case, link without URL, bad type, unknown guild), the 500-channel limit.
  • core: menus per permission, open refused without permission, types offered, validation, request, both arrival orders, link/category not opened, each server error, logout.
  • UI (headless): each entry point (guild menu, channel-list empty area, category "+"; none without permission), the modal's rows/fields/errors, keybinds suppressed over the modal. Goldens channel_create, category_create rendered on lavapipe; the whole suite (177) passes on lavapipe.
  • End to end (apps/fluxer/tests/channel_create_e2e.rs): on the devserver, create a community, create "Board Games" under its category: the recorded request carries the typed name, CHANNEL_CREATE brings board-games, the client opens it; a category follows.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: all steps passed.

Not done: no side-by-side capture of the Electron client (not runnable here against a test server).

🤖 Generated with Claude Code

Closes #663 Creating channels and categories in a community, pulled forward from sub-project 7, matching the fork's `main` (`ba98441b`, the `fluxer-soundboard` checkout): `ChannelCreateModal.{tsx,module.css}`, `CategoryCreateModal.tsx`, `ChannelCreateModalUtils.ts`, `ForumChannelTypeOptions.ts`, `ChannelListContextMenu.tsx`, `ChannelItem.tsx`, `GuildMenuData.tsx`, `lib/forms` (`handleError`), and the server's `ChannelOperationsService.createChannel` / `ChannelHelpers` / `ChannelValidators` for the devserver. **What was missing (cause):** the feature was deliberately left out of Daily use (`docs/parity/dailyuse.md` "later (7)"): no request type, no endpoint, no core flow, no entry points. Also, `fluxer-api` reported a validation refusal as the top-level "Input Validation Error", so a refused name could not be shown as the original shows it. **What it does now** - Entry points, each only with `MANAGE_CHANNELS`: the guild menu (rail icon and header) gets "Create channel" and "Create category" after "Invite members"; a right press on the channel list's empty area opens the original's channel-list menu (Hide muted channels; Create channel, Create category; Invite people); a hovered category row shows the "+" (tooltip "Create channel", permission checked on the category) which opens the channel modal under it. - Channel modal: "Channel type" Text, Voice, Announcement, Link, plus Forum and Media in a guild with threads; "Channel name" (100 chars, the type's icon in the field); "URL" for a link channel; Cancel / "Create channel". Category modal: "Name", Cancel / "Create category". - Request: `POST /guilds/{id}/channels` with every field (`null` where unset), the name as typed, voice defaults (64000 bitrate, user_limit 0, connection limit 5), link URL; category `type: 4`, no parent. - Errors as the original: the browser's "Please fill out this field." / "Please enter a URL." before sending; afterwards the server's message under the name (permission, `MAX_GUILD_CHANNELS`, `MAX_CATEGORY_CHANNELS`, the name's validation messages), else "An unexpected error occurred. Try again.". - After creation: the modal closes; the channel enters the store only by `CHANNEL_CREATE`; a text, voice, announcement, forum or media channel is opened once its `CHANNEL_CREATE` is in, whichever arrives first. - Devserver: the endpoint with the server's permission check, name normalisation (text/announcement/forum/media lower-case-with-dashes), parent and limit checks and their codes/messages; `CHANNEL_CREATE`; later READYs list created channels. - Parity: the guild-menu row moved to done; new rows, including what stays later (7): the "Private channel" switch and its members/roles step (permission overwrites), the header dropdown (native has none). **How it was verified** - proto: exact bodies + spec contract against each `Guild*ChannelCreateRequest` branch. - api (wiremock): body, answer, refusals keep code and message, validation messages joined. - devserver: success (CHANNEL_CREATE, normalised names, later READY), refusals (403, empty name, each parent case, link without URL, bad type, unknown guild), the 500-channel limit. - core: menus per permission, open refused without permission, types offered, validation, request, both arrival orders, link/category not opened, each server error, logout. - UI (headless): each entry point (guild menu, channel-list empty area, category "+"; none without permission), the modal's rows/fields/errors, keybinds suppressed over the modal. Goldens `channel_create`, `category_create` rendered on lavapipe; the whole suite (177) passes on lavapipe. - End to end (`apps/fluxer/tests/channel_create_e2e.rs`): on the devserver, create a community, create "Board Games" under its category: the recorded request carries the typed name, `CHANNEL_CREATE` brings `board-games`, the client opens it; a category follows. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`: all steps passed. Not done: no side-by-side capture of the Electron client (not runnable here against a test server). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Pulls channel and category creation forward from server administration,
matching the fork's main (ba98441b): ChannelCreateModal / CategoryCreateModal,
their entry points (guild menu, channel list empty-area menu, the "+" of a
category row, each gated on MANAGE_CHANNELS) and createChannel's behaviour.

- fluxer-proto: GuildChannelCreate (POST /guilds/{id}/channels body),
  MAX_GUILD_CHANNELS / MAX_CATEGORY_CHANNELS codes; spec contract per branch.
- fluxer-api: create_guild_channel; an INVALID_FORM_BODY reads as its
  fields' messages (extractErrorMessage).
- fluxer-core: channel_create (modal state, browser-style checks, request,
  refusal shown under the name, the new channel opens once its
  CHANNEL_CREATE is in), menu rows and menus::channel_list.
- apps/fluxer: CreateGuildChannel through dailyuse_rt.
- fluxer-devserver: POST /guilds/{id}/channels with the server's
  permission, name normalisation, parent and limit checks; CHANNEL_CREATE;
  later READYs list created channels.
- fluxer-ui: the two modals, Target::ChannelList, the category "+",
  FolderPlus icon; goldens channel_create and category_create (lavapipe).
- Tests at each layer and an end-to-end test against the devserver.

Refs #663

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

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

Merged into `textchat` by hand (the merge API returns 405); the commits are in the branch.
charles closed this pull request 2026-11-15 19:46:07 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.