feat(admin-parity): approval management, submission viewer, role builder offline fallback
- Rebuilt approval.tsx: reject with reason prompt, request changes with field
keys, request more documents flow, RoleTypeBadge per role type, parsed
requestReason (ONBOARDING_SUBMISSION prefix), management page routing for
approved items, inline ApprovalDetailPanel with remarks timeline
- Rebuilt approval/[id].tsx: full onboarding submission viewer loading from
GET /api/admin/approvals/submission/{user_id}?roleKey=X, flattenFields
recursive flattener, detectKind image/pdf/document/url/text classifier,
image lightbox, PDF iframe modal, approve/reject per role type routing
- Added src/lib/admin-modules.ts: STATIC_PERMISSIONS fallback (39 modules x4
actions) for Internal Role Builder when backend is offline
- roles/create.tsx + roles/[id]/edit.tsx: use STATIC_PERMISSIONS when API
returns empty or fails, builder now works offline
- AdminShell + AdminSidebar: alignment/style fixes from parity review
- ExternalRoleForm: extended fields for external runtime role management
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 00:34:38 +01:00
|
|
|
import { A, useLocation, useNavigate, useSearchParams } from '@solidjs/router';
|
2026-03-24 02:36:40 +01:00
|
|
|
import { For, createEffect, createMemo, createSignal, onCleanup, onMount, type JSX } from 'solid-js';
|
2026-03-16 23:20:54 +01:00
|
|
|
import AdminSidebar from './AdminSidebar';
|
2026-03-20 22:37:17 +01:00
|
|
|
import { isExternalIdentity } from '~/lib/admin-auth';
|
feat(admin-parity): approval management, submission viewer, role builder offline fallback
- Rebuilt approval.tsx: reject with reason prompt, request changes with field
keys, request more documents flow, RoleTypeBadge per role type, parsed
requestReason (ONBOARDING_SUBMISSION prefix), management page routing for
approved items, inline ApprovalDetailPanel with remarks timeline
- Rebuilt approval/[id].tsx: full onboarding submission viewer loading from
GET /api/admin/approvals/submission/{user_id}?roleKey=X, flattenFields
recursive flattener, detectKind image/pdf/document/url/text classifier,
image lightbox, PDF iframe modal, approve/reject per role type routing
- Added src/lib/admin-modules.ts: STATIC_PERMISSIONS fallback (39 modules x4
actions) for Internal Role Builder when backend is offline
- roles/create.tsx + roles/[id]/edit.tsx: use STATIC_PERMISSIONS when API
returns empty or fails, builder now works offline
- AdminShell + AdminSidebar: alignment/style fixes from parity review
- ExternalRoleForm: extended fields for external runtime role management
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 00:34:38 +01:00
|
|
|
import { clearAdminSession, hasAdminSession, setAdminSession } from '~/lib/admin-session';
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
import { Bell } from 'lucide-solid';
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
|
|
|
|
|
type Tab = { href: string; label: string; exact?: boolean };
|
|
|
|
|
|
|
|
|
|
const TAB_SETS: Array<{ prefixes: string[]; tabs: Tab[] }> = [
|
|
|
|
|
{
|
|
|
|
|
prefixes: ['/admin/roles'],
|
|
|
|
|
tabs: [
|
2026-03-24 02:36:40 +01:00
|
|
|
{ href: '/admin/roles', label: 'Roles', exact: true },
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
{ href: '/admin/roles/create', label: 'Create Role' },
|
2026-03-24 02:36:40 +01:00
|
|
|
{ href: '/admin/roles/templates', label: 'View Roles' },
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prefixes: ['/admin/runtime-roles'],
|
|
|
|
|
tabs: [
|
2026-03-24 02:36:40 +01:00
|
|
|
{ href: '/admin/runtime-roles', label: 'Roles', exact: true },
|
|
|
|
|
{ href: '/admin/runtime-roles/new', label: 'Create Role' },
|
|
|
|
|
{ href: '/admin/role-ui-configs', label: 'View Roles' },
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
];
|
2026-03-16 23:20:54 +01:00
|
|
|
|
|
|
|
|
export default function AdminShell(props: { children: JSX.Element }) {
|
2026-03-19 03:36:46 +01:00
|
|
|
const location = useLocation();
|
|
|
|
|
const navigate = useNavigate();
|
feat(admin-parity): approval management, submission viewer, role builder offline fallback
- Rebuilt approval.tsx: reject with reason prompt, request changes with field
keys, request more documents flow, RoleTypeBadge per role type, parsed
requestReason (ONBOARDING_SUBMISSION prefix), management page routing for
approved items, inline ApprovalDetailPanel with remarks timeline
- Rebuilt approval/[id].tsx: full onboarding submission viewer loading from
GET /api/admin/approvals/submission/{user_id}?roleKey=X, flattenFields
recursive flattener, detectKind image/pdf/document/url/text classifier,
image lightbox, PDF iframe modal, approve/reject per role type routing
- Added src/lib/admin-modules.ts: STATIC_PERMISSIONS fallback (39 modules x4
actions) for Internal Role Builder when backend is offline
- roles/create.tsx + roles/[id]/edit.tsx: use STATIC_PERMISSIONS when API
returns empty or fails, builder now works offline
- AdminShell + AdminSidebar: alignment/style fixes from parity review
- ExternalRoleForm: extended fields for external runtime role management
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 00:34:38 +01:00
|
|
|
const [searchParams] = useSearchParams();
|
2026-03-19 03:36:46 +01:00
|
|
|
const [checkedSession, setCheckedSession] = createSignal(false);
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
const [adminName, setAdminName] = createSignal('Admin');
|
2026-03-24 02:36:40 +01:00
|
|
|
const [sidebarOpen, setSidebarOpen] = createSignal(false);
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
const [sidebarCollapsed, setSidebarCollapsed] = createSignal(false);
|
2026-03-24 02:36:40 +01:00
|
|
|
const [tabsTrackEl, setTabsTrackEl] = createSignal<HTMLDivElement>();
|
|
|
|
|
const [tabRefs, setTabRefs] = createSignal<Record<string, HTMLAnchorElement>>({});
|
|
|
|
|
const [tabIndicator, setTabIndicator] = createSignal({ left: 0, width: 0, ready: false });
|
2026-03-19 03:36:46 +01:00
|
|
|
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
const tabs = createMemo<Tab[]>(() => {
|
|
|
|
|
const path = location.pathname;
|
|
|
|
|
for (const set of TAB_SETS) {
|
2026-03-24 02:36:40 +01:00
|
|
|
if (set.prefixes.some((p) => path === p || path.startsWith(`${p}/`))) return set.tabs;
|
2026-03-19 03:36:46 +01:00
|
|
|
}
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
return [];
|
|
|
|
|
});
|
|
|
|
|
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
const isTabActive = (tab: Tab) =>
|
|
|
|
|
tab.exact
|
|
|
|
|
? location.pathname === tab.href
|
|
|
|
|
: location.pathname === tab.href || location.pathname.startsWith(`${tab.href}/`);
|
2026-03-19 03:36:46 +01:00
|
|
|
|
2026-03-24 02:36:40 +01:00
|
|
|
const refreshTabIndicator = () => {
|
|
|
|
|
const activeTab = tabs().find((tab) => isTabActive(tab));
|
|
|
|
|
const track = tabsTrackEl();
|
|
|
|
|
if (!activeTab || !track) {
|
|
|
|
|
setTabIndicator((prev) => ({ ...prev, ready: false }));
|
|
|
|
|
return;
|
2026-03-19 13:50:20 +01:00
|
|
|
}
|
2026-03-24 02:36:40 +01:00
|
|
|
const el = tabRefs()[activeTab.href];
|
|
|
|
|
if (!el) return;
|
|
|
|
|
setTabIndicator({ left: el.offsetLeft, width: el.offsetWidth, ready: true });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
createEffect(() => {
|
|
|
|
|
tabs();
|
|
|
|
|
location.pathname;
|
|
|
|
|
requestAnimationFrame(refreshTabIndicator);
|
2026-03-19 13:50:20 +01:00
|
|
|
});
|
|
|
|
|
|
2026-03-19 03:36:46 +01:00
|
|
|
onMount(() => {
|
2026-03-24 02:36:40 +01:00
|
|
|
const onResize = () => refreshTabIndicator();
|
|
|
|
|
window.addEventListener('resize', onResize);
|
|
|
|
|
onCleanup(() => window.removeEventListener('resize', onResize));
|
|
|
|
|
|
2026-03-23 21:13:42 +01:00
|
|
|
const isLocalDev =
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
typeof window !== 'undefined' &&
|
|
|
|
|
(window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1');
|
feat(admin-parity): approval management, submission viewer, role builder offline fallback
- Rebuilt approval.tsx: reject with reason prompt, request changes with field
keys, request more documents flow, RoleTypeBadge per role type, parsed
requestReason (ONBOARDING_SUBMISSION prefix), management page routing for
approved items, inline ApprovalDetailPanel with remarks timeline
- Rebuilt approval/[id].tsx: full onboarding submission viewer loading from
GET /api/admin/approvals/submission/{user_id}?roleKey=X, flattenFields
recursive flattener, detectKind image/pdf/document/url/text classifier,
image lightbox, PDF iframe modal, approve/reject per role type routing
- Added src/lib/admin-modules.ts: STATIC_PERMISSIONS fallback (39 modules x4
actions) for Internal Role Builder when backend is offline
- roles/create.tsx + roles/[id]/edit.tsx: use STATIC_PERMISSIONS when API
returns empty or fails, builder now works offline
- AdminShell + AdminSidebar: alignment/style fixes from parity review
- ExternalRoleForm: extended fields for external runtime role management
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 00:34:38 +01:00
|
|
|
const isPreview =
|
|
|
|
|
searchParams._preview === '1' ||
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
(typeof sessionStorage !== 'undefined' &&
|
|
|
|
|
sessionStorage.getItem('nxtgauge_admin_preview') === '1');
|
feat(admin-parity): approval management, submission viewer, role builder offline fallback
- Rebuilt approval.tsx: reject with reason prompt, request changes with field
keys, request more documents flow, RoleTypeBadge per role type, parsed
requestReason (ONBOARDING_SUBMISSION prefix), management page routing for
approved items, inline ApprovalDetailPanel with remarks timeline
- Rebuilt approval/[id].tsx: full onboarding submission viewer loading from
GET /api/admin/approvals/submission/{user_id}?roleKey=X, flattenFields
recursive flattener, detectKind image/pdf/document/url/text classifier,
image lightbox, PDF iframe modal, approve/reject per role type routing
- Added src/lib/admin-modules.ts: STATIC_PERMISSIONS fallback (39 modules x4
actions) for Internal Role Builder when backend is offline
- roles/create.tsx + roles/[id]/edit.tsx: use STATIC_PERMISSIONS when API
returns empty or fails, builder now works offline
- AdminShell + AdminSidebar: alignment/style fixes from parity review
- ExternalRoleForm: extended fields for external runtime role management
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 00:34:38 +01:00
|
|
|
|
2026-03-23 21:13:42 +01:00
|
|
|
if (isPreview || isLocalDev) {
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
if (typeof sessionStorage !== 'undefined')
|
|
|
|
|
sessionStorage.setItem('nxtgauge_admin_preview', '1');
|
feat(admin-parity): approval management, submission viewer, role builder offline fallback
- Rebuilt approval.tsx: reject with reason prompt, request changes with field
keys, request more documents flow, RoleTypeBadge per role type, parsed
requestReason (ONBOARDING_SUBMISSION prefix), management page routing for
approved items, inline ApprovalDetailPanel with remarks timeline
- Rebuilt approval/[id].tsx: full onboarding submission viewer loading from
GET /api/admin/approvals/submission/{user_id}?roleKey=X, flattenFields
recursive flattener, detectKind image/pdf/document/url/text classifier,
image lightbox, PDF iframe modal, approve/reject per role type routing
- Added src/lib/admin-modules.ts: STATIC_PERMISSIONS fallback (39 modules x4
actions) for Internal Role Builder when backend is offline
- roles/create.tsx + roles/[id]/edit.tsx: use STATIC_PERMISSIONS when API
returns empty or fails, builder now works offline
- AdminShell + AdminSidebar: alignment/style fixes from parity review
- ExternalRoleForm: extended fields for external runtime role management
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 00:34:38 +01:00
|
|
|
setAdminSession();
|
|
|
|
|
setCheckedSession(true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-20 22:37:17 +01:00
|
|
|
const verify = async () => {
|
|
|
|
|
if (!hasAdminSession()) {
|
|
|
|
|
const from = encodeURIComponent(location.pathname + location.search);
|
|
|
|
|
navigate(`/login?from=${from}`, { replace: true });
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try {
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
const accessToken =
|
|
|
|
|
typeof sessionStorage !== 'undefined'
|
|
|
|
|
? sessionStorage.getItem('nxtgauge_admin_access_token') || ''
|
|
|
|
|
: '';
|
2026-03-20 22:37:17 +01:00
|
|
|
const response = await fetch('/api/gateway/users/auth/me', {
|
|
|
|
|
method: 'GET',
|
|
|
|
|
headers: {
|
|
|
|
|
Accept: 'application/json',
|
|
|
|
|
'x-portal-target': 'admin',
|
2026-03-23 21:13:42 +01:00
|
|
|
...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}),
|
2026-03-20 22:37:17 +01:00
|
|
|
},
|
|
|
|
|
credentials: 'include',
|
|
|
|
|
});
|
|
|
|
|
const payload = await response.json().catch(() => ({}));
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
if (!response.ok || isExternalIdentity(payload)) throw new Error('Unauthorized');
|
|
|
|
|
if (payload?.full_name) setAdminName(payload.full_name);
|
2026-03-20 22:37:17 +01:00
|
|
|
setCheckedSession(true);
|
|
|
|
|
} catch {
|
|
|
|
|
clearAdminSession();
|
|
|
|
|
const from = encodeURIComponent(location.pathname + location.search);
|
|
|
|
|
navigate(`/login?from=${from}`, { replace: true });
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void verify();
|
2026-03-19 03:36:46 +01:00
|
|
|
});
|
|
|
|
|
|
2026-03-20 22:37:17 +01:00
|
|
|
const onLogout = async () => {
|
|
|
|
|
await fetch('/api/gateway/users/auth/logout', {
|
|
|
|
|
method: 'POST',
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
headers: { Accept: 'application/json', 'x-portal-target': 'admin' },
|
2026-03-20 22:37:17 +01:00
|
|
|
credentials: 'include',
|
|
|
|
|
}).catch(() => {});
|
2026-03-19 03:36:46 +01:00
|
|
|
clearAdminSession();
|
2026-03-23 21:13:42 +01:00
|
|
|
if (typeof sessionStorage !== 'undefined') {
|
|
|
|
|
sessionStorage.removeItem('nxtgauge_admin_access_token');
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
sessionStorage.removeItem('nxtgauge_admin_preview');
|
2026-03-23 21:13:42 +01:00
|
|
|
}
|
2026-03-19 03:36:46 +01:00
|
|
|
navigate('/login', { replace: true });
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-24 02:36:40 +01:00
|
|
|
const adminInitials = createMemo(() => {
|
|
|
|
|
const parts = adminName().split(' ').map((s) => s.trim()).filter(Boolean);
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
if (parts.length === 0) return 'U';
|
|
|
|
|
if (parts.length === 1) return parts[0].slice(0, 1).toUpperCase();
|
|
|
|
|
return `${parts[0][0] || ''}`.toUpperCase();
|
2026-03-24 02:36:40 +01:00
|
|
|
});
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
const sidebarWidth = () => (sidebarCollapsed() ? 'w-20' : 'w-64');
|
|
|
|
|
|
2026-03-16 23:20:54 +01:00
|
|
|
return (
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
<div class="min-h-screen bg-white">
|
|
|
|
|
{/* ── Header ── */}
|
|
|
|
|
<header class="fixed inset-x-0 top-0 z-50 flex h-16 w-full items-center justify-between border-b border-gray-200 bg-white px-6 shadow-sm">
|
|
|
|
|
{/* Left: logo + role title */}
|
|
|
|
|
<div class="flex items-center gap-8">
|
|
|
|
|
<A href="/admin" class="flex h-10 items-center">
|
|
|
|
|
<img src="/nxtgauge-logo.png" alt="NXTGAUGE" class="h-9 w-auto object-contain" />
|
|
|
|
|
</A>
|
|
|
|
|
<h1 class="text-base font-semibold text-gray-800">Super Admin</h1>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Mobile menu button */}
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
class="inline-flex h-9 w-9 items-center justify-center rounded-lg text-slate-600 hover:bg-slate-100 lg:hidden"
|
|
|
|
|
onClick={() => setSidebarOpen((v) => !v)}
|
|
|
|
|
aria-label="Toggle sidebar"
|
|
|
|
|
>
|
|
|
|
|
<svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
|
|
|
|
<path stroke-linecap="round" d="M4 7h16M4 12h16M4 17h16" />
|
|
|
|
|
</svg>
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
{/* Right: bell + avatar + logout */}
|
|
|
|
|
<div class="hidden items-center gap-6 lg:flex">
|
|
|
|
|
{/* Bell */}
|
|
|
|
|
<div class="relative">
|
2026-03-24 02:36:40 +01:00
|
|
|
<button
|
|
|
|
|
type="button"
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
aria-label="Notifications"
|
|
|
|
|
class="relative rounded-full p-2 text-gray-500 transition-colors hover:bg-gray-100"
|
2026-03-24 02:36:40 +01:00
|
|
|
>
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
<Bell size={20} />
|
2026-03-24 02:36:40 +01:00
|
|
|
</button>
|
|
|
|
|
</div>
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
{/* Avatar + name */}
|
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
|
<button class="flex items-center gap-3 rounded-lg p-1 pr-2 transition-colors hover:bg-gray-100">
|
|
|
|
|
<div class="flex h-8 w-8 items-center justify-center overflow-hidden rounded-full border border-orange-200 bg-orange-100 text-sm font-semibold text-orange-700">
|
2026-03-24 02:36:40 +01:00
|
|
|
{adminInitials()}
|
|
|
|
|
</div>
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
<div class="flex flex-col items-start">
|
|
|
|
|
<span class="mb-0.5 text-xs font-semibold leading-none text-gray-700">{adminName()}</span>
|
|
|
|
|
<span class="text-[10px] leading-none text-gray-500">Super Admin</span>
|
|
|
|
|
</div>
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
{/* Logout */}
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={onLogout}
|
|
|
|
|
class="rounded-lg p-1.5 text-gray-500 transition-colors hover:bg-red-50 hover:text-red-600"
|
|
|
|
|
aria-label="Sign out"
|
|
|
|
|
>
|
|
|
|
|
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" />
|
|
|
|
|
</svg>
|
|
|
|
|
</button>
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
</div>
|
2026-03-19 03:36:46 +01:00
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
{/* ── Body ── */}
|
2026-03-19 03:36:46 +01:00
|
|
|
{checkedSession() ? (
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
<div class="fixed inset-0 top-16 flex">
|
|
|
|
|
{/* Mobile overlay */}
|
2026-03-24 02:36:40 +01:00
|
|
|
<div
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
class={`absolute inset-0 z-20 bg-black/30 transition-opacity lg:hidden ${sidebarOpen() ? 'pointer-events-auto opacity-100' : 'pointer-events-none opacity-0'}`}
|
2026-03-24 02:36:40 +01:00
|
|
|
onClick={() => setSidebarOpen(false)}
|
|
|
|
|
/>
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
{/* Sidebar */}
|
|
|
|
|
<div
|
|
|
|
|
class={`absolute inset-y-0 left-0 z-30 -translate-x-full transition-transform duration-200 lg:static lg:translate-x-0 ${sidebarOpen() ? 'translate-x-0' : ''}`}
|
|
|
|
|
>
|
|
|
|
|
<AdminSidebar
|
|
|
|
|
collapsed={sidebarCollapsed()}
|
|
|
|
|
onToggle={() => setSidebarCollapsed((v) => !v)}
|
|
|
|
|
onNavigate={() => setSidebarOpen(false)}
|
|
|
|
|
onLogout={onLogout}
|
|
|
|
|
/>
|
2026-03-24 02:36:40 +01:00
|
|
|
</div>
|
|
|
|
|
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
{/* Main */}
|
|
|
|
|
<main class="scrollbar min-w-0 flex-1 overflow-y-auto bg-gray-50 p-6">
|
2026-03-24 02:36:40 +01:00
|
|
|
<ShowTabs
|
|
|
|
|
tabs={tabs()}
|
|
|
|
|
isTabActive={isTabActive}
|
|
|
|
|
setTabsTrackEl={setTabsTrackEl}
|
|
|
|
|
setTabRefs={setTabRefs}
|
|
|
|
|
tabIndicator={tabIndicator}
|
|
|
|
|
/>
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
{props.children}
|
2026-03-19 03:36:46 +01:00
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
<div class="fixed inset-0 top-16 flex">
|
|
|
|
|
<div class="hidden w-64 border-r border-slate-200 bg-[#fcfcfd] lg:block" />
|
|
|
|
|
<main class="flex flex-1 items-center justify-center bg-gray-50">
|
|
|
|
|
<p class="text-sm text-gray-400">Checking session…</p>
|
2026-03-19 03:36:46 +01:00
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2026-03-16 23:20:54 +01:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
2026-03-24 02:36:40 +01:00
|
|
|
|
|
|
|
|
function ShowTabs(props: {
|
|
|
|
|
tabs: Tab[];
|
|
|
|
|
isTabActive: (tab: Tab) => boolean;
|
|
|
|
|
setTabsTrackEl: (el: HTMLDivElement) => void;
|
|
|
|
|
setTabRefs: (fn: (prev: Record<string, HTMLAnchorElement>) => Record<string, HTMLAnchorElement>) => void;
|
|
|
|
|
tabIndicator: () => { left: number; width: number; ready: boolean };
|
|
|
|
|
}) {
|
|
|
|
|
if (props.tabs.length === 0) return null;
|
|
|
|
|
|
|
|
|
|
return (
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
<div ref={props.setTabsTrackEl} class="relative mb-6 flex items-center gap-1 border-b border-gray-200">
|
2026-03-24 02:36:40 +01:00
|
|
|
<For each={props.tabs}>
|
|
|
|
|
{(tab) => (
|
|
|
|
|
<A
|
|
|
|
|
href={tab.href}
|
|
|
|
|
ref={(el) => props.setTabRefs((prev) => ({ ...prev, [tab.href]: el }))}
|
|
|
|
|
aria-current={props.isTabActive(tab) ? 'page' : undefined}
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
class={`px-4 pb-3 pt-3 text-[14px] font-semibold transition-colors ${
|
|
|
|
|
props.isTabActive(tab)
|
|
|
|
|
? 'text-[#fd6216]'
|
|
|
|
|
: 'text-slate-500 hover:text-slate-800'
|
2026-03-24 02:36:40 +01:00
|
|
|
}`}
|
|
|
|
|
>
|
|
|
|
|
{tab.label}
|
|
|
|
|
</A>
|
|
|
|
|
)}
|
|
|
|
|
</For>
|
|
|
|
|
<div
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
class={`absolute bottom-0 h-[2px] bg-[#fd6216] transition-all duration-300 ease-out ${props.tabIndicator().ready ? 'opacity-100' : 'opacity-0'}`}
|
2026-03-24 02:36:40 +01:00
|
|
|
style={{ left: `${props.tabIndicator().left}px`, width: `${props.tabIndicator().width}px` }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|