Skip to content

Consolidate admin navigation - #647

Merged
kentcdodds merged 2 commits into
mainfrom
cursor/consolidate-admin-navigation-6213
Jul 6, 2026
Merged

kentcdodds merged 2 commits into
mainfrom
cursor/consolidate-admin-navigation-6213

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Jul 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Centralizes /admin section links into one shared AdminPageHeader.
  • Renders the admin nav as a stable row below each admin page title/description.
  • Replaces per-page, inconsistent link fragments across Users, Invites, Roles, Community reports, Usage, and System email.

Walkthrough

admin-navigation-final-refreshed.mp4

Final state:

Admin system email page with shared navigation

Testing

  • npm run typecheck
  • npm run build:client
  • npx playwright test e2e/admin-rbac.spec.ts --workers=1
  • git push -u origin cursor/consolidate-admin-navigation-6213 (pre-push ran unit tests and full Playwright E2E: 185 unit files / 581 tests passed; 6 E2E passed)
  • Manual browser walkthrough verified all six admin pages keep the same nav order, position, and active state.
System recap — composes existing primitives (low risk)

Mode: recap · Base: main @ 17d545c · Head: 68bbda9

Classification: composes — no primitives added or changed; this PR reuses existing admin UI surfaces and shared UI components.

Primitives touched

Primitive Group Impact
app-ui surfaces composes — shared client admin header/navigation replaces duplicated page-local link markup

System map

flowchart LR
	appUi["app-ui"]:::touched
	rbac["rbac"]:::untouched
	appSessions["app-sessions"]:::untouched
	appSessions --> appUi
	rbac --> appUi
	classDef touched fill:#1a7f37,color:#fff
	classDef extended fill:#9a6700,color:#fff
	classDef added fill:#cf222e,color:#fff
	classDef untouched fill:#57606a,color:#fff
Loading

Before / after

Before After
Each admin route hand-rendered a different subset/order of header links. Admin routes render one shared AdminPageHeader with a complete, ordered nav row.
Long admin headers could place navigation differently from shorter pages. Navigation sits below the page title/description consistently across admin pages.
Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features

    • Added a unified admin page header with built-in navigation across Users, Invites, Roles, Community reports, Usage, and System email.
    • Admin pages now highlight the current section in the navigation for easier orientation.
  • UI Improvements

    • Updated admin page headers to use the new shared layout and removed duplicate header action links.
    • Simplified the admin experience with more consistent page titles, descriptions, and navigation across sections.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

A new AdminPageHeader component with a shared adminNavItems navigation configuration is added to render admin page titles, descriptions, and an active-highlighted navigation bar. Six admin routes (community reports, invites, roles, system email, usage, users) are updated to replace AccountManagementHeader and its inline action links with this new component.

Changes

AdminPageHeader consolidation

Layer / File(s) Summary
AdminPageHeader component and nav config
packages/worker/client/routes/account-management-components.tsx
Adds adminNavItems config, AdminPageHeaderProps type, and the exported AdminPageHeader component rendering title, description, and an active-state nav bar.
Community reports route wiring
packages/worker/client/routes/admin-community-reports.tsx
Swaps import and header render from AccountManagementHeader with inline actions to AdminPageHeader with currentHref.
Invites route wiring
packages/worker/client/routes/admin-invites.tsx
Swaps import and header render from AccountManagementHeader with inline actions to AdminPageHeader with currentHref.
Roles route wiring
packages/worker/client/routes/admin-roles.tsx
Removes getSecondaryButtonCss/secondaryButtonCss, updates imports, and replaces header actions with AdminPageHeader.
System email route wiring
packages/worker/client/routes/admin-system-email.tsx
Removes getSecondaryButtonCss/secondaryButtonCss, adjusts cardCss import, and swaps to AdminPageHeader.
Usage route wiring
packages/worker/client/routes/admin-usage.tsx
Reworks imports for AdminPageHeader/cardCss, removes secondaryButtonCss, and swaps header render.
Users route wiring
packages/worker/client/routes/admin-users.tsx
Swaps imports and replaces header actions with AdminPageHeader passing currentHref.

Estimated code review effort: 2 (Simple) | ~12 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Route as Admin Route
  participant Header as AdminPageHeader
  participant BaseHeader as AccountManagementHeader

  Route->>Header: render(title, description, currentHref)
  Header->>BaseHeader: render(title, description)
  Header->>Header: map adminNavItems, compare with currentHref
  Header-->>Route: nav bar with active item highlighted
Loading

Possibly related PRs

  • kentcdodds/kody#599: Overlaps with updates to the admin-community-reports route header/UI that this PR also modifies.
  • kentcdodds/kody#627: Overlaps with the admin header/navigation changes affecting admin-usage.tsx and related admin pages.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: consolidating admin navigation into a shared header.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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 cursor/consolidate-admin-navigation-6213

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

@kentcdodds
kentcdodds marked this pull request as ready for review July 6, 2026 18:59
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🔎 Preview deployed: https://kody-pr-647.kentcdodds.workers.dev

Worker: kody-pr-647
D1: kody-pr-647-db
KV: kody-pr-647-oauth-kv

Mocks:

@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.

🧹 Nitpick comments (1)
packages/worker/client/routes/account-management-components.tsx (1)

118-121: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Minor: prefer Array.includes over Array.some for exact-match membership check.

item.paths.some((path) => path === currentPath) is equivalent to item.paths.includes(currentPath) and reads more directly for an exact-value membership test.

♻️ Optional simplification
-						const isCurrent = item.paths.some((path) => path === currentPath)
+						const isCurrent = item.paths.includes(currentPath)

Also applies to: 132-134

🤖 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 `@packages/worker/client/routes/account-management-components.tsx` around lines
118 - 121, The membership checks in account-management-components.tsx use
Array.some for exact path equality, which can be simplified. Update the logic in
the relevant route-matching code near currentPath and item.paths to use
Array.includes instead of item.paths.some((path) => path === currentPath),
including the second occurrence referenced in the comment, so the intent is
clearer while preserving behavior.
🤖 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.

Nitpick comments:
In `@packages/worker/client/routes/account-management-components.tsx`:
- Around line 118-121: The membership checks in
account-management-components.tsx use Array.some for exact path equality, which
can be simplified. Update the logic in the relevant route-matching code near
currentPath and item.paths to use Array.includes instead of
item.paths.some((path) => path === currentPath), including the second occurrence
referenced in the comment, so the intent is clearer while preserving behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c4f24faf-1f75-489f-ac58-f8fd171e180f

📥 Commits

Reviewing files that changed from the base of the PR and between 36304ab and 68bbda9.

📒 Files selected for processing (7)
  • packages/worker/client/routes/account-management-components.tsx
  • packages/worker/client/routes/admin-community-reports.tsx
  • packages/worker/client/routes/admin-invites.tsx
  • packages/worker/client/routes/admin-roles.tsx
  • packages/worker/client/routes/admin-system-email.tsx
  • packages/worker/client/routes/admin-usage.tsx
  • packages/worker/client/routes/admin-users.tsx

@kentcdodds
kentcdodds merged commit 07d14bf into main Jul 6, 2026
8 checks passed
@kentcdodds
kentcdodds deleted the cursor/consolidate-admin-navigation-6213 branch July 6, 2026 19:21
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.

2 participants