Skip to content

feat(moderation): a player reports a drawing and the operator undoes it - #442

Open
raphoester wants to merge 3 commits into
mainfrom
claude/map-drawing-reports
Open

raphoester wants to merge 3 commits into
mainfrom
claude/map-drawing-reports

Conversation

@raphoester

Copy link
Copy Markdown
Owner

A player can now report a drawing on the map, and the operator can undo it. This is the backend and the game; the back office screens come next, in their own PR.

The player

  • "Report a drawing" in Settings, beside Feedback. The next tap on the globe picks the tile instead of painting it. A banner says so, with Cancel; Escape cancels too.
  • The tile opens a dialog: "A hateful symbol or words", "Something sexual" or "Something else", and optional details.
  • support.v1.SupportService/ReportPlace(tile_id, reason, text), under the support limiter.
  • ?tile=<id> opens the globe close up on that tile. The back office will link reports with it.

The operator

  • ListPlaceReports and DecidePlaceReport, as for player reports. A place report is its own table. When the reporter's account is deleted, or the retention passes, the report stays and loses its reporter.
  • One decision rule for both kinds of report: decisions.Decision[R], two tables.
  • planet.v1.AdminService/RestoreArea(tile_id, rings, before, dry_run): the area is the tiles within rings tile spacings of the tile (1 to 50; a bomb is 8). It answers who painted the area since before, and puts each tile back as it was then. A dry run comes first.
    • The check is against the owner each tile holds when the restore runs, as a revert does. A tile somebody takes during the restore stays theirs.
    • The ledger in memory keeps 72 hours, so an older before is refused.
  • ClearArea(tile_id, rings, dry_run) gives every owned tile of the area to nobody, for a drawing older than the ledger keeps.
  • Every call is logged at Warn, dry runs included. deploy/vps/README.md has the console commands.

Known limits

  • A reassign, a paint or a revert writes no ledger event, so RestoreArea cannot rewind what one of them changed.
  • The ledger in memory keeps whole seconds, so before is cut to its second.

Tests

  • Unit tests for the area, the rewind, both use cases, the place reports and the generic decisions.
  • e2e/map_drawing_test.go: paint a tile over a flag, see the painter in a dry run, restore, clear; report a drawing, list it, close it; a deleted reporter.
  • Game: the dialog, the tile link, and the whole flow checked in the browser in fake mode.

🤖 Generated with Claude Code

raphoester and others added 2 commits October 20, 2026 17:35
- support.v1.SupportService/ReportPlace: a player taps a tile of the
  drawing and picks a reason; ListPlaceReports and DecidePlaceReport
  for the operator. The reporter goes with its account, the notice
  stays. Decisions are one rule for both kinds of report
- planet.v1.AdminService/RestoreArea: who painted the area around a
  tile since a time, and puts it back as it was then, dry run first
- planet.v1.AdminService/ClearArea: gives the area to nobody, for a
  drawing older than the ledger keeps
- The game: "Report a drawing" in Settings, then a tap on the globe;
  ?tile=<id> opens the globe close up on a tile

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

# Conflicts:
#	apps/backend/generated/proto/planet/v1/admin.pb.go
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