Skip to content

feat(backoffice): an operator restores or clears a reported drawing - #443

Open
raphoester wants to merge 4 commits into
claude/map-drawing-reportsfrom
claude/backoffice-drawings
Open

raphoester wants to merge 4 commits into
claude/map-drawing-reportsfrom
claude/backoffice-drawings

Conversation

@raphoester

Copy link
Copy Markdown
Owner

The backoffice screens for reports of a drawing on the map, and the tools that undo one. Stacked on #442 (the backend): merge that one first.

What

  • A Drawings page under Moderation, beside Reports (src/drawings/): the open place reports first (ListPlaceReports with open_only), a switch for all. Each shows its reason (hate, sexual, other), the tile, the reporter's name, the text, the time, and its decision once decided.
  • The detail: "See it on the map ↗" opens https://clickplanet.lol/?tile=<id> in a new tab. One area for every tool: the tile and its rings, 8 by default (a bomb's blast), 1 to 50.
  • Restore (RestoreArea): as it was at a time, an hour before the report by default. The dry run says the tiles in the area, how many changed since, how far back the ledger reaches (then the field's min), and who painted it, by flag and name (GetAuthors, as the players list), each opening on the player page (OpenPlayer) to ban. Restore stays off until a dry run matches the rings and the time, asks with its count ("Put back the 12 tiles changed since …?"), and needs a new dry run after it.
  • A time older than the ledger (failed_precondition) says: "The ledger does not reach back to then: clear the area instead."
  • Clear (ClearArea): dry run (how many tiles a flag holds), then Clear, which asks with its count, on the same rule.
  • Close the report (DecidePlaceReport): Acted or Dismissed, with a comment. DecideForm now takes the call that decides, so a player's report and a place's share it.
  • FakeAdmin lists and closes place reports, and restores and clears as the server does (a time older than its keptSince is refused; a dry run changes nothing).
  • apps/backoffice/CLAUDE.md: a "Drawings" section.

Tests

  • drawings/actions.test.ts: the map link, the default time, each call's request and answer (restore, the painters named once, clear, close), the refusals in words, and the datetime-local round trip.
  • drawings/DrawingsPage.test.tsx (jsdom): open first and all, a decision shown, the map link in a new tab, restore only after a dry run and with its numbers, a new dry run needed once the area changes, the painters named and opened on the player page, the ledger refusal (with Clear still there), clear after its dry run, and closing the report.
  • 133 tests pass; lint, types and build pass. The player reports' tests pass with the shared DecideForm.
  • Preview against feat(moderation): a player reports a drawing and the operator undoes it #442's backend: a guest painted 6 tiles, another reported the drawing. The page listed it; the dry run said 178 tiles, 5 changed, the ledger back 3 days, one painter (🇩🇪 Unnamed, 5 takes); Restore asked "Put back the 5 tiles changed since …?" and answered "Restored 5 of 5 tiles."; a time 10 days back said the ledger does not reach back; Clear's dry run then said 0 held and stayed off. At 375px nothing scrolls sideways.

🤖 Generated with Claude Code

A Drawings page lists the reports of a drawing on the map, open ones
first. A report links the drawing on the map, restores its area as it
was before the report after a dry run that names who painted it, clears
an area older than the ledger, and closes the report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@raphoester
raphoester added this pull request to stack #444 October 20, 2026 16:06
raphoester and others added 3 commits October 21, 2026 01:08
)

* feat(backoffice): a report shows every message of the reported player

A report from a player's card names no message, so the operator could
not read what the player said. ListMessages takes an account id: that
account's messages alone, the cursors included. The report detail
lists them, newest first, and opens the conversation around each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(backoffice): an account's player page lists its chat messages

The player page counted an account's messages and could not show
them. It now lists them as a report does, newest first, each with the
conversation around it. Conversation and TheirMessages move to
src/chat, which both pages use. Off a report there is no reporter, so
the tags are optional, and the player page tags no line. Opening the
player already open keeps its row: its own name in its messages opens
it again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(backoffice): a reported player's messages show in conversations

Each message of the reported player came alone, its conversation
behind a click. The panel now reads the chat around each and shows
the conversations at once, three at a time. A message one already
holds needs none of its own, and two that touch join, so an exchange
is one conversation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… claude/backoffice-drawings

# Conflicts:
#	apps/backoffice/CLAUDE.md
…wings

# Conflicts:
#	apps/backoffice/CLAUDE.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant