From 7a955d68fba6c05f2fcdd3e3d8514e829b229ee3 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 26 Sep 2026 13:40:07 +0300 Subject: [PATCH] Detection when debug as separate tab --- .../scanner/components/MatchCard.module.css | 9 ++-- app/features/scanner/components/MatchCard.tsx | 46 ++++++++++++++----- .../components/RawDetections.module.css | 16 ------- .../scanner/components/RawDetections.tsx | 43 ++++++----------- 4 files changed, 56 insertions(+), 58 deletions(-) diff --git a/app/features/scanner/components/MatchCard.module.css b/app/features/scanner/components/MatchCard.module.css index a7f17471e..8238d596e 100644 --- a/app/features/scanner/components/MatchCard.module.css +++ b/app/features/scanner/components/MatchCard.module.css @@ -315,15 +315,18 @@ button.expand { /* the expanded content, indented under its card via a rail */ .details { - display: flex; - flex-direction: column; - gap: var(--s-4); margin-inline-start: var(--s-2-5); padding: var(--s-1) 0 var(--s-2) var(--s-3); border-inline-start: var(--border-width) solid var(--color-border); animation: scanner-detail-in 0.25s ease both; } +.summary { + display: flex; + flex-direction: column; + gap: var(--s-4); +} + @keyframes scanner-detail-in { from { opacity: 0; diff --git a/app/features/scanner/components/MatchCard.tsx b/app/features/scanner/components/MatchCard.tsx index 06532f821..73abfd75d 100644 --- a/app/features/scanner/components/MatchCard.tsx +++ b/app/features/scanner/components/MatchCard.tsx @@ -4,14 +4,21 @@ * the game's clips and, once the game is over, its upload state beside the * expand arrow. Expanded it shows the data and * nothing interpreted: the scoreboard, the objective + player-status - * timeline and deaths and kills (each with a ▶ when a clip covers it). + * timeline and deaths and kills (each with a ▶ when a clip covers it). In + * debug mode that summary sits in a tab beside the raw events and frames. */ import clsx from "clsx"; import { ChevronDown, Play } from "lucide-react"; -import { useState } from "react"; +import { useId, useState } from "react"; import { Ability } from "~/components/Ability"; import { SendouButton } from "~/components/elements/Button"; import { SendouPopover } from "~/components/elements/Popover"; +import { + SendouTab, + SendouTabList, + SendouTabPanel, + SendouTabs, +} from "~/components/elements/Tabs"; import { GameTimeline } from "~/components/GameTimeline"; import { Image, ModeImage, WeaponImage } from "~/components/Image"; import { LocaleTime } from "~/components/LocaleTime"; @@ -108,6 +115,7 @@ export function MatchCard({ }) { const { match } = built; const [expanded, setExpanded] = useState(false); + const tabIdPrefix = useId(); // fixed at mount: re-rendering must not cut the animation short const [enter] = useState(justFormed); const [prevUploadKind, setPrevUploadKind] = useState(upload.kind); @@ -226,6 +234,16 @@ export function MatchCard({ ); + const summary = ( +
+ + {match.objective || match.playerStatus ? ( + + ) : null} + +
+ ); + const card = match.stage !== null ? ( @@ -240,16 +258,22 @@ export function MatchCard({ {card} {expanded && expandable ? (
- - {match.objective || match.playerStatus ? ( - - ) : null} - {debug ? ( - - ) : null} + + + Summary + Events + + + {summary} + + + + + + ) : ( + summary + )}
) : null} diff --git a/app/features/scanner/components/RawDetections.module.css b/app/features/scanner/components/RawDetections.module.css index c6aa4c95a..c10712a84 100644 --- a/app/features/scanner/components/RawDetections.module.css +++ b/app/features/scanner/components/RawDetections.module.css @@ -1,23 +1,7 @@ -.details { - font-size: var(--font-2xs); -} - -.summary { - cursor: pointer; - color: var(--color-text-high); - font-weight: var(--weight-semi); - text-transform: uppercase; - letter-spacing: 0.08em; -} - .events { --scanner-card-padding: var(--s-2-5) 14px; display: flex; flex-direction: column; gap: var(--s-2); - margin-top: var(--s-2); - margin-inline-start: var(--s-2-5); - padding-inline-start: var(--s-3); - border-inline-start: var(--border-width) solid var(--color-border); } diff --git a/app/features/scanner/components/RawDetections.tsx b/app/features/scanner/components/RawDetections.tsx index 4e0982b0b..d118803e6 100644 --- a/app/features/scanner/components/RawDetections.tsx +++ b/app/features/scanner/components/RawDetections.tsx @@ -3,7 +3,6 @@ * their frames (Inspect, Save fixture). Counter/status/strip reads render as * the timeline instead and stay out. */ -import { useState } from "react"; import { connectAbilities } from "../core/ability-harvest"; import { OBJECTIVE_EVENT_TYPE } from "../core/detectors/objective/index"; import { PLAYER_STATUS_EVENT_TYPE } from "../core/detectors/objective/player-status"; @@ -22,7 +21,6 @@ export function RawDetections({ sources: readonly ScanEvent[]; getFrame: (event: ScanEvent) => GetFrame | undefined; }) { - const [open, setOpen] = useState(false); const events = withoutRepeatEvents(sources).filter( (e) => e.type !== OBJECTIVE_EVENT_TYPE && @@ -31,31 +29,20 @@ export function RawDetections({ ); const abilityMap = connectAbilities(sources); return ( -
setOpen(e.currentTarget.open)} - > - - Raw detections · {sources.length} - - {open ? ( -
- {events.map((e) => ( - - ))} -
- ) : null} -
+
+ {events.map((e) => ( + + ))} +
); }