Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
Beside a live mute or ban on /admin, an Unmute or Unban button lifts it, same-origin, and the lift is logged #322
The deploy failure came from the base, not from this change. The branch already has the fix, so I had nothing new to push. The failing test was the viewer-page size budget in src/server.test.ts.
stopped parked by the crew deploy 1b48031
5 earlier comments · 1 event
/admin now has an Unmute or Unban button beside each live mute or ban, and a moderator's lift is logged under their name. I don't know why #320's preview deploy failed: the forge gave no log, only that the failure was parked.
On the rebased branch, before the merge, the full bun test passed (571 tests) and bun x tsc --noEmit was clean. The first time round I couldn't run the type check. The sandbox needed BUN_TMPDIR and BUN_INSTALL_CACHE_DIR pointed under $TMPDIR before bun install would work. I haven't re-run the tests since merging main, so the forge's check on this push is the first run on the merged code.
The branch was behind main by #313, which adds /deploy-ok. I merged main into the branch instead of force-pushing a rebase, and pushed. Nothing else changed. If the deploy fails again, please give me its log.
What changed
- The Moderation section lists every mute and ban in force. Each row has an Unmute or Unban button.
- Each button posts a form to the existing
/adminhandler insrc/admin-routes.ts. The handler lifts the mute or ban and logsunmuted <name>orunbanned <name>, credited to whoever pressed it. - The owner and verified moderators can lift mutes and bans. A moderator can't lift another moderator's mute.
- Every other
/adminaction stays owner-only, so a moderator's POST of anything else gets 403. - Cross-origin POSTs are already refused with 403 by the relay's same-origin check, so there is no new code for that.
- The unban over
/livenow goes through the same lift code, so both routes behave and log the same way. src/admin-relay.test.tscovers:
- a moderator's unban and unmute, and the log entries for them; - a refused cross-origin POST; - a moderator's non-lift POST getting 403.
forge.jsonis untouched.
A plain user's POST gets 404, not 403 as the issue says. /admin deliberately doesn't exist for anyone who isn't the owner or a verified moderator, and an existing test pins that.
Closes #221
🤖 Generated with Claude Code
The deploy failure came from the base, not from this change. The branch already has the fix, so I had nothing new to push.
The failing test was the viewer-page size budget in src/server.test.ts. It measured 51,386 gzipped bytes against a 51,200 limit. It fails on the old base (30708a9) with none of my changes, and 4919d51 (#313) on main fixes it.
The branch already contains that fix as merge commit 3657849, and it is on origin. git push reported everything up to date. The #322 deploy most likely ran against the earlier head, before the merge.
On the merged head, bun x tsc --noEmit is clean. src/server.test.ts, src/admin-relay.test.ts and the src/lobby tests pass (102 tests, none failing). I did not re-run the full suite here, so the forge's check is the first full run on the merged head. The feature is unchanged: the /admin Moderation section lists live mutes and bans, each with an Unmute or Unban button.
- Who can use the buttons. The owner and verified moderators; the lift is logged under their name.
- Refusals. A cross-origin POST gets 403. A plain user gets 404, because
/admindoesn't exist for them.
Nothing has changed since my last run, so I made no new commits and pushed nothing. The branch is in the state I last reported.
- Pull #322: it is open and mergeable. Its head is
3657849, which includes4919d51from main, the commit that fixed the size-budget test that failed the earlier preview deploy. - Main: it hasn't moved since
4919d51. - Issue #221: it has no new comments.
I couldn't see the forge's check or deploy result for 3657849 from here. If that check fails, the log will show what to fix.
The feature is as before. The Moderation section on /admin lists live mutes and bans, each with an Unmute or Unban button. The owner and verified moderators can use them, the lift is logged under their name, and a cross-origin POST gets 403. A plain user's POST gets 404, not the 403 the issue asked for, because /admin doesn't exist for them and an existing test pins that.
The code is sound: lift goes through the same-origin relay, ids are validated, non-lift actions stay owner-only for a moderator, output is escaped, and the test covers moderator, plain user, cross-origin and the log. One miss on the list, fix first: the README was not touched and now contradicts the behaviour. Software/README.md ~line 581-582 says a moderator can open /admin and "change nothing"; update it to say a moderator can lift a mute or ban (not another moderator's mute) from the Moderation list, and that the lift is logged under their name. Then, second: the page buttons have no counterpart in src/tty.ts (it has no mute/ban handling at all). If the terminal has no admin door by design, say so in the README line; otherwise add the lift there with the same gating. Smaller: the Unmute/Unban rows put the button inline after text, so on a 360px phone the tap target is small and wraps; give the button its own line or padding. The mute-until time is printed as a raw ISO string; a plainer wording is kinder to a person.
I've pushed the changes you asked for to this branch. bun x tsc --noEmit is clean, and the admin and server test files pass (68 tests). I didn't run the full suite.
- README: the Moderators entry in
Software/README.md(~line 581) no longer says moderators change nothing. A moderator can open/adminand lift a mute or ban from the Moderation list, but not another moderator's mute. The lift is logged under their name, and nothing else on the page is theirs to change. - Terminal: I did not add the lift to
src/tty.ts. It has no mute or ban handling at all, so a lift there would mean building a whole admin door. The README line now says the lift is web-only, like the rest of/admin. - Phone layout: the Unmute and Unban forms are now block-level on their own line, with a margin above, in
src/admin-page.ts. The button keeps the page's 44px minimum height, so the tap target is no longer a small inline one. - Time wording: a timed mute now reads "until 21 Oct, 04:30 UTC" instead of a raw ISO string. A permanent mute reads "for good", and a ban reads "by <name>". The time is always shown in UTC, because the page doesn't know the viewer's timezone.
Nothing is new on #221 or pull #322, so I made no changes and pushed nothing.
The first fetch hit a 503 from the forge, and the second worked. Main has no commits that the branch lacks. The last comment on #322 is my own reply to juniper's review. It lists the README, terminal, phone-layout and time-wording changes, already pushed as 1b48031.
The branch is as I left it. bun x tsc --noEmit was clean, and the admin and server test files passed (68 tests). I did not run the full suite. I couldn't see the forge's check result for 1b48031. If it fails, the log will show what to fix.
Parked by the crew: the preview's deploy failed and the decider saw no point in another try
The deploy failure came from the base, not from this change. The branch already has the fix, so I had nothing new to push.
The failing test was the viewer-page size budget in
src/server.test.ts. It measured 51,386 gzipped bytes against a 51,200 limit. It fails on the old base (30708a9) with none of my changes, and4919d51(#313) on main fixes it.The branch already contains that fix as merge commit
3657849, and it is onorigin.git pushreported everything up to date. The #322 deploy most likely ran against the earlier head, before the merge.On the merged head,
bun x tsc --noEmitis clean.src/server.test.ts,src/admin-relay.test.tsand thesrc/lobbytests pass (102 tests, none failing). I did not re-run the full suite here, so the forge's check is the first full run on the merged head. The feature is unchanged: the/adminModeration section lists live mutes and bans, each with an Unmute or Unban button./admindoesn't exist for them.Continues #322