feat(panel): create a hub channel, rename it on save, broken hub, last spawn failure - #309
Merged
Merged
Conversation
…t spawn failure Closes #295. Spec #285. The hub page gains a create form: a category, a hub channel name and a base string. The service creates the voice channel under the category with overwrites omitted, so Discord syncs it from birth, then writes the hub row with the defaults. A row write that fails deletes the channel it just made. The create and register forms post to one route and are told apart by their fields. The edit form's hub channel name is writable. A changed name renames the channel before the row saves, with an audit log reason naming the panel user; a rename Discord refuses saves nothing and the form names the field with a body-free phrase. The bitrate ceiling is the guild's boost tier, read at save through the manager seam. A broken hub, one whose channel is gone or has no category, is derived from the guild's channel list at page load. The list marks it and offers Remove alone; its section shows the remove form and the change log and no edit form. An update of a broken hub is refused before any rename. The list shows each hub's last spawn failure, time and cause, from the runtime, beside the live spawned count. commands.DiscordErrorDetail exports the body-free phrase the warden classifier already produces, for the panel's refusals. The panel coverage floor rises to 78.
A Discord create refusal names the category field, not the channel name: the category cap and a category the bot cannot see are what Discord refuses on. A create's change log entry carries the channel name typed, as a rename's does. A row write that fails after a rename names both names in the error, so the mismatch is traceable. Create and register share newHub and applyNew. hubChannel returns one state value the list, the form and the update read. The refusal note is one template block behind RefusalFor. hubPage.Form is Register, and guild() is readGuild(), beside snapshot.guild. Tests: the edit route refuses an empty and a 101-character channel name; the Discord create refusal and the broken hub update assert their field; "syncs" leaves the test name and the assertion, per CONTEXT.md.
panel/hubs.go:123: delete, the broken hub refusal note and its render panel/hubs.go:791: replace, the bitrate refusal drops its boost tier sentence panel/templates/home.html:24: replace, the empty state names the register form alone panel/templates/home.html:50: delete, the category hint panel/templates/home.html:57: delete, the hub channel name hint panel/templates/home.html:103: revise, the broken hub body panel/templates/home.html:113: delete, the rename hint panel/templates/home.html:155: replace, the bitrate hint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #295. Spec #285.
What changed
The hub page gains a create form: a category, a hub channel name and a base string. The service creates the voice channel under the category with overwrites omitted, so it takes the category's permissions from birth, then writes the hub row with the defaults. A row write that fails deletes the channel it just made. The create and register forms post to one route and are told apart by their fields: the create form carries
category, the register formhub_channel.The edit form's hub channel name is writable. A changed name renames the channel before the row saves, with an audit log reason naming the panel user. A rename Discord refuses saves nothing and the form names
channel_namewith a body-free phrase. The rename joins the change log entry aschannel_name.The bitrate ceiling is the guild's boost tier, read at save through the manager seam: 96000, 128000, 256000 or 384000. Over it is refused with
bitratenamed.A broken hub, one whose channel is gone or has no category, is derived from the guild's channel list at page load. The list marks it and offers Remove alone. Its own page shows the note, the remove form and the change log, no edit form. An update of a broken hub is refused before any rename.
The list shows each hub's last spawn failure, cause and time, from the runtime, beside the live spawned count.
commands.DiscordErrorDetailexports the body-free phrase the warden classifier already produces, for the panel's refusals. The panel coverage floor rises from 75 to 78.Review notes
newHubandapplyNewfor create and register, onehubChannelStatevalue the list, the form and the update read, one refusal template block behindRefusalFor, and the Discord create refusal filed undercategory(the cap and the bot's view of the category are what Discord refuses on).data-hub,data-fieldanddata-error; none pins wording, labels or order.Gates