From ef96e877b520e2c875ac8c6595659aa2e88aff87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 9 May 2026 17:45:33 +0200 Subject: [PATCH] fix(admin): default api-tokens + login-overview routes to expanded MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-phase-4b these sections were cards on the long monolithic /admin scroll, where the expand-to-reveal kept 100+ table rows from dominating the overview. Post-phase-4b they each own a dedicated route reachable via the sidebar / mobile strip — the user has already opted into the topic by navigating there. Landing on a card with only a header and an "Expand" button reads as "is this page broken?". Default `expanded = true`; the toggle stays as an escape hatch. Closes H3 from .planning/phase-6-design-findings.md. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/admin/api-token-overview-section.tsx | 5 ++++- src/components/admin/login-overview-section.tsx | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/admin/api-token-overview-section.tsx b/src/components/admin/api-token-overview-section.tsx index 58121ff76..1d49726e7 100644 --- a/src/components/admin/api-token-overview-section.tsx +++ b/src/components/admin/api-token-overview-section.tsx @@ -11,7 +11,10 @@ import { type ApiTokenInfo } from "./_shared"; export function ApiTokenOverviewSection() { const { t } = useTranslations(); - const [expanded, setExpanded] = useState(false); + // v1.5 phase-4b moved this to a dedicated route (`/admin/api-tokens`), + // so the user has already opted into seeing tokens by visiting the + // page. Default to expanded; the toggle stays as an escape hatch. + const [expanded, setExpanded] = useState(true); const { data: tokens, isLoading } = useQuery({ queryKey: ["admin", "tokens"], diff --git a/src/components/admin/login-overview-section.tsx b/src/components/admin/login-overview-section.tsx index 46b341c10..81adcd936 100644 --- a/src/components/admin/login-overview-section.tsx +++ b/src/components/admin/login-overview-section.tsx @@ -16,7 +16,11 @@ import { type AdminAuditEntry } from "./_shared"; export function LoginOverviewSection() { const { t } = useTranslations(); - const [expanded, setExpanded] = useState(false); + // v1.5 phase-4b moved this to a dedicated route + // (`/admin/login-overview`), so the user has already opted into the + // audit log by visiting the page. Default to expanded; the toggle + // stays as an escape hatch. + const [expanded, setExpanded] = useState(true); const [filter, setFilter] = useState<"all" | "failed">("all"); const AUTH_ACTION_LABELS: Record = {