Skip to content

Address admin and profile UI TODOs#431

Merged
Producdevity merged 3 commits into
stagingfrom
chore/admin-profile-ui-improvements
Jun 5, 2026
Merged

Address admin and profile UI TODOs#431
Producdevity merged 3 commits into
stagingfrom
chore/admin-profile-ui-improvements

Conversation

@Producdevity

@Producdevity Producdevity commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Description

Addresses several small TODOs tracked in #411:

  • replaces the social connections loading spinner with a row-shaped skeleton state
  • types device/SOC preferences with UseQueryResult
  • removes stale badge pagination and Eden 0.25x mapping TODOs
  • assigns the Developer seed user to seeded emulators for local developer-role testing
  • wires performance scale replacement through the backend before deleting an in-use scale

Part of #411

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactor
  • Other (please describe): Seeder and admin workflow cleanup

How Has This Been Tested?

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

Ran:

  • git diff --check
  • ./node_modules/.bin/eslint prisma/seed.ts prisma/seeders/usersSeeder.ts src/app/admin/performance/components/ReplacementSelectionModal.tsx src/app/admin/performance/page.tsx src/app/admin/performance/types.ts src/app/admin/users/components/UserBadgeModal.tsx src/app/profile/components/DeviceAndSocPreferences.tsx src/app/profile/components/connections/SocialConnectionList.tsx src/schemas/performanceScale.ts src/server/api/routers/performanceScales.ts src/server/repositories/performance-scales.repository.ts src/server/utils/emulator-config/eden/eden.defaults.ts
  • ./node_modules/.bin/prettier --check prisma/seed.ts prisma/seeders/usersSeeder.ts src/app/admin/performance/components/ReplacementSelectionModal.tsx src/app/admin/performance/page.tsx src/app/admin/performance/types.ts src/app/admin/users/components/UserBadgeModal.tsx src/app/profile/components/DeviceAndSocPreferences.tsx src/app/profile/components/connections/SocialConnectionList.tsx src/schemas/performanceScale.ts src/server/api/routers/performanceScales.ts src/server/repositories/performance-scales.repository.ts src/server/utils/emulator-config/eden/eden.defaults.ts
  • DATABASE_URL=postgresql://postgres:postgres@localhost:5432/emuready ./node_modules/.bin/prisma validate

Attempted:

  • pnpm types (blocked before TypeScript because pnpm tried to purge the symlinked worktree node_modules without a TTY)
  • ./node_modules/.bin/tsc --noEmit --pretty false after plain Prisma client generation (blocked by existing missing TypedSQL @orm/sql output and SegaSaturnIcon.png module resolution outside this change)
  • ./node_modules/.bin/prisma generate --sql (blocked because TypedSQL requires a reachable local database)

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

The trust-logs AdminStatsDisplay item from #411 was handled in #426. The mobile API-key enforcement TODO is intentionally left for a separate decision because it changes public mobile API access behavior.

Summary by CodeRabbit

  • New Features

    • Allow deleting a performance scale by selecting a replacement so related items are reassigned instead of blocking deletion
  • UI/UX Improvements

    • Show counts on performance scales listing for clearer visibility
    • Require an explicit replacement selection and disable the delete action until chosen
    • Replace generic loading spinners with configurable skeletons across profile and social lists
  • Bug Fixes

    • Prevent selecting the same scale as its own replacement (validation)

@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 5, 2026 12:19am

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: 68dd56ac-07d4-49c0-8b33-e8452c4fb50f

📥 Commits

Reviewing files that changed from the base of the PR and between 3e90539 and 6856de9.

📒 Files selected for processing (1)
  • src/server/repositories/performance-scales.repository.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/server/repositories/performance-scales.repository.ts

Walkthrough

This PR seeds a developer user and assigns emulators, adds replacement-aware deletion for performance scales with count-aware UI gating, replaces loading spinners with skeleton UIs in social connection lists, refactors profile component typings to UseQueryResult, and removes several inline comments.

Changes

Developer Seed Setup & Emulator Assignment

Layer / File(s) Summary
Seed order reorganization and developer user data
prisma/seed.ts, prisma/seeders/usersSeeder.ts
Seeding order changed so emulatorsSeeder runs after systemsSeeder and before usersSeeder. The usersSeeder now includes a developer user object in its seed list.
Emulator assignment and user cleanup for developers
prisma/seeders/usersSeeder.ts
usersSeeder precomputes seed emails for cleanup, deletes matching verifiedDeveloper rows, and introduces assignDeveloperEmulators to upsert verifiedDeveloper records for the seeded developer across all emulators in a transaction.

