Rebuild game reviews in Laravel #54

Open
opened 2024-01-14 14:49:43 -06:00 by jimmyb · 1 comment
Owner

The Game Reviews feature needs to be rebuilt in Laravel so users can write, edit, delete, browse, and publish reviews for games.

The current app has a public sidebar link to `/reviews`, an admin "Pending Game Reviews" placeholder, merge logic references for future review records, and Recent Gamer Updates support for `game_review_published`. This issue tracks building the full review surface, moderation workflow, public listing, review achievement badges, and test coverage.

Pending-review moderation requirements from #72 are consolidated into this issue. That work remains outstanding. The existing content-report queue at /admin/content-moderation/pending moderates flags on profiles/comments; it does not satisfy game-review approval requirements. Its retained admin.reviews.pending route name must not be mistaken for an implemented game-review approval queue.

Scope

  • Authenticated game review creation, editing, and deletion.
  • Public reviews index page at `/reviews`, paginated.
  • Public single-review pages.
  • User profile sections for recently published reviews.
  • Game profile sections or links for reviews tied to a game.
  • Admin dashboard workflow for pending review moderation.
  • Recent Gamer Updates integration when a review is published.
  • Enable the existing code-managed game-review and review-comment badge series:
    • First Game Review; 10, 25, 50, and 100 published game reviews.
    • First Comment on a Game Review; 10, 25, 50, and 100 comments on distinct game reviews.
  • Automatic, idempotent badge evaluation and a targeted/backfill path for the review badge criteria.
  • Authorization, validation, visibility, empty states, and safe rendering.

Acceptance Criteria

  • Authenticated users can create a review for an active game.
  • Review authors can edit and delete their own reviews.
  • Users cannot edit or delete another user's review unless an explicit admin/moderator policy is added.
  • Reviews require validated title/body/rating-style fields according to the chosen review schema.
  • Public `/reviews` shows published reviews newest-first and paginated.
  • Public review pages render the review author, game, platform, review content, score/rating where applicable, and published timestamp.
  • Draft, deleted, rejected, or pending reviews are not shown publicly.
  • Banned, deleted, or soft-deleted users do not expose public review content.
  • Deleted/disabled games do not expose public review pages or review list entries.
  • User profiles can show recent published reviews with clear empty states.
  • Pending-review moderation satisfies the detailed requirements below, including approve/reject behavior and public visibility changes.
  • Publishing a review records a `game_review_published` gamer update with working user/game/review links where available.
  • Publishing or moderating a review evaluates the review badges and returns newly earned badges through the existing flash/JSON feedback conventions.
  • Review badges count only published, non-deleted reviews. Review-comment badges count only active, non-deleted comments on distinct review IDs; drafts, pending/rejected reviews, soft-deleted records, and repeated comments on the same review do not inflate progress.
  • Badge persistence remains idempotent, disabled placeholders remain unavailable until their related review capability is implemented, and the existing badge backfill command can recalculate review criteria for all or targeted users.
  • User-facing UI supports light/dark mode and follows the existing Laravel/Tailwind site layout patterns.

