From 8fb97fdd1c845f05d7c6622f53f2e7fe963c0c3f Mon Sep 17 00:00:00 2001 From: Z8MB1E Date: Mon, 12 Oct 2026 13:26:21 -0400 Subject: [PATCH] feat(dashboard): demo tactical dossier styling on hero widgets - New shared TacticalFrame/ReadoutFooter primitives (classification strip, corner brackets, faint grid texture, mono readout bar) following the campaign-card recipe; each piece separable per widget - ProfileSummary: full frame + service-record readout footer (XP/level/rank/assignments) - MissionBriefing: frame + codename line, inner MissionCard kept conventional - QuickStats: hairline-separated situation-report readout bar - Dense widgets (events, tickets, notifications, wallet, negotiations) stay shadcn so the tactical surfaces stand out --- .../frontend/dashboard/MissionBriefing.tsx | 29 +++-- .../frontend/dashboard/ProfileSummary.tsx | 40 ++++-- .../frontend/dashboard/QuickStats.tsx | 90 +++++-------- .../frontend/dashboard/tactical.tsx | 118 ++++++++++++++++++ 4 files changed, 194 insertions(+), 83 deletions(-) create mode 100644 src/components/frontend/dashboard/tactical.tsx diff --git a/src/components/frontend/dashboard/MissionBriefing.tsx b/src/components/frontend/dashboard/MissionBriefing.tsx index a2c6a9f1..065c1aa2 100644 --- a/src/components/frontend/dashboard/MissionBriefing.tsx +++ b/src/components/frontend/dashboard/MissionBriefing.tsx @@ -1,10 +1,10 @@ import Link from "next/link"; -import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item"; +import { CrosshairIcon } from "lucide-react"; import { MissionCard, type MissionCardProps, } from "@/components/frontend/intelligence/MissionCard"; -import { CrosshairIcon } from "lucide-react"; +import { TacticalFrame, refCodeFrom } from "./tactical"; interface MissionBriefingProps { readonly mission: MissionCardProps["mission"] | null; @@ -13,26 +13,31 @@ interface MissionBriefingProps { export function MissionBriefing({ mission, heading = "Next Mission" }: MissionBriefingProps) { return ( - - -
- - {heading} + +
+
+ + + {mission?.codeName ?? "Standby"} +
View all - - +
+
{mission ? ( ) : (

No missions currently scheduled.

)} - - +
+
); } diff --git a/src/components/frontend/dashboard/ProfileSummary.tsx b/src/components/frontend/dashboard/ProfileSummary.tsx index 248c625b..95461c40 100644 --- a/src/components/frontend/dashboard/ProfileSummary.tsx +++ b/src/components/frontend/dashboard/ProfileSummary.tsx @@ -1,8 +1,8 @@ import Link from "next/link"; import type { Assignment, Rank } from "@/payload-types"; import type { ResolvedLevel } from "@/utils/xp/resolveLevel"; -import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item"; import { UserIcon } from "lucide-react"; +import { ReadoutFooter, TacticalFrame, refCodeFrom } from "./tactical"; interface ProfileSummaryProps { displayName: string; @@ -19,21 +19,35 @@ export function ProfileSummary({ xpLevel, assignments, }: ProfileSummaryProps) { + const footerCells = [ + { label: "XP", value: xpLevel.xp.toLocaleString() }, + { label: "Level", value: xpLevel.levelName }, + { label: "Rank", value: rank.abbreviation || "-" }, + { label: "Assignments", value: String(assignments.length) }, + ]; + return ( - - -
- - Service Summary + } + > +
+
+ +

+ Service Summary +

View full record - - +
+ +
{rank.insigniaUrl && ( )}
-

{displayName}

+

{displayName}

