decent
decent copied to clipboard
Channel manager
Related to #14.
There needs to be a way to rename and delete channels (and probably reorder them) for admins.
Todo
- [ ] Default channel option. Currently this is the first.
- [ ] Frontend dropdown. Info from @PullJosh.
- Definitely make a general way of spawning dropdowns; we'll probably want a similar dropdown next to messages (delete, edit, etc).
- Should dropdown items have icons? I think that would be a nice visual cue.
- Support the context menu API too.
- Rename channels.
- [x] Backend - probably:
POST /api/rename-channel {channelID, newName, sessionID}. - [ ] Frontend - an item in the dropdown list. A prompt modal, for the new name.
- [x] Backend - probably:
- Delete and archive channels. (#94)
- Archived channels are hidden from the obvious channel list, but they are not removed; anybody may view an archived channel, probably through a separate list.
- [ ] Archive backend - probably:
POST /api/archive-channel {channelID, sessionID}. Channels will have an "archived" field in the database (also throughserialize.channelShort). - Archive frontend:
- [ ] For archiving a channel: an item in the dropdown list. A confirmation prompt.
- [ ] For viewing archived channels: a separate list? Not sure how to do this.
- [ ] Delete backend - probably:
POST /api/delete-channel {channelID, sessionID}. Perhaps require channel name here too (rather than just a frontend), so that people messing with the API won't somehow accidentally delete the wrong channel; also, to prompt writers of custom clients to include the same warnings as the official client. - [ ] Delete frontend: an item in the dropdown list. A confirmation prompt, or two, and a requirement to type out the name of the channel.
- Reorder channels.
- Let admins specify a default order; users may follow this or specify their own.
- How does the user decide, through the GUI?
- Frontend: Drag/drop UI as described (first paragraph) by @PullJosh. Server defaults changed through the server settings; user-specific preferences through the sidebar (via @heyitsmeuralex).
- Blocked by #67.
- Backend: Not sure how to do this yet.. Probably store channel order on the server settings object.
- [ ]
POST /api/arrange-channels {channelIDs, sessionID}.channelIDsis used as the sorting method, and is verified to contain all (non-archived) channels. - [ ] Update
GET /api/channel-listto return according to the order defined in server settings..
- [ ]
- Let admins specify a default order; users may follow this or specify their own.
Either a literal "Rename" button, or maybe an edit (pencil) symbol beside the name.
Given that we have so many actions that we want users to be able to do (rename, delete, reorder, etc), I propose that each channel name has a three-dot context menu on the right side (only visible to admins). Something like this:

(Clicking it, of course, would open a menu with a list of available actions.)
Re: Deleting channels
Personally, I think it makes the most sense to provide both "archive" and "delete" options. Archived channels could still be linked to and viewed, as well as re-activited by the admin if they want. However, they would be read-only and wouldn't appear in the regular channel list. This option would be best in the vast majority of cases.
However, I'm also in favor of giving as much power as possible to the users (particularly the trusted ones, like admins). Much like in the decision not to artificially limit the number of custom emoji that can be uploaded, I see no reason to prevent an admin from doing something (ie deleting a channel) if they think it's the best course of action. Admins are, presumably, trusted users, so there's no reason to believe that our own judgment as developers is any better than theirs. It's quite possible that some extenuating circumstances could arise that would make permanently deleting a channel the best possible option, so there's no reason to artificially prevent it.
I'm also in favor of giving as much power as possible to the users (particularly the trusted ones, like admins)
This is a good general design policy to go with - e.g. per-user channel order. :+1:
Opinions on de-archiving a channel? That seems reasonable to me, going with "let users do what they want".
Edit:
as well as re-activited by the admin if they want
..I missed this! :package:
I see no harm in letting it happen. Maybe leave a little note in the message list that says it was archived/unarchived?
Yup - I do want to figure out how to make "system" messages. Originally just for pinning messages ("blah pinned (a message)"), but also for this now.
@PullJosh You mentioned including "reorder" in the list of things in the dropdown menu - I'm curious how that would work? Would it set the channel list into a "reorder mode"?
Also, how would non-admins access a reorder mode like this? Maybe that dropdown could be shown to everyone, with extra options for admins. For everyone, "Reorder (for you)", "Copy channel reference", "...with server". For admins, "Reorder (globally)", "Delete", "Archive".
(I'm not sure on the "Reorder (globally)" menu item's title. Help?)
Maybe when you click the "reorder" menu option, all of the channel names slide to the right a bit and a drag handle appears to the left of each? You could click and drag to your heart's content, and then click the "save" or "cancel" buttons which show up below the channel names.
Personally, I don't think the reorder option needs to specify that it's local or global. I think users would automatically assume that their changes only apply to themselves (or -- more likely -- wouldn't think about it at all).
If a regular user reorders their channels, it should save those settings for themselves only. If an admin reorders, the order that they choose should become the default for any new users who register in the future.
Every admin user should see the default layout at all times (rather than being allowed to set a custom order for themselves, like regular users can). So if one admin changes the order, that change should appear for all admins. Although this gives admins a bit less power, I think it simplifies their UI greatly, and avoids potential confusion between local and global order settings.
Most of what @PullJosh just said
:+1: :tada:
if one admin changes the order, that change should appear for all admins [i.e. admins directly use and edit the server default channel order]
I disagree. I think that an admin changing channel order in that way should function exactly the same as a normal user doing the same. Admins should have to go to the server settings to change the default channel order. Similar ~~DragonDrop~~ drag+drop UI, but within a specific server settings dialog that explains that it's the default for people who haven't changed the order yet/guests.
We already need to implement server settings, and I think it'd have a good place in there. They are server-wide defaults.
That ~~probably~~ definitely makes more sense, actually.
That means this is blocked by #67, then.
Added default channel option to this massive issue as mentioned in #102.
Not blocked anymore since #67 is done; I'm also removing the "scary" label since #67 being implemented makes this take a lot less (client-side) work.