Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesPull RequestsActionsSecurityInsightsSettings
✨ AI
More
claude/adoring-hopper-5x74bqclaude/affectionate-feynman-ykrf1hclaude/architecture-audit-design-wxprenclaude/build-status-update-3MXsfclaude/charming-meitner-mllb5rclaude/compare-gate-gluecron-s4mFQclaude/confident-faraday-tikcwbclaude/continue-work-XMTlIclaude/crontech-gluecron-deploy-7MIECclaude/crontech-platform-setup-SeKfwclaude/design-2026claude/ecstatic-ptolemy-jMdigclaude/enhance-github-integration-QNHdGclaude/fix-aa-loop-issue-PonMQclaude/fix-actions-and-processclaude/fix-desktop-errors-XqoW8claude/fix-red-workflowsclaude/fix-website-access-6FKJNclaude/gatetest-integration-hardeningclaude/github-audit-improvements-bDFr9claude/gluecron-launch-status-FoMRlclaude/hopeful-lamport-olfCTclaude/issue-to-pr-and-protectionsclaude/jolly-heisenberg-2sg1Qclaude/launch-preparation-QmTb6claude/new-session-xk1l7claude/plan-platform-architecture-kkN4yclaude/platform-analysis-roadmap-1nUGLclaude/platform-launch-assessment-8dWV8claude/polish-platform-release-AeDrUclaude/resume-previous-work-KzyLwclaude/review-crontech-handoff-qYEVqclaude/review-project-completeness-lHhS2claude/review-readme-docs-ulqPKclaude/serene-edison-rj87weclaude/setup-multi-repo-dev-BCwNQclaude/ship-fixes-and-tests-Jvz1cclaude/site-audit-competitive-pctlwgclaude/site-migration-vercel-XstpKclaude/standalone-product-repos-XHFTDcopilot/feat-smart-empty-states-keyboard-first-enhancementcopilot/feat-smart-morning-digest-review-context-restorecopilot/fix-and-process-workflowscopilot/update-ai-powered-code-reviewfeat/debt-mapfeat/push-policy-codeowners-hardeningfeat/smart-digest-contextfeat/stage-impactfeat/t1-secret-migrationfeat/u-polishfeat/w-self-hostfeat/w2-claude-configfix/agent-journey-orphan-sweepgatetest/auto-fix-1776586424172gatetest/auto-fix-1776586534814gatetest/auto-fix-1776590685143gatetest/auto-fix-1776590808199mainops/redeploy-retriggerstyle/dxt-cta-themeworktree-agent-a3377aad30d55da26worktree-agent-a7ef607b7ee1d6c74
admin-shell.tsx9.7 KB · 340 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
import type { FC, PropsWithChildren } from "hono/jsx";
import type { User } from "../db/schema";
import { Layout } from "./layout";

// ---------------------------------------------------------------------------
// AdminShell — the single unified chrome for every /admin/* surface.
//
// Before this, the ~15 admin pages each rendered the plain customer `Layout`
// with no admin navigation, so the only way between admin screens was the
// two rival hub pages (/admin and /admin/command). AdminShell wraps `Layout`
// (so the html shell, top nav, footer, scripts all still work) and adds a
// persistent left sidebar driven by ONE canonical `ADMIN_NAV` array plus a
// sticky page header (title + optional actions slot).
//
// This module is the single source of truth for the admin IA. Every admin
// destination in the app lives in `ADMIN_NAV` below — nothing stays orphaned.
// Migrate a page by replacing its `<Layout …>` wrapper with
// `<AdminShell active="<key>" title="…" user={user}> … </AdminShell>`.
// ---------------------------------------------------------------------------

export type AdminNavKey =
  // Overview
  | "dashboard"
  | "command"
  // Operations & Health
  | "ops"
  | "health"
  | "env-health"
  | "status"
  | "diagnose"
  | "autopilot"
  // Deploys & Infra
  | "deploys"
  | "self-host"
  | "servers"
  // Users & Access
  | "users"
  | "repos"
  | "security"
  | "deletions"
  // Sign-in & SSO
  | "google-oauth"
  | "github-oauth"
  | "sso"
  // Growth & Billing
  | "growth"
  | "billing"
  | "stripe"
  | "digests"
  | "ai-costs"
  // Platform Config
  | "flags"
  | "integrations"
  | "advancement"
  | "connect-claude";

interface AdminNavItem {
  key: AdminNavKey;
  href: string;
  label: string;
}

interface AdminNavGroup {
  label: string;
  items: AdminNavItem[];
}

/**
 * Canonical admin navigation. Grouped by concern; the union of both legacy
 * hubs (/admin + /admin/command) plus the previously-orphaned /admin/servers
 * and /admin/billing surfaces. This array is the ONLY place the admin IA is
 * defined — add new admin pages here and every shell picks them up.
 */
