feat: admin-only "All reviews" page #50
No reviewers
Labels
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
brooktrails/pr-reviewer!50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/admin-all-reviews"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds /admin/reviews — every recent primary review across the system,
not filtered to the viewing user's authored/reviewer involvement —
plus a header nav link visible only to dashboard admins.
The store gets an AllReviews(ctx, limit) method paralleling
ReviewsVisibleToUser but without the email filter. The handler
projects the same reviewRow shape, populating the new Author column.
A sibling template (admin_reviews_list.html) renders the table with
that extra column; the personal view stays the same.
Route is registered under the existing RequireAdmin group, so
non-admins hit "forbidden: admins only" if they manually navigate.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
Automated review by pr-reviewer v0.20.1 | Full Review | Claude Sonnet 4 | tracking id
r-f47d96-47d3bcThis is an AI-generated review and may contain mistakes.
Status: ✅ Completed
✅ Verdict: Approve — Well-structured admin feature that follows established patterns with proper access control.
Complexity: moderate
Code Review: feat: admin-only "All reviews" page
Summary
This PR adds a new admin-only
/admin/reviewspage that displays all recent reviews across the system, extending the existing dashboard with admin visibility into cross-team activity. The implementation follows the established patterns in the codebase well.✅ Strengths
Consistent Architecture
AllReviews()method intracker/dashboard.gomirrors the existingReviewsVisibleToUser()patternreviewRowstruct with a newAuthorfield for the admin viewProper Security
RequireAdminmiddleware group/admin/configsClean UI Integration
{{if .IsAdmin}})reviews_list.htmlwith the addition of the Author columnGood Code Organization
admin_handlers.gois logicalloadTemplates()📝 Minor Observations
Template Redundancy
The new
admin_reviews_list.htmltemplate is nearly identical toreviews_list.htmlexcept for the Author column. While this follows the current pattern, future refactoring could consider a shared template with conditional columns.Documentation
The code includes good inline documentation explaining the purpose and access restrictions of the new functionality.
🔍 Technical Details
Database Query
AllReviews()query is simple and efficient, filtering onlyis_primary = truetimestamp DESC)Data Flow
ReviewEventtoreviewRowe.AuthorEmailfor admin visibilityConclusion
This is a well-implemented feature that adds valuable admin functionality while maintaining code quality and consistency. The implementation is straightforward, follows established patterns, and includes proper access controls. No blocking issues identified.
📚 Context used in this review
Project guidance files:
CLAUDE.mdRepository fragments:
internal/dashboard/templates/reviews_list.html(entire file)internal/dashboard/middleware.go(internal/dashboard/middleware.go:83-96) — extracted in answer to: "the RequireAdmin middleware implementation that gates the new admin route"