Pending-review moderation acceptance criteria (consolidated from #72)

  • Authorized content/game-review staff can visit /admin/reviews/pending and see a real queue instead of the placeholder.
  • The queue uses a clearly defined review table/model and approval status field.
  • Only reviews needing staff review appear in the pending queue.
  • Approved, rejected, deleted, or already-processed reviews do not appear in the pending queue.
  • Each row shows enough context to triage the review, including game, author, submitted date, and review title or excerpt.
  • Each row links to the full review detail or edit/review screen.
  • Staff can approve a pending review and remove it from the pending queue.
  • Staff can reject or dismiss a pending review without publishing it.
  • Staff decisions are logged with actor, review ID, outcome, and timestamp.
  • Non-staff users and staff without the required moderation role cannot access or mutate pending review records.
  • The queue paginates results and has a clear empty state.
  • The page follows existing admin dashboard styling and supports light/dark mode.

Test Coverage Required

  • Feature tests for review create, edit, delete, validation, ownership authorization, and guest restrictions.
  • Feature tests for public reviews index pagination, ordering, empty state, and filtering of draft/pending/deleted records.
  • Feature tests for single-review rendering, missing review, deleted user, banned user, and disabled/deleted game cases.
  • Admin pending-review moderation has the detailed focused coverage below, including public visibility changes.
  • Regression tests for profile recent-review display, sidebar `/reviews` active state, and Recent Gamer Updates `game_review_published` output.
  • Badge evaluator tests for every enabled published-review and distinct-review-comment threshold, idempotency, backfill, action feedback, and soft-deleted/draft/pending/rejected records never counting.
  • Tests should use Pest and focused feature coverage.
  • Run the focused affected tests, then run `vendor/bin/pint --dirty` before closing the issue.

Pending-review moderation test coverage (consolidated from #72)

  • Feature test confirming authorized staff can render /admin/reviews/pending.
  • Authorization tests confirming insufficient-role users cannot access or process pending reviews.
  • Feature test confirming pending reviews render in the queue with game and author context.
  • Feature test confirming non-pending reviews are excluded.
  • Feature test confirming approval updates the review state and removes it from the pending queue.
  • Feature test confirming rejection/dismissal updates the review state without publishing it.
  • Validation tests for invalid review moderation actions.
  • Activity/audit logging assertions for approve and reject outcomes where practical.
  • Pagination and empty-state tests.
  • Regression tests confirming public review links or profile review placeholders are not broken by the admin queue work.

Progress Checklist

  • Public sidebar link to `/reviews` exists
  • Admin pending reviews placeholder route/view exists
  • Admin sidebar links to pending game reviews
  • Recent Gamer Updates presenter supports `game_review_published`
  • Add review persistence tables/models
  • Add routes and controllers/actions for review index, show, create, edit, update, and delete
  • Build public reviews index and single-review pages
  • Build authenticated review create/edit/delete UI
  • Build admin pending-review moderation workflow
  • Add recent published reviews to user profiles
  • Wire reviews into relevant game profile surfaces
  • Record review publish events in Recent Gamer Updates
  • Enable and evaluate the existing game-review and distinct-review-comment badge series
  • Add review-badge backfill coverage and action-feedback integration
  • Add tests for CRUD, visibility, moderation, profile display, activity updates, badge evaluation, and authorization
  • Confirm the game reviews feature matches expected data coverage
The Game Reviews feature needs to be rebuilt in Laravel so users can write, edit, delete, browse, and publish reviews for games. The current app has a public sidebar link to \`/reviews\`, an admin "Pending Game Reviews" placeholder, merge logic references for future review records, and Recent Gamer Updates support for \`game_review_published\`. This issue tracks building the full review surface, moderation workflow, public listing, review achievement badges, and test coverage. Pending-review moderation requirements from [#72](https://code.myvideogamelist.com/MyVideoGameList/myvideogamelist.com/issues/72) are consolidated into this issue. That work remains outstanding. The existing content-report queue at `/admin/content-moderation/pending` moderates flags on profiles/comments; it does not satisfy game-review approval requirements. Its retained `admin.reviews.pending` route name must not be mistaken for an implemented game-review approval queue. ## Scope - Authenticated game review creation, editing, and deletion. - Public reviews index page at \`/reviews\`, paginated. - Public single-review pages. - User profile sections for recently published reviews. - Game profile sections or links for reviews tied to a game. - Admin dashboard workflow for pending review moderation. - Recent Gamer Updates integration when a review is published. - Enable the existing code-managed game-review and review-comment badge series: - First Game Review; 10, 25, 50, and 100 published game reviews. - First Comment on a Game Review; 10, 25, 50, and 100 comments on distinct game reviews. - Automatic, idempotent badge evaluation and a targeted/backfill path for the review badge criteria. - Authorization, validation, visibility, empty states, and safe rendering. ## Acceptance Criteria - Authenticated users can create a review for an active game. - Review authors can edit and delete their own reviews. - Users cannot edit or delete another user's review unless an explicit admin/moderator policy is added. - Reviews require validated title/body/rating-style fields according to the chosen review schema. - Public \`/reviews\` shows published reviews newest-first and paginated. - Public review pages render the review author, game, platform, review content, score/rating where applicable, and published timestamp. - Draft, deleted, rejected, or pending reviews are not shown publicly. - Banned, deleted, or soft-deleted users do not expose public review content. - Deleted/disabled games do not expose public review pages or review list entries. - User profiles can show recent published reviews with clear empty states. - Pending-review moderation satisfies the detailed requirements below, including approve/reject behavior and public visibility changes. - Publishing a review records a \`game_review_published\` gamer update with working user/game/review links where available. - Publishing or moderating a review evaluates the review badges and returns newly earned badges through the existing flash/JSON feedback conventions. - Review badges count only published, non-deleted reviews. Review-comment badges count only active, non-deleted comments on distinct review IDs; drafts, pending/rejected reviews, soft-deleted records, and repeated comments on the same review do not inflate progress. - Badge persistence remains idempotent, disabled placeholders remain unavailable until their related review capability is implemented, and the existing badge backfill command can recalculate review criteria for all or targeted users. - User-facing UI supports light/dark mode and follows the existing Laravel/Tailwind site layout patterns. ### Pending-review moderation acceptance criteria (consolidated from #72) - Authorized content/game-review staff can visit `/admin/reviews/pending` and see a real queue instead of the placeholder. - The queue uses a clearly defined review table/model and approval status field. - Only reviews needing staff review appear in the pending queue. - Approved, rejected, deleted, or already-processed reviews do not appear in the pending queue. - Each row shows enough context to triage the review, including game, author, submitted date, and review title or excerpt. - Each row links to the full review detail or edit/review screen. - Staff can approve a pending review and remove it from the pending queue. - Staff can reject or dismiss a pending review without publishing it. - Staff decisions are logged with actor, review ID, outcome, and timestamp. - Non-staff users and staff without the required moderation role cannot access or mutate pending review records. - The queue paginates results and has a clear empty state. - The page follows existing admin dashboard styling and supports light/dark mode. ## Test Coverage Required - Feature tests for review create, edit, delete, validation, ownership authorization, and guest restrictions. - Feature tests for public reviews index pagination, ordering, empty state, and filtering of draft/pending/deleted records. - Feature tests for single-review rendering, missing review, deleted user, banned user, and disabled/deleted game cases. - Admin pending-review moderation has the detailed focused coverage below, including public visibility changes. - Regression tests for profile recent-review display, sidebar \`/reviews\` active state, and Recent Gamer Updates \`game_review_published\` output. - Badge evaluator tests for every enabled published-review and distinct-review-comment threshold, idempotency, backfill, action feedback, and soft-deleted/draft/pending/rejected records never counting. - Tests should use Pest and focused feature coverage. - Run the focused affected tests, then run \`vendor/bin/pint --dirty\` before closing the issue. ### Pending-review moderation test coverage (consolidated from #72) - Feature test confirming authorized staff can render `/admin/reviews/pending`. - Authorization tests confirming insufficient-role users cannot access or process pending reviews. - Feature test confirming pending reviews render in the queue with game and author context. - Feature test confirming non-pending reviews are excluded. - Feature test confirming approval updates the review state and removes it from the pending queue. - Feature test confirming rejection/dismissal updates the review state without publishing it. - Validation tests for invalid review moderation actions. - Activity/audit logging assertions for approve and reject outcomes where practical. - Pagination and empty-state tests. - Regression tests confirming public review links or profile review placeholders are not broken by the admin queue work. ## Progress Checklist - [x] Public sidebar link to \`/reviews\` exists - [x] Admin pending reviews placeholder route/view exists - [x] Admin sidebar links to pending game reviews - [x] Recent Gamer Updates presenter supports \`game_review_published\` - [ ] Add review persistence tables/models - [ ] Add routes and controllers/actions for review index, show, create, edit, update, and delete - [ ] Build public reviews index and single-review pages - [ ] Build authenticated review create/edit/delete UI - [ ] Build admin pending-review moderation workflow - [ ] Add recent published reviews to user profiles - [ ] Wire reviews into relevant game profile surfaces - [ ] Record review publish events in Recent Gamer Updates - [ ] Enable and evaluate the existing game-review and distinct-review-comment badge series - [ ] Add review-badge backfill coverage and action-feedback integration - [ ] Add tests for CRUD, visibility, moderation, profile display, activity updates, badge evaluation, and authorization - [ ] Confirm the game reviews feature matches expected data coverage
Codex changed title from Rebuild Game Reviews Component in Laravel to Rebuild game reviews in Laravel 2026-05-25 21:53:53 -05:00
Member

Added the public /reviews placeholder route and page so the existing sidebar link resolves while the full game reviews rebuild remains tracked here. Covered by a focused feature test for rendering and sidebar active state.

Added the public /reviews placeholder route and page so the existing sidebar link resolves while the full game reviews rebuild remains tracked here. Covered by a focused feature test for rendering and sidebar active state.
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MyVideoGameList/myvideogamelist.com#54
No description provided.