export const ADMIN_NAV: AdminNavGroup[] = [
  {
    label: "Overview",
    items: [
      { key: "dashboard", href: "/admin", label: "Dashboard" },
      { key: "command", href: "/admin/command", label: "Command Center" },
    ],
  },
  {
    label: "Operations & Health",
    items: [
      { key: "ops", href: "/admin/ops", label: "Operations" },
      { key: "health", href: "/admin/health", label: "Health (traffic lights)" },
      { key: "env-health", href: "/admin/env-health", label: "Env / feature health" },
      { key: "status", href: "/admin/status", label: "Platform monitor" },
      { key: "diagnose", href: "/admin/diagnose", label: "AI background tasks" },
      { key: "autopilot", href: "/admin/autopilot", label: "Autopilot" },
    ],
  },
  {
    label: "Deploys & Infra",
    items: [
      { key: "deploys", href: "/admin/deploys", label: "Deploys" },
      { key: "self-host", href: "/admin/self-host", label: "Self-host status" },
      { key: "servers", href: "/admin/servers", label: "Server targets" },
    ],
  },
  {
    label: "Users & Access",
    items: [
      { key: "users", href: "/admin/users", label: "Manage users" },
      { key: "repos", href: "/admin/repos", label: "Manage repos" },
      { key: "security", href: "/admin/security", label: "Security" },
      { key: "deletions", href: "/admin/deletions", label: "GDPR deletions" },
    ],
  },
  {
    label: "Sign-in & SSO",
    items: [
      { key: "google-oauth", href: "/admin/google-oauth", label: "Sign in with Google" },
      { key: "github-oauth", href: "/admin/github-oauth", label: "Sign in with GitHub" },
      { key: "sso", href: "/admin/sso", label: "Enterprise SSO" },
    ],
  },
  {
    label: "Growth & Billing",
    items: [
      { key: "growth", href: "/admin/growth", label: "User growth" },
      { key: "billing", href: "/admin/billing", label: "Billing" },
      { key: "stripe", href: "/admin/stripe", label: "Stripe sync" },
      { key: "digests", href: "/admin/digests", label: "Email digests" },
      { key: "ai-costs", href: "/admin/ai-costs", label: "AI cost breakdown" },
    ],
  },
  {
    label: "Platform Config",
    items: [
      { key: "flags", href: "/admin/flags", label: "Site flags" },
      { key: "integrations", href: "/admin/integrations", label: "Integrations" },
      { key: "advancement", href: "/admin/advancement", label: "Advancement" },
      { key: "connect-claude", href: "/connect/claude", label: "Connect Claude" },
    ],
  },
];

export const AdminShell: FC<
  PropsWithChildren<{
    active: AdminNavKey | string;
    title: string;
    user?: User | null;
    // Optional right-aligned actions slot rendered in the sticky page header.
    actions?: any;
  }>
> = ({ active, title, user, actions, children }) => (
  <Layout title={`${title} — Admin`} user={user}>
    <style dangerouslySetInnerHTML={{ __html: adminShellStyles }} />
    <div class="admin-shell">
      <aside class="admin-shell-sidebar">
        <div class="admin-shell-brand">
          <span class="admin-shell-brand-dot" aria-hidden="true" />
          Site admin
        </div>
        <nav class="adminnav" aria-label="Admin sections">
          {ADMIN_NAV.map((group) => (
            <div class="adminnav-group">
              <div class="adminnav-label">{group.label}</div>
              {group.items.map((it) => (
                <a
                  href={it.href}
                  class={it.key === active ? "is-active" : ""}
                  aria-current={it.key === active ? "page" : undefined}
                >
                  {it.label}
                </a>
              ))}
            </div>
          ))}
        </nav>
      </aside>
      <div class="admin-shell-main">
        <header class="admin-shell-head">
          <h1 class="admin-shell-title">{title}</h1>
          {actions ? (
            <div class="admin-shell-actions">{actions}</div>
          ) : null}
        </header>
        <div class="admin-shell-content">{children}</div>
      </div>
    </div>
  </Layout>
);

/**
 * Shell CSS. Follows the SettingsNav pattern (grouped sidebar, sticky, token
 * based, theme-aware). No hardcoded hex — every colour resolves from a design
 * token so light/dark both track automatically. Injected once per page; a
 * duplicate identical <style> is harmless.
 */
export const adminShellStyles = `
  .admin-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: var(--space-6);
    align-items: start;
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-6) var(--space-16);
  }
  .admin-shell-sidebar {
    position: sticky;
    top: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
  }
  .admin-shell-brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 var(--space-2);
  }
  .admin-shell-brand-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
    background: var(--accent);
    box-shadow: var(--accent-glow);
  }
  .adminnav {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
  }
  .adminnav-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  .adminnav-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 4px 10px;
    margin-bottom: 2px;
  }
  .adminnav a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  }
  .adminnav a:hover {
    color: var(--text-strong);
    background: var(--bg-hover);
  }
  .adminnav a.is-active {
    color: var(--text-strong);
    background: var(--accent-gradient-soft);
    box-shadow: var(--accent-glow) inset;
    font-weight: 600;
  }
  .admin-shell-main {
    min-width: 0;
  }
  .admin-shell-head {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    padding: var(--space-4) 0;
    margin-bottom: var(--space-5);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
  }
  .admin-shell-title {
    font-family: var(--font-display);
    font-size: var(--font-size-xl);
    font-weight: 700;
    letter-spacing: -0.022em;
    color: var(--text-strong);
    margin: 0;
    min-width: 0;
  }
  .admin-shell-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
  }
  .admin-shell-content {
    min-width: 0;
  }
  @media (max-width: 860px) {
    .admin-shell {
      display: block;
      padding: var(--space-4);
    }
    .admin-shell-sidebar {
      position: static;
      margin-bottom: var(--space-5);
    }
    .adminnav {
      flex-direction: row;
      flex-wrap: wrap;
      gap: var(--space-3);
      padding: var(--space-2);
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius);
    }
    .adminnav-group {
      flex-direction: row;
      flex-wrap: wrap;
      gap: 2px;
    }
    .adminnav-label {
      display: none;
    }
    .adminnav a {
      padding: 6px 12px;
      border-radius: var(--radius-full);
    }
    .admin-shell-head {
      position: static;
    }
  }
`;