{rank.name} | @@ -71,7 +85,7 @@ export function ProfileSummary({ {assignments.map((a) => ( {a.callsign ? `[${a.callsign}] ` : ""} {a.name} @@ -80,7 +94,7 @@ export function ProfileSummary({ ))}
)} - - +
+ ); } diff --git a/src/components/frontend/dashboard/QuickStats.tsx b/src/components/frontend/dashboard/QuickStats.tsx index 47fd6d5a..f926d678 100644 --- a/src/components/frontend/dashboard/QuickStats.tsx +++ b/src/components/frontend/dashboard/QuickStats.tsx @@ -1,5 +1,6 @@ -import { Item, ItemContent, ItemDescription, ItemMedia, ItemTitle } from "@/components/ui/item"; +import type { LucideIcon } from "lucide-react"; import { Building2Icon, CrosshairIcon, ShieldIcon, UsersIcon } from "lucide-react"; +import { TacticalFrame } from "./tactical"; interface QuickStatsProps { activeCampaigns: number; @@ -9,6 +10,12 @@ interface QuickStatsProps { totalMembers: number; } +interface StatCell { + label: string; + value: number; + icon: LucideIcon; +} + export function QuickStats({ activeCampaigns, totalMissions, @@ -16,63 +23,30 @@ export function QuickStats({ totalFactions, totalMembers, }: QuickStatsProps) { + const cells: StatCell[] = [ + { label: "Campaigns", value: activeCampaigns, icon: CrosshairIcon }, + { label: "Missions", value: totalMissions, icon: CrosshairIcon }, + { label: "Structures", value: totalStructures, icon: Building2Icon }, + { label: "Factions", value: totalFactions, icon: ShieldIcon }, + { label: "Operators", value: totalMembers, icon: UsersIcon }, + ]; + return ( -
- - - - - - Active Campaigns - - {activeCampaigns} - - - - - - - - - Total Missions - - {totalMissions} - - - - - - - - - Structures - - {totalStructures} - - - - - - - - - Factions - - {totalFactions} - - - - - - - - - Operators - - {totalMembers} - - - -
+ + {/* gap-px over a white/10 backdrop renders hairline separators in both directions */} +
+ {cells.map((cell) => ( +
+ + {cell.value.toLocaleString()} + + + +
+ ))} +
+
); } diff --git a/src/components/frontend/dashboard/tactical.tsx b/src/components/frontend/dashboard/tactical.tsx new file mode 100644 index 00000000..4cca7300 --- /dev/null +++ b/src/components/frontend/dashboard/tactical.tsx @@ -0,0 +1,118 @@ +import type { ReactNode } from "react"; +import { cn } from "@/lib/utils"; + +/** + * Shared tactical "dossier" primitives for dashboard hero widgets, following + * the recipe in src/components/frontend/AGENTS.md (reference implementation: + * CampaignCard). Each piece is separable: frames can take just the strip, or + * brackets, or a readout footer. Dense widgets stay conventional shadcn so + * these surfaces stand out. + */ + +/** Deterministic 3-digit reference code derived from a seed (id, username...). */ +export function refCodeFrom(seed: string | number): string { + const value = String(seed); + let hash = 5381; + for (let i = 0; i < value.length; i += 1) { + hash = ((hash << 5) + hash + value.charCodeAt(i)) >>> 0; + } + return String(hash % 1000).padStart(3, "0"); +} + +interface TacticalFrameProps { + /** Left classification-strip label, e.g. "Personnel // Service Record". */ + classification: string; + /** Right strip label, e.g. "REF 042". Omit to hide. */ + refCode?: string; + children: ReactNode; + /** Optional permanent readout bar pinned to the bottom edge. */ + footer?: ReactNode; + /** Corner brackets, default on. Turn off for bar-shaped surfaces. */ + brackets?: boolean; + className?: string; +} + +export function TacticalFrame({ + classification, + refCode, + children, + footer, + brackets = true, + className, +}: TacticalFrameProps) { + return ( +
+ {/* Faint grid texture: constant opacity, never brightens on hover. */} + + ); +} + +export interface ReadoutCell { + label: string; + value: string; +} + +/** Permanent single-line readout bar (hairline-separated mono cells). */ +export function ReadoutFooter({ cells }: { cells: ReadoutCell[] }) { + return ( +
+ {cells.map((cell, index) => ( +
+ + {cell.value} + + + {cell.label} + +
+ ))} +
+ ); +}