root = Card([header, kpiBlock, sessionChart, itemsTable, regionsTable, crashChart, eventsTabs, reportsAppealsBlock, inflationChart, experimentsBlock, actionsBlock])
header = CardHeader("Live-Ops Dashboard", "Real-time game health · Updated live")
kpiBlock = OverviewCardBlock([kpiOnline, kpiDau, kpiMau, kpiRevenueToday, kpiArpu], "grid", true)
kpiOnline = OverviewCardItem("online", kpiOnlineTop, kpiOnlineMetric)
kpiOnlineTop = IconText(kpiOnlineIcon, "info", "l", "Players Online", "Right now", false, "vertical")
kpiOnlineIcon = Icon("users", "people")
kpiOnlineMetric = MetricIndicatorInline("247,382", "concurrent", { direction: "up", value: 3.2 })
kpiDau = OverviewCardItem("dau", kpiDauTop, kpiDauMetric)
kpiDauTop = IconText(kpiDauIcon, "neutral", "l", "Daily Active Users", "Last 24h", false, "vertical")
kpiDauIcon = Icon("calendar", "time")
kpiDauMetric = MetricIndicatorInline("1.24M", "+4.1% WoW", { direction: "up", value: 4.1 })
kpiMau = OverviewCardItem("mau", kpiMauTop, kpiMauMetric)
kpiMauTop = IconText(kpiMauIcon, "neutral", "l", "Monthly Active Users", "Rolling 30d", false, "vertical")
kpiMauIcon = Icon("calendar-range", "time")
kpiMauMetric = MetricIndicatorInline("8.7M", "+2.8% MoM", { direction: "up", value: 2.8 })
kpiRevenueToday = OverviewCardItem("rev-today", kpiRevTop, kpiRevMetric)
kpiRevTop = IconText(kpiRevIcon, "success", "l", "Revenue Today", "USD gross", false, "vertical")
kpiRevIcon = Icon("circle-dollar-sign", "finance")
kpiRevMetric = MetricIndicatorInline("$384.2K", "+12% vs avg", { direction: "up", value: 12 })
kpiArpu = OverviewCardItem("arpu", kpiArpuTop, kpiArpuMetric)
kpiArpuTop = IconText(kpiArpuIcon, "neutral", "l", "Revenue Per User (ARPU)", "Daily blended", false, "vertical")
kpiArpuIcon = Icon("trending-up", "charts")
kpiArpuMetric = MetricIndicatorInline("$0.31", "+0.02 vs yesterday", { direction: "up", value: 6.9 })
sessionChart = InlineHeader("Session Length (Last 14 Days)", "Average minutes per session by day")
sessionLineChart = LineChart(sessionLabels, [sessionSeries], "natural", "Date", "Avg. Session (min)", 300)
sessionLabels = ["Aug 23", "Aug 24", "Aug 25", "Aug 26", "Aug 27", "Aug 28", "Aug 29", "Aug 30", "Aug 31", "Sep 1", "Sep 2", "Sep 3", "Sep 4", "Sep 5"]
sessionSeries = Series("Avg. Session", [18.4, 19.1, 18.7, 20.3, 21.0, 22.4, 23.1, 22.8, 21.5, 20.9, 19.8, 19.2, 18.6, 19.4])
itemsTable = InlineHeader("Best-Selling Items (Last 7 Days)", "Units sold and revenue by SKU")
itemsTbl = Table([colItem, colCategory, colUnits, colRevenue, colConversion])
colItem = Col("Item", ["Starter Bundle", "Battle Pass S12", "Cosmic Wings", "Golden Crate Key", "XP Boost 30d", "Premium Skin Pack", "Pet: Ember Fox", "Name Change Token"], "string")
colCategory = Col("Category", ["Bundle", "Pass", "Cosmetic", "Consumable", "Boost", "Cosmetic", "Cosmetic", "Utility"], "string")
colUnits = Col("Units Sold", [12450, 8920, 6780, 15320, 4210, 3890, 2150, 980], "number")
colRevenue = Col("Revenue ($)", [248500, 178400, 135600, 76600, 63150, 58350, 43000, 9800], "number")
colConversion = Col("Conv. Rate", ["3.2%", "2.1%", "1.8%", "4.1%", "1.1%", "1.0%", "0.6%", "0.3%"], "string")
regionsTable = InlineHeader("Server Regions & Health", "Capacity, latency, and incident status")
regionsTbl = Table([colRegion, colStatus, colPlayers, colCapacity, colLatency, colIncidents])
colRegion = Col("Region", ["US-East", "US-West", "EU-Central", "EU-West", "AP-Southeast", "AP-Northeast", "SA-East", "ME-Central"], "string")
colStatus = Col("Health", ["Healthy", "Healthy", "Degraded", "Healthy", "Healthy", "Critical", "Healthy", "Healthy"], "string")
colPlayers = Col("Players", [48200, 42100, 38500, 31200, 29800, 24600, 18900, 14100], "number")
colCapacity = Col("Capacity %", ["62%", "54%", "78%", "49%", "67%", "92%", "41%", "38%"], "string")
colLatency = Col("Avg Latency (ms)", [38, 42, 55, 48, 72, 128, 89, 104], "number")
colIncidents = Col("Active Incidents", [0, 0, 1, 0, 0, 2, 0, 0], "number")
crashChart = InlineHeader("Crash Rate by App Version", "Crashes per 1,000 sessions (last 24h)")
crashBarChart = BarChart(crashVersions, [crashSeries], "grouped", "App Version", "Crashes / 1k Sessions", 280)
crashVersions = ["v4.2.1", "v4.2.0", "v4.1.3", "v4.1.2", "v4.0.5", "v3.9.8"]
crashSeries = Series("Crash Rate", [0.8, 2.4, 1.1, 3.7, 5.2, 8.9])
eventsTabs = InlineHeader("Live Events", "Running and upcoming limited-time events")
eventsTabContainer = Tabs([tabRunning, tabUpcoming])
tabRunning = TabItem("running", "Running Now (3)", [runningList])
runningList = ListBlock([run1, run2, run3], "number")
run1 = ListItem("Harvest Festival", "Ends Sep 8 · 42% participation · +18% session lift", null, null, { type: "continue_conversation", context: "Show details for Harvest Festival event" })
run2 = ListItem("Double XP Weekend", "Ends Sep 7 · 67% active players opted in", null, null, { type: "continue_conversation", context: "Show details for Double XP Weekend event" })
run3 = ListItem("Community Tournament", "Finals Sep 10 · 12,400 teams registered", null, null, { type: "continue_conversation", context: "Show details for Community Tournament event" })
tabUpcoming = TabItem("upcoming", "Upcoming (4)", [upcomingList])
upcomingList = ListBlock([up1, up2, up3, up4], "number")
up1 = ListItem("Halloween Spooktacular", "Starts Sep 20 · New cosmetics + map variant", null, null, { type: "continue_conversation", context: "Show details for Halloween Spooktacular event" })
up2 = ListItem("Anniversary Celebration", "Starts Oct 1 · 5th anniversary rewards track", null, null, { type: "continue_conversation", context: "Show details for Anniversary Celebration event" })
up3 = ListItem("Winter Preview", "Starts Nov 15 · Early access to S13 content", null, null, { type: "continue_conversation", context: "Show details for Winter Preview event" })
up4 = ListItem("Charity Drive", "Starts Sep 12 · All proceeds to partner NGOs", null, null, { type: "continue_conversation", context: "Show details for Charity Drive event" })
reportsAppealsBlock = SectionBlock([secReports, secAppeals], false)
secReports = SectionItem("reports", "Player Reports Awaiting Review (247)", [reportsContent])
reportsContent = ListBlock([rep1, rep2, rep3, rep4, rep5], "number", "small")
rep1 = ListItem("Cheating — Aimbot", "US-East · 34 reports · Player: xX_Sniper_Xx", null, "Review", { type: "continue_conversation", context: "Review cheating report for xX_Sniper_Xx" })
rep2 = ListItem("Toxicity — Hate Speech", "EU-Central · 12 reports · Player: ToxicKing99", null, "Review", { type: "continue_conversation", context: "Review toxicity report for ToxicKing99" })
rep3 = ListItem("Exploit — Dupe Glitch", "AP-Southeast · 8 reports · Player: GlitchMaster", null, "Review", { type: "continue_conversation", context: "Review exploit report for GlitchMaster" })
rep4 = ListItem("Griefing — Team Killing", "US-West · 22 reports · Player: TeamKiller42", null, "Review", { type: "continue_conversation", context: "Review griefing report for TeamKiller42" })
rep5 = ListItem("RMT — Gold Selling", "Global · 15 reports · Account cluster: 12 accounts", null, "Review", { type: "continue_conversation", context: "Review RMT report for gold selling cluster" })
secAppeals = SectionItem("appeals", "Ban Appeals Awaiting Review (89)", [appealsContent])
appealsContent = ListBlock([app1, app2, app3, app4, app5], "number", "small")
app1 = ListItem("Permaban Appeal — xX_Sniper_Xx", "Cheating · 1st appeal · Evidence: demo review requested", null, "Review", { type: "continue_conversation", context: "Review ban appeal for xX_Sniper_Xx" })
app2 = ListItem("7-Day Appeal — ToxicKing99", "Hate Speech · 2nd offense · Chat logs attached", null, "Review", { type: "continue_conversation", context: "Review ban appeal for ToxicKing99" })
app3 = ListItem("30-Day Appeal — GlitchMaster", "Exploit · Claims unintentional · Repro steps provided", null, "Review", { type: "continue_conversation", context: "Review ban appeal for GlitchMaster" })
app4 = ListItem("Permaban Appeal — TeamKiller42", "Griefing · 3rd offense · No new evidence", null, "Review", { type: "continue_conversation", context: "Review ban appeal for TeamKiller42" })
app5 = ListItem("Cluster Appeal — RMT Network", "12 accounts · Organized appeal · Legal counsel involved", null, "Review", { type: "continue_conversation", context: "Review cluster ban appeal for RMT network" })
inflationChart = InlineHeader("In-Game Currency Inflation", "Gold supply vs. sinks (rolling 30d)")
inflationLineChart = LineChart(inflationLabels, [supplySeries, sinkSeries, netSeries], "natural", "Date", "Gold (Billions)", 300)
inflationLabels = ["Aug 6", "Aug 13", "Aug 20", "Aug 27", "Sep 3"]
supplySeries = Series("Total Supply", [2.84, 2.91, 2.98, 3.05, 3.12])
sinkSeries = Series("Total Sinks", [2.71, 2.78, 2.83, 2.89, 2.94])
netSeries = Series("Net Inflation", [0.13, 0.13, 0.15, 0.16, 0.18])
experimentsBlock = InlineHeader("Running Experiments", "Two active A/B tests — statistical significance tracking")
expCards = CompositeCardBlock([exp1, exp2], "grid", true)
exp1 = CompositeCardItem("exp-matchmaking", exp1Header, [exp1Metric, exp1Chart, exp1Details], { price: exp1Price, button: exp1Btn })
exp1Header = IconText(exp1Icon, "info", "m", "Matchmaking SBMM Tuning", "Experiment: relaxed_skill_gap_v2", true, "horizontal")
exp1Icon = Icon("users-round", "people")
exp1Metric = MetricIndicatorInline("+4.2% Retention D1", "p=0.031 · Significant", { direction: "up", value: 4.2 })
exp1Chart = BarChart(exp1Labels, [exp1Control, exp1Variant], "grouped", "Metric", "Lift (%)")
exp1Labels = ["D1 Retention", "D7 Retention", "Session Length", "Match Quality"]
exp1Control = Series("Control", [0, 0, 0, 0])
exp1Variant = Series("Variant", [4.2, 2.1, 3.8, 5.5])
exp1Details = EntityList([exp1d1, exp1d2, exp1d3], "small")
exp1d1 = { left: "Sample Size", right: "240K players (120K/arm)", rightVariant: "text" }
exp1d2 = { left: "Duration", right: "Day 12 of 14", rightVariant: "text" }
exp1d3 = { left: "Confidence", right: "96.9%", rightVariant: "number" }
exp1Price = MetricIndicatorWithStrikethrough("Ship Decision", "Pending final day", "Not Significant", { direction: "up", value: 0 })
exp1Btn = Button("View Full Report", { type: "continue_conversation", context: "Show full experiment report for relaxed_skill_gap_v2" }, "secondary")
exp2 = CompositeCardItem("exp-shop-layout", exp2Header, [exp2Metric, exp2Chart, exp2Details], { price: exp2Price, button: exp2Btn })
exp2Header = IconText(exp2Icon, "warning", "m", "Shop Layout Redesign", "Experiment: dynamic_carousel_v1", true, "horizontal")
exp2Icon = Icon("layout-grid", "design")
exp2Metric = MetricIndicatorInline("-1.8% ARPU", "p=0.12 · Not Significant", { direction: "down", value: 1.8 })
exp2Chart = BarChart(exp2Labels, [exp2Control, exp2Variant], "grouped", "Metric", "Lift (%)")
exp2Labels = ["ARPU", "Conversion Rate", "Items/Session", "Revenue/Session"]
exp2Control = Series("Control", [0, 0, 0, 0])
exp2Variant = Series("Variant", [-1.8, -0.9, 2.3, -1.2])
exp2Details = EntityList([exp2d1, exp2d2, exp2d3], "small")
exp2d1 = { left: "Sample Size", right: "180K players (90K/arm)", rightVariant: "text" }
exp2d2 = { left: "Duration", right: "Day 10 of 14", rightVariant: "text" }
exp2d3 = { left: "Confidence", right: "88%", rightVariant: "number" }
exp2Price = MetricIndicatorWithStrikethrough("Ship Decision", "Likely rollback", "Not Significant", { direction: "down", value: 0 })
exp2Btn = Button("View Full Report", { type: "continue_conversation", context: "Show full experiment report for dynamic_carousel_v1" }, "secondary")
actionsBlock = SectionBlock([secPatch, secRegion, secHotfix], false)
secPatch = SectionItem("patch-notes", "Draft Patch Notes", [patchForm])
patchForm = Form("patch-notes", patchButtons, [fcVersion, fcTitle, fcBody, fcSeverity, fcChannels])
patchButtons = Buttons([btnPatchSave, btnPatchPublish], "row")
btnPatchSave = Button("Save Draft", { type: "continue_conversation", context: "Save patch notes draft for v4.2.2" }, "secondary")
btnPatchPublish = Button("Publish to Players", { type: "continue_conversation", context: "Publish patch notes v4.2.2 to all channels" }, "primary")
fcVersion = FormControl("Version", versionInput, "Semantic version for this patch")
versionInput = Input("version", "v4.2.2", "text", { required: true })
fcTitle = FormControl("Title", titleInput, "Short headline for the patch")
titleInput = Input("title", "Stability & Balance Update — Sep 6", "text", { required: true })
fcBody = FormControl("Changelog (Markdown)", bodyArea, "Use markdown. Sections: Fixes, Balance, QoL, Known Issues")
bodyArea = TextArea("body", "## Fixes\n- Fixed crash on AP-Northeast login (v4.2.1 regression)\n- Resolved dupe glitch in trading post\n- Corrected Harvest Festival reward tracking\n\n## Balance\n- Reduced Cosmic Wings drop rate from 0.8% → 0.5%\n- Increased Golden Crate Key price 150 → 175 gems\n- Adjusted SBMM parameters per experiment results\n\n## QoL\n- Added \"Ready Check\" sound toggle\n- Improved party invite notifications\n\n## Known Issues\n- Minor UI overlap in shop carousel (fix in v4.2.3)", 12, { required: true })
fcSeverity = FormControl("Severity", severitySelect, "Player-facing severity label")
severitySelect = Select("severity", [sev1, sev2, sev3, sev4], "Select severity", { required: true })
sev1 = SelectItem("hotfix", "Hotfix — Critical fixes only")
sev2 = SelectItem("patch", "Patch — Fixes + balance")
sev3 = SelectItem("update", "Update — New content + fixes")
sev4 = SelectItem("major", "Major — Systems overhaul")
fcChannels = FormControl("Publish Channels", channelsChips, "Select all channels to notify")
channelsChips = Chips("channels", "multiple", [chInGame, chDiscord, chTwitter, chEmail, chWeb], {}, ["in-game", "discord"])
chInGame = ChipItem("in-game", "In-Game Notification", chInGameIcon)
chInGameIcon = Icon("monitor", "devices")
chDiscord = ChipItem("discord", "Discord #announcements", chDiscordIcon)
chDiscordIcon = Icon("message-square", "communication")
chTwitter = ChipItem("twitter", "X / Twitter", chTwitterIcon)
chTwitterIcon = Icon("twitter", "social")
chEmail = ChipItem("email", "Email Newsletter", chEmailIcon)
chEmailIcon = Icon("mail", "communication")
chWeb = ChipItem("web", "Website News Post", chWebIcon)
chWebIcon = Icon("globe", "navigation")
secRegion = SectionItem("region-focus", "Focus Region", [regionFocusForm])
regionFocusForm = Form("region-focus", regionButtons, [fcRegion, fcAction])
regionButtons = Buttons([btnRegionApply, btnRegionClear], "row")
btnRegionApply = Button("Apply Focus", { type: "continue_conversation", context: "Apply region focus filter to all dashboard panels" }, "primary")
btnRegionClear = Button("Clear Focus", { type: "continue_conversation", context: "Clear region focus and show global view" }, "secondary")
fcRegion = FormControl("Select Region", regionSelect, "Filters all metrics to this region")
regionSelect = Select("region", [reg1, reg2, reg3, reg4, reg5, reg6, reg7, reg8, regGlobal], "Choose region", { required: true })
reg1 = SelectItem("us-east", "US-East (48.2K players)")
reg2 = SelectItem("us-west", "US-West (42.1K players)")
reg3 = SelectItem("eu-central", "EU-Central (38.5K players) ⚠ Degraded")
reg4 = SelectItem("eu-west", "EU-West (31.2K players)")
reg5 = SelectItem("ap-se", "AP-Southeast (29.8K players)")
reg6 = SelectItem("ap-ne", "AP-Northeast (24.6K players) 🔴 Critical")
reg7 = SelectItem("sa-east", "SA-East (18.9K players)")
reg8 = SelectItem("me-central", "ME-Central (14.1K players)")
regGlobal = SelectItem("global", "Global (All Regions)")
fcAction = FormControl("Focus Actions", focusChips, "Quick actions for focused region")
focusChips = Chips("focus-actions", "multiple", [fcChip1, fcChip2, fcChip3, fcChip4], {}, [])
fcChip1 = ChipItem("capacity", "Boost Capacity", fcChip1Icon)
fcChip1Icon = Icon("server", "devices")
fcChip2 = ChipItem("maintenance", "Schedule Maintenance", fcChip2Icon)
fcChip2Icon = Icon("wrench", "tools")
fcChip3 = ChipItem("events", "Region-Specific Event", fcChip3Icon)
fcChip3Icon = Icon("calendar-plus", "time")
fcChip4 = ChipItem("investigate", "Investigate Incidents", fcChip4Icon)
fcChip4Icon = Icon("search", "navigation")
secHotfix = SectionItem("hotfix", "Ship Hotfix", [hotfixForm])
hotfixForm = Form("hotfix", hotfixButtons, [hfcVersion, hfcDescription, hfcFiles, hfcRegions, hfcConfirm])
hotfixButtons = Buttons([btnHotfixStage, btnHotfixShip], "row")
btnHotfixStage = Button("Stage for Review", { type: "continue_conversation", context: "Stage hotfix v4.2.1-h1 for internal review" }, "secondary")
btnHotfixShip = Button("Ship Hotfix Now", { type: "continue_conversation", context: "DEPLOY HOTFIX v4.2.1-h1 to all regions — confirm this action" }, "primary", "destructive")
hfcVersion = FormControl("Hotfix Version", hfVersionInput, "Auto-incremented from current stable")
hfVersionInput = Input("hf-version", "v4.2.1-h1", "text", { required: true })
hfcDescription = FormControl("Description", hfDescArea, "What does this hotfix address?")
hfDescArea = TextArea("hf-description", "Emergency fix for AP-Northeast login crash (v4.2.1 regression).\nRoot cause: Memory leak in region-specific asset bundle loader.\nFix: Patch asset bundle streaming + increase heap ceiling.\nTesting: Verified on staging (AP-NE mirror) — 0 crashes in 2h soak.", 6, { required: true })
hfcFiles = FormControl("Build Artifacts", hfFilesInput, "Build IDs or artifact links (one per line)")
hfFilesInput = TextArea("hf-files", "build-20250905-1423-apne-fix\nbuild-20250905-1423-global-parity", 3, { required: true })
hfcRegions = FormControl("Target Regions", hfRegionChips, "Select regions to deploy (default: all)")
hfRegionChips = Chips("hf-regions", "multiple", [hfr1, hfr2, hfr3, hfr4, hfr5, hfr6, hfr7, hfr8], {}, ["us-east", "us-west", "eu-central", "eu-west", "ap-se", "ap-ne", "sa-east", "me-central"])
hfr1 = ChipItem("us-east", "US-East", hfr1Icon)
hfr1Icon = Icon("server", "devices")
hfr2 = ChipItem("us-west", "US-West", hfr2Icon)
hfr2Icon = Icon("server", "devices")
hfr3 = ChipItem("eu-central", "EU-Central", hfr3Icon)
hfr3Icon = Icon("server", "devices")
hfr4 = ChipItem("eu-west", "EU-West", hfr4Icon)
hfr4Icon = Icon("server", "devices")
hfr5 = ChipItem("ap-se", "AP-Southeast", hfr5Icon)
hfr5Icon = Icon("server", "devices")
hfr6 = ChipItem("ap-ne", "AP-Northeast", hfr6Icon)
hfr6Icon = Icon("alert-triangle", "alerts")
hfr7 = ChipItem("sa-east", "SA-East", hfr7Icon)
hfr7Icon = Icon("server", "devices")
hfr8 = ChipItem("me-central", "ME-Central", hfr8Icon)
hfr8Icon = Icon("server", "devices")
hfcConfirm = FormControl("Confirmation", hfConfirmCheck, "Type 'DEPLOY' to enable Ship button")
hfConfirmCheck = Input("hf-confirm", "", "text", { required: true, pattern: "^DEPLOY$" })