Performance Scale Replacement Feature

Layer / File(s) Summary
Type contracts and validation schema
src/app/admin/performance/types.ts, src/schemas/performanceScale.ts
PerformanceScale gains optional _count with listings and pcListings; DeletePerformanceScaleSchema accepts optional replacementId and enforces it differs from the deleted id.
Repository with replacement-aware deletion and filtered listing
src/server/repositories/performance-scales.repository.ts
Adds deleteByNumericIdWithReplacement that reassigns dependent listing/pcListing rows in a single transaction, validates replacement constraints via AppError.badRequest, and changes listWithCounts to accept filters and return counts.
Router, modal, and page integration for replacement flow
src/server/api/routers/performanceScales.ts, src/app/admin/performance/components/ReplacementSelectionModal.tsx, src/app/admin/performance/page.tsx
Adds getWithCounts TRPC query, updates delete to accept replacementId, requires a selected replacement in the modal before deletion, and makes the admin page compute combined listings count to open the replacement modal when needed while invalidating getWithCounts on changes.

Social Connection List Skeleton Loading

Layer / File(s) Summary
SocialConnectionList skeleton UI foundation
src/app/profile/components/connections/SocialConnectionList.tsx
Replaces LoadingSpinner with a SocialConnectionListSkeleton, adds optional props showActionSkeleton, actionSkeletonClassName, and skeletonRows, and updates imports to Pagination and Skeleton.
Skeleton config for BlockedList, FollowersList, and FriendsList
src/app/profile/components/connections/BlockedList.tsx, src/app/profile/components/connections/FollowersList.tsx, src/app/profile/components/connections/FriendsList.tsx
Each component configures SocialConnectionList with per-variant actionSkeletonClassName and skeletonRows derived from page limits.

Profile Component Typing and Query Management

Layer / File(s) Summary
DeviceAndSocPreferences type and logic cleanup
src/app/profile/components/DeviceAndSocPreferences.tsx
preferencesQuery prop typed as UseQueryResult<UserPreferencesData, unknown>, debounced bulk update handlers call mutations directly in timeouts, and several inline/JSX comments were removed.
UserBadgeModal conditional query execution
src/app/admin/users/components/UserBadgeModal.tsx
Badge list and per-user badge queries are now conditionally enabled via the enabled option, guarded by modal open state and presence of a user id.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

🚥 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 'Address admin and profile UI TODOs' accurately summarizes the main change—resolving multiple UI and configuration TODOs across admin and profile components.
Description check ✅ Passed The PR description is well-structured, covering all template sections with clear context about the changes, testing performed, and relevant issue references.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 chore/admin-profile-ui-improvements
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch chore/admin-profile-ui-improvements

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/server/repositories/performance-scales.repository.ts`:
- Around line 109-111: The duplicate-ID validation currently calls
AppError.badRequest(...) but doesn't throw it, so the check is ineffective;
update the conditional handling where replacementId === id to throw the error
(e.g., throw AppError.badRequest('Replacement performance scale must be
different from the deleted scale')) so the request fails as intended and
execution stops in the method that contains the replacementId/id check.
🪄 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: fc48f83a-ae8d-43ef-8343-70bc9496b80d

📥 Commits

Reviewing files that changed from the base of the PR and between f923851 and 3e90539.

📒 Files selected for processing (15)
  • prisma/seed.ts
  • prisma/seeders/usersSeeder.ts
  • src/app/admin/performance/components/ReplacementSelectionModal.tsx
  • src/app/admin/performance/page.tsx
  • src/app/admin/performance/types.ts
  • src/app/admin/users/components/UserBadgeModal.tsx
  • src/app/profile/components/DeviceAndSocPreferences.tsx
  • src/app/profile/components/connections/BlockedList.tsx
  • src/app/profile/components/connections/FollowersList.tsx
  • src/app/profile/components/connections/FriendsList.tsx
  • src/app/profile/components/connections/SocialConnectionList.tsx
  • src/schemas/performanceScale.ts
  • src/server/api/routers/performanceScales.ts
  • src/server/repositories/performance-scales.repository.ts
  • src/server/utils/emulator-config/eden/eden.defaults.ts
💤 Files with no reviewable changes (2)
  • src/app/admin/users/components/UserBadgeModal.tsx
  • src/server/utils/emulator-config/eden/eden.defaults.ts

Comment thread src/server/repositories/performance-scales.repository.ts
@Producdevity Producdevity merged commit 1c6dfdc into staging Jun 5, 2026
8 checks passed
@Producdevity Producdevity deleted the chore/admin-profile-ui-improvements branch June 5, 2026 07:53
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