fix: make admin panel responsive - #238
Conversation
📝 WalkthroughWalkthroughThe admin console now uses responsive spacing, controls, cards, tables, headers, and pagination. Account, project, and audit-log results provide mobile card layouts while retaining desktop table views. ChangesResponsive admin console
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: one or more packages not found in the registry. 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. Comment |
There was a problem hiding this comment.
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 `@apps/web/app/`(authenticated)/admin/accounts/page.tsx:
- Around line 107-124: Replace the controlled native search forms with
react-hook-form configured through zodResolver and the corresponding schema from
`@repo/contracts`: use the account-search schema in
apps/web/app/(authenticated)/admin/accounts/page.tsx (107-124), the
project-search schema in apps/web/app/(authenticated)/admin/projects/page.tsx
(105-122), and the audit-log-search schema in
apps/web/app/(authenticated)/admin/logs/page.tsx (78-95). Submit each form
through handleSubmit and preserve the existing page-reset behavior in the valid
submit handlers.
🪄 Autofix
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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: caa62ef7-f929-491c-83b0-9fd8e2a57130
📒 Files selected for processing (8)
apps/web/app/(authenticated)/admin/accounts/page.tsxapps/web/app/(authenticated)/admin/layout.tsxapps/web/app/(authenticated)/admin/logs/page.tsxapps/web/app/(authenticated)/admin/page.tsxapps/web/app/(authenticated)/admin/projects/page.tsxapps/web/app/(authenticated)/layout.tsxapps/web/components/admin/admin-ui.tsxapps/web/components/top-navbar.tsx
| <form | ||
| className="flex flex-1 flex-col gap-2 sm:flex-row" | ||
| onSubmit={submitSearch} | ||
| > | ||
| <Input | ||
| value={searchInput} | ||
| onChange={(event) => setSearchInput(event.target.value)} | ||
| placeholder="Search email, name, organization, or GitHub username" | ||
| aria-label="Search accounts" | ||
| /> | ||
| <Button type="submit" variant="outline"> | ||
| <Button | ||
| type="submit" | ||
| variant="outline" | ||
| className="w-full sm:w-auto" | ||
| > | ||
| Search | ||
| </Button> | ||
| </form> |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift
Use the required form pattern.
Replace these controlled native forms with react-hook-form and zodResolver. Pass each schema from @repo/contracts. Keep the page-reset behavior in the valid submit handler.
apps/web/app/(authenticated)/admin/accounts/page.tsx#L107-L124: Use the account-search schema andhandleSubmit.apps/web/app/(authenticated)/admin/projects/page.tsx#L105-L122: Use the project-search schema andhandleSubmit.apps/web/app/(authenticated)/admin/logs/page.tsx#L78-L95: Use the audit-log-search schema andhandleSubmit.
As per coding guidelines: apps/web/app/**/*.tsx: Use react-hook-form with zodResolver for forms, passing the schema from @repo/contracts.
📍 Affects 3 files
apps/web/app/(authenticated)/admin/accounts/page.tsx#L107-L124(this comment)apps/web/app/(authenticated)/admin/projects/page.tsx#L105-L122apps/web/app/(authenticated)/admin/logs/page.tsx#L78-L95
🤖 Prompt for 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.
In `@apps/web/app/`(authenticated)/admin/accounts/page.tsx around lines 107 - 124,
Replace the controlled native search forms with react-hook-form configured
through zodResolver and the corresponding schema from `@repo/contracts`: use the
account-search schema in apps/web/app/(authenticated)/admin/accounts/page.tsx
(107-124), the project-search schema in
apps/web/app/(authenticated)/admin/projects/page.tsx (105-122), and the
audit-log-search schema in apps/web/app/(authenticated)/admin/logs/page.tsx
(78-95). Submit each form through handleSubmit and preserve the existing
page-reset behavior in the valid submit handlers.
Source: Coding guidelines
Description
Link to issue or ticket
N/A
Steps to QA
/adminat mobile, tablet, and desktop widths./admin/accounts,/admin/projects, and/admin/logson a mobile viewport and confirm each item is displayed as a readable card.Automated checks:
npm test --workspace=api -- --runInBandnpx turbo run lintnpx turbo run check-typesnpm run format:checkScreenshots
N/A
Summary by CodeRabbit