Skip to content

Add registry-driven admin navigation system#334

Merged
ddon merged 2 commits intoBeamLabEU:devfrom
mdon:dev
Feb 14, 2026
Merged

Add registry-driven admin navigation system#334
ddon merged 2 commits intoBeamLabEU:devfrom
mdon:dev

Conversation

@mdon
Copy link

@mdon mdon commented Feb 14, 2026

TL;DR

Replaces ~800 lines of hardcoded admin sidebar HTML with a config-driven Tab registry (same system the user dashboard uses). Admin tabs now support permission gating, badges, subtabs, sub-subtabs, and parent
app customization — all without touching PhoenixKit source. Parent apps add custom admin pages via :admin_dashboard_tabs config with automatic route generation.

Summary

  • Replace ~800 lines of hardcoded admin sidebar HEEX with a registry-driven Tab system matching the user dashboard architecture
  • Add permission gating, dynamic entity/publishing children, sub-subtab support, and parent app customization via :admin_dashboard_tabs config
  • Optimize sidebar rendering: lightweight entity queries (no preloads), cached publishing settings, removed ~400 lines of dead layout helpers

Key files

  • lib/phoenix_kit/dashboard/admin_tabs.ex — ~50 default admin tabs as Tab structs
  • lib/phoenix_kit_web/components/dashboard/admin_sidebar.ex — new component with recursive descendant active state
  • lib/phoenix_kit/dashboard/registry.ex — level-based filtering, permission + module checks
  • lib/phoenix_kit_web/components/layout_wrapper.ex — removed hardcoded nav + publishing helpers
  • lib/phoenix_kit_web/integration.ex — auto-route generation for custom admin LiveViews
  • lib/phoenix_kit/dashboard/ADMIN_README.md — full documentation with custom page guide

Replace ~800 lines of hardcoded admin sidebar HEEX with a registry-driven
Tab system matching the user dashboard architecture. Includes permission
gating, dynamic entity/publishing children, sub-subtab support, parent
app customization via :admin_dashboard_tabs config, and documentation.

Key changes:
- AdminTabs: ~50 default admin tabs as Tab structs with permission fields
- AdminSidebar: new component with recursive descendant active state
- Registry: level-based filtering (admin/user), permission + module checks
- TabItem: configurable subtab indent (Tailwind classes or inline CSS)
- LayoutWrapper: removed ~400 lines of hardcoded nav + publishing helpers
- Integration: auto-route generation for custom admin LiveViews
- Entities sidebar: lightweight select query (no preloads)
- Publishing.enabled?: uses cached boolean settings
- Documentation: ADMIN_README, integration guide, CLAUDE.md updated
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ddon ddon merged commit a0b4506 into BeamLabEU:dev Feb 14, 2026
6 checks passed
timujinne added a commit to timujinne/phoenix_kit that referenced this pull request Feb 14, 2026
Merge changes from BeamLabEU/phoenix_kit upstream/dev branch.

Key changes from upstream:
- Add registry-driven admin navigation system (replaces manual nav items)
- Add new admin_sidebar component for modular navigation
- Refactor invoice_detail.ex into submodules to fix slow compilation
- Add admin_tabs.ex for new tab system
- Update dashboard registry and documentation
- Prep for v1.7.36 release

Conflict resolution:
- Accepted upstream version of layout_wrapper.ex (use new admin_sidebar component)
- Replaced manual navigation (1600+ lines) with registry-driven approach (7 lines)

Upstream commits merged:
- a0b4506 Merge pull request BeamLabEU#334 from mdon/dev
- 5c3861a Fix Credo nested module alias warning in dashboard registry
- 5547184 Add registry-driven admin navigation system
- 31ac72a Prep for 1.7.36 release
- 936b560 Refactor invoice_detail.ex into submodules
ddon pushed a commit that referenced this pull request Feb 14, 2026
Add review files for registry-driven admin navigation system:
- AI_REVIEW.md: Original comprehensive review by Claude (7.5/10)
- ADDITIONAL_REVIEW.md: Supplemental findings by Mistral (8/10)
- FINAL_REVIEW.md: Additional security/testing findings by Kimi (8/10)
- ACTION_ITEMS.md: Consolidated TODO list with priorities

Also update CLAUDE.md with PR review file conventions.

Key findings across all reviews:
- Critical: Missing permission filtering tests
- Critical: Entities query needs caching (DB hit every render)
- Critical: Silent broadcast failures need logging
- High: Fix admin_page?/1 path matching
- High: Add error logging to rescue clauses
- Medium: Extract shared sidebar helpers
- Medium: Add telemetry instrumentation
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