Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

/admin shows the moderation actions from the admin log, newest first, with who and when - read-only #228

Parked opened this
Closed without merging

/admin now has a Moderation section above the existing Log. It lists the log entries for removals, mutes, bans and their reversals, newest first. Each row shows who did it and when.

Notes

stopped parked by the crew deploy 6839199

opened this

/admin now has a Moderation section above the existing Log. It lists the log entries for removals, mutes, bans and their reversals, newest first. Each row shows who did it and when. It shows to the owner and to moderators. I couldn't run the type check: bun x tsc --noEmit failed here with "unable to write files to tempdir: ReadOnlyFileSystem". The new tests and the existing src/admin* tests pass (14 tests), but I did not run the full bun test. The forge's check on this push will run both.

  • What it matches: the section filters the entries by what they say, so it shows lines starting with removed, deleted, muted, unmuted, banned or unbanned.
  • What the log has today: the lobby only logs banned X and unbanned X. Mutes and chat-line deletions aren't written to the log yet, so they won't appear until something records them. The mute-length text from the issue isn't there for the same reason.
  • Other log lines: "took control" and "word filter" lines stay out of this section and remain in Log.
  • Scope: escaping goes through the page's existing esc. There are no new routes, forge.json is untouched, and the main page is unchanged.
  • Tests: the new src/admin-page.test.ts covers newest-first order, a name like <img onerror=x> rendering escaped, and the empty case. I did not add a test for a plain user getting no /admin; the existing src/admin-relay.test.ts already checks that.

The change is in src/admin-page.ts.

🤖 Generated with Claude Code

Closes #220

commented

Parked by the crew: the preview's deploy failed in the place it ran, not in the change, and it could not be run again

commented

The preview failure wasn't caused by this change, so I made no code change. I pushed an empty commit to trigger the deploy again. I haven't seen that deploy's result yet.

The install step got HTTP 429 (rate limit) from registry.npmjs.org on every package. The branch only touches src/admin-page.ts and a new src/admin-page.test.ts, with no dependency or package.json changes. If the retry hits 429 again, it needs a person to re-run it once the registry stops limiting.

/admin gets a Moderation section above the existing Log. It lists the admin-log entries for removals, mutes, bans and their reversals, newest first, with who and when. Names and text are escaped.

The lobby only logs banned X and unbanned X today. Mutes and chat-line deletions don't appear until something records them.

The new tests cover newest-first order, <img onerror> rendering escaped, and the empty case. The src/admin* tests pass (14). A plain user still gets 404 on /admin, which src/admin-relay.test.ts already checks. I couldn't run the type check here: bun x tsc --noEmit fails with a read-only temp directory error.

🤖 Generated with Claude Code

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs