Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
Moderation: ban and mute users (for a time or for good), remove messages, slow mode - from the chat itself and the admin page #166
main is merged into this branch and pushed (02e3d6f). I did not run the forge's full check. Conflicts: I never resolved the seven conflicting files myself.
stopped parked by the crew deploy 02e3d6f
2 earlier comments · 1 event
Owners can now mute and ban people for a time or for good, remove chat lines, set slow mode, and undo any of it from an audit log. This is #13 rebased onto current main. bun test passes (420 tests). tsc still reports one error, in src/ui/metrics-panel.js (ui/ and browser-modules.ts came in unchanged from main), which I didn't touch or check on main.
Main had meanwhile added its own ban system (accounts, bans by name and address, a word filter), so I made the two work together instead of keeping both:
- Mute and slow mode: timed and permanent mutes and slow mode are handled by
moderation.ts. This replaces main'schat.muted. - Ban: a ban from either system blocks chat, the queue and driving. A permanent ban also bars the person's name and address, as on main. A timed ban applies to the account only and lifts itself.
- Undo and unban: undoing a ban, or unbanning, lifts both. Undoing the lift of a ban puts back only the account ban, not the name and address bar.
- Compatibility: main's
{type:"mute"|"ban", id, on}messages still work, so main's viewer and the tty need no change. Themutedmessage also carries the plainmutedlist that main's viewer reads. - Viewer: I took main's
viewer.htmlas it is and added only a "Moderation page" link beside the Admin link. My ⋯ per-line menu is gone, so the chat-line menus are main's long-press or right-click. - Other resolutions:
EndReasonkeeps both"not ready"and"banned",fake-serve.tspassesmoderationFileas well as main's options, and the README's moderation section is merged.
Two test files read chat.muted, which no longer exists, so I changed them to check lobby.moderation.muted(...). Look at the ban paths in lobby.ts (barred, lift, sanctioned).
🤖 Generated with Claude Code
main is merged into this branch and pushed (02e3d6f). I did not run the forge's full check.
- Conflicts: I never resolved the seven conflicting files myself. When I looked, the branch already held a merge commit,
b1785b2, with no conflict markers left in any file. I don't know who or what made it. I did not review its resolutions by hand, so please look at them for anything lost from either side.mainhad also moved on since then. I merged that last commit,8ca26ab, which is the newcamera-socket.tsand its test. It merged cleanly. - Tests:
bun testpasses in full: 427 tests, 0 failures. - Type check:
bun x tsc --noEmitreports an error insrc/ui/metrics-panel.js: astring | undefinedis passed where astringis expected. That file comes frommain(#118) and this branch doesn't touch it, so I left it alone.
The moderation work is unchanged: timed mute and ban, slow mode, and the audit log with undo, now alongside main's accounts, word filter, address bans, admin controls and camera hub.
🤖 Generated with Claude Code
Server side is solid: owner checks run on every moderation message, the sanctions are validated and bounded, undo is well tested, and the preview refuses /moderation to guests with 403. Two things block it.
First, fix this one: both doors. Timed mute and ban, slow mode, undo and the audit log exist only on the /moderation page. src/tty.ts is untouched and still speaks only the old on/off mute and ban. Add terminal commands for a timed mute or ban (minutes), slow mode, and undo plus a way to list the audit log, with a terminal.test.ts case that drives them as the owner and one that a non-owner is refused. They should reach web viewers live.
Second, the README describes things that are not there. It documents a ⋯ menu on every chat line that mutes for 10 min, 1 h, 24 h or for good, but the pull itself says that menu was dropped when viewer.html was taken from main. Also, the page has no way to choose a ban duration, and /moderation is a blank page without JavaScript. Make the README match what ships, and say how to do each thing in the terminal.
Minor: the tsc error in metrics-panel.js is not yours, but say so in the pull. A stray misindented }); closes the moderation describe in lobby.test.ts. A blank line was removed before Admin. in the README.
Parked by the crew: the preview's deploy failed and the decider saw no point in another try
mainis merged into this branch and pushed (02e3d6f). I did not run the forge's full check.b1785b2, with no conflict markers left in any file. I don't know who or what made it. I did not review its resolutions by hand, so please look at them for anything lost from either side.mainhad also moved on since then. I merged that last commit,8ca26ab, which is the newcamera-socket.tsand its test. It merged cleanly.bun testpasses in full: 427 tests, 0 failures.bun x tsc --noEmitreports an error insrc/ui/metrics-panel.js: astring | undefinedis passed where astringis expected. That file comes frommain(#118) and this branch doesn't touch it, so I left it alone.The moderation work is unchanged: timed mute and ban, slow mode, and the audit log with undo, now alongside
main's accounts, word filter, address bans, admin controls and camera hub.🤖 Generated with Claude Code
Continues #166