Files
nuzlocke-tracker/.beans/nuzlocke-tracker-2fp1--show-owner-info-in-admin-pages.md
Julian Tabel 4ca5f9263c chore: mark owner info in admin pages beans as completed
The implementation was already complete and merged - just needed
the beans marked as done after agent crash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 10:08:23 +01:00

2.3 KiB

title, status, type, priority, tags, created_at, updated_at, parent
title status type priority tags created_at updated_at parent
Show owner info in admin pages completed feature normal
-failed
failed
2026-03-21T12:18:51Z 2026-03-22T09:08:07Z nuzlocke-tracker-wwnu

Problem

Admin pages (AdminRuns.tsx, AdminGenlockes.tsx) don't show which user owns each run or genlocke. This makes it hard for admins to manage content.

Approach

Backend

  • The /api/runs list endpoint already returns run data — verify it includes owner (id + email). If not, add it to the response schema.
  • For genlockes, ownership is inferred from the first leg's run owner. Add an owner field to the genlocke list response that resolves from the first leg's run.

Frontend

  • AdminRuns.tsx: Add an "Owner" column showing the owner's email (or "No owner" for legacy runs)
  • AdminGenlockes.tsx: Add an "Owner" column showing the inferred owner from the first leg's run
  • Add owner filter dropdown to both pages

Files to modify

  • backend/src/app/api/runs.py — verify owner is included in list response
  • backend/src/app/api/genlockes.py — add owner resolution to list endpoint
  • backend/src/app/schemas/genlocke.py — add owner field to GenlockeListItem
  • frontend/src/pages/admin/AdminRuns.tsx — add Owner column + filter
  • frontend/src/pages/admin/AdminGenlockes.tsx — add Owner column + filter
  • frontend/src/types/game.ts — update types if needed

Checklist

  • Verify runs list API includes owner info; add if missing
  • Add owner resolution to genlocke list endpoint (from first leg's run)
  • Update GenlockeListItem schema to include owner
  • Add Owner column to AdminRuns.tsx
  • Add Owner column to AdminGenlockes.tsx
  • Add owner filter to both admin pages

Summary of Changes

The "show owner info in admin pages" feature was fully implemented:

Backend:

  • Genlocke list API now includes owner info resolved from the first leg's run
  • Added GenlockeOwnerResponse schema with id and display_name fields

Frontend:

  • AdminRuns.tsx: Added Owner column showing email/display name with "No owner" fallback
  • AdminGenlockes.tsx: Added Owner column with same pattern
  • Both pages include owner filter dropdown with "All owners", "No owner", and per-user options

Commit: a3f332f feat: show owner info in admin pages