Skip to content

Standardize admin page layouts#426

Merged
Producdevity merged 5 commits into
stagingfrom
refactor/admin-page-layout-standardization
Jun 4, 2026
Merged

Standardize admin page layouts#426
Producdevity merged 5 commits into
stagingfrom
refactor/admin-page-layout-standardization

Conversation

@Producdevity

@Producdevity Producdevity commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Description

Updates the remaining admin pages called out in the issue to use the shared AdminPageLayout wrapper for their title, description, and header actions.

Also aligns Trust Logs with shared admin primitives by using AdminErrorState for full-page query failures and AdminStatsDisplay for the stats summary. This removes the custom TrustStatsOverview component and its dynamic import, while preserving the same displayed metrics.

Fixes #376
Follow-up for #411

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactor
  • Other (please describe):

How Has This Been Tested?

  • Local build
  • Lint
  • Typecheck
  • Unit tests
  • Manual testing

Ran:

  • git diff --check
  • ./node_modules/.bin/eslint src/app/admin/brands/page.tsx src/app/admin/cpus/page.tsx src/app/admin/socs/page.tsx src/app/admin/trust-logs/page.tsx
  • ./node_modules/.bin/prettier --check src/app/admin/brands/page.tsx src/app/admin/cpus/page.tsx src/app/admin/socs/page.tsx src/app/admin/trust-logs/page.tsx
  • ./node_modules/.bin/eslint src/app/admin/cpus/page.tsx
  • ./node_modules/.bin/prettier --check src/app/admin/cpus/page.tsx
  • ./node_modules/.bin/eslint src/app/admin/trust-logs/page.tsx src/lib/dynamic-imports.tsx src/components/admin/AdminStatsDisplay.tsx
  • ./node_modules/.bin/prettier --check src/app/admin/trust-logs/page.tsx src/lib/dynamic-imports.tsx src/components/admin/AdminStatsDisplay.tsx

Attempted:

  • ./node_modules/.bin/tsc --noEmit --pretty false (blocked by existing missing generated @orm/@orm/client modules and unrelated type errors)

Screenshots (if applicable)

N/A

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • Documentation changes are not needed for this change
  • I have checked that all checks (lint, typecheck, test) pass

Notes for reviewers

This keeps the existing page table behavior intact while standardizing the page shell, error state, and stats display.

Summary by CodeRabbit

  • Refactor

    • Admin pages now use a unified admin layout for consistent titles, descriptions and header actions (column visibility plus conditional "Add" buttons).
  • Bug Fixes

    • Trust Logs error UI improved with a clearer error state and a retry action; header controls moved into the unified layout.
  • New Features

    • Trust statistics presentation updated; a new role/permission matrix component is available via dynamic loading.

@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
emuready Ready Ready Preview, Comment Jun 4, 2026 7:00pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8eccabb2-2c09-47ea-a29c-7a4ffd16840d

📥 Commits

Reviewing files that changed from the base of the PR and between 33f9555 and ac117c1.

📒 Files selected for processing (3)
  • src/app/admin/trust-logs/components/TrustStatsOverview.tsx
  • src/app/admin/trust-logs/page.tsx
  • src/lib/dynamic-imports.tsx
💤 Files with no reviewable changes (2)
  • src/app/admin/trust-logs/components/TrustStatsOverview.tsx
  • src/lib/dynamic-imports.tsx

Walkthrough

Four admin pages (brands, cpus, socs, and trust-logs) are refactored to use the shared AdminPageLayout component instead of custom container markup. Each page supplies title, description, and headerActions via the layout. The trust-logs page also replaces its inline error UI with AdminErrorState.

Changes

Admin Page Layout Standardization

Layer / File(s) Summary
Standardize brands page to AdminPageLayout
src/app/admin/brands/page.tsx
Import AdminPageLayout with multi-line destructuring and replace manual container/header markup with AdminPageLayout wrapper, moving title/description and header actions (column visibility and "Add Brand" button) into props.
Standardize cpus page to AdminPageLayout
src/app/admin/cpus/page.tsx
Import AdminPageLayout and replace the root layout structure with the layout component, wiring title, description, and header actions (column visibility and conditional "Add CPU" button).
Standardize socs page to AdminPageLayout
src/app/admin/socs/page.tsx
Import AdminPageLayout and replace custom header/container markup with the layout component, supplying title, description, and header actions (column visibility and permission-gated "Add SoC" button).
Standardize trust-logs page to AdminPageLayout with improved error handling
src/app/admin/trust-logs/page.tsx, src/lib/dynamic-imports.tsx
Update imports to include AdminPageLayout and AdminErrorState, replace inline error rendering with AdminErrorState (with refetch callback), compute trustedPlusUsers from trustStatsQuery.data.levelDistribution, replace TrustStatsOverview usage with AdminStatsDisplay, and update dynamic exports (remove TrustStatsOverview, add RolePermissionMatrix).

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main refactoring objective—standardizing admin page layouts using a shared AdminPageLayout component.
Description check ✅ Passed The description covers the main objectives, change type, testing performed, and notes for reviewers, with all key sections completed.
Linked Issues check ✅ Passed The PR directly addresses all refactoring requirements from issue #376: all four flagged files (brands, cpus, socs, trust-logs) have been updated to use AdminPageLayout.
Out of Scope Changes check ✅ Passed The removal of TrustStatsOverview and addition of RolePermissionMatrix are aligned with standardizing admin page components and do not introduce unrelated functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/admin-page-layout-standardization
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch refactor/admin-page-layout-standardization

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/app/admin/cpus/page.tsx`:
- Around line 141-143: Update the user-facing description string used alongside
title="CPUs" (the metadata/props block that currently reads description="Manage
all CPU models for PC compatibility listings") to use the approved terminology;
replace that value with "Manage all CPU models for the PC Compatibility Report"
so the UI uses "PC Compatibility Report" instead of "listings". Ensure the
change is made where the description prop/string is defined (adjacent to
title="CPUs" and headerActions).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 30b034b7-8df8-402e-91ea-90b7c68ff918

📥 Commits

Reviewing files that changed from the base of the PR and between e2cca97 and a80d4c7.

📒 Files selected for processing (4)
  • src/app/admin/brands/page.tsx
  • src/app/admin/cpus/page.tsx
  • src/app/admin/socs/page.tsx
  • src/app/admin/trust-logs/page.tsx

Comment thread src/app/admin/cpus/page.tsx
@Producdevity Producdevity merged commit f923851 into staging Jun 4, 2026
8 checks passed
@Producdevity Producdevity deleted the refactor/admin-page-layout-standardization branch June 4, 2026 19:17
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.

refactor: standardize admin pages to use AdminPageLayout

1 participant