전략평가 화면 수정

This commit is contained in:
Macbook
2026-06-12 15:32:00 +09:00
parent 8aae8489ae
commit b560b9de5c
10 changed files with 413 additions and 13 deletions
@@ -4,6 +4,8 @@ import {
buildConditionMetrics,
computeMatchRate,
getTrafficLightState,
resolveSideHeadlineMatchRate,
resolveSideTrafficState,
type ConditionMetric,
} from '../../utils/virtualSignalMetrics';
import VirtualSignalEqualizer from './VirtualSignalEqualizer';
@@ -15,6 +17,8 @@ interface Props {
title?: React.ReactNode;
/** 백엔드 집계 matchRate — 미지정 시 metrics 로컬 계산 */
backendMatchRate?: number | null;
/** DSL 전체 Rule 충족 — 헤드라인 일치율·신호등 우선 */
overallMet?: boolean | null;
className?: string;
panelClassName?: string;
}
@@ -23,16 +27,21 @@ const VirtualSignalMatchVisual: React.FC<Props> = ({
metrics,
title,
backendMatchRate,
overallMet,
className = '',
panelClassName = '',
}) => {
const matchRate = useMemo(
() => computeMatchRate(metrics, backendMatchRate),
[metrics, backendMatchRate],
() => (overallMet != null
? resolveSideHeadlineMatchRate(metrics, overallMet)
: computeMatchRate(metrics, backendMatchRate)),
[metrics, backendMatchRate, overallMet],
);
const trafficState = useMemo(
() => getTrafficLightState(matchRate, metrics),
[matchRate, metrics],
() => (overallMet != null
? resolveSideTrafficState(metrics, overallMet)
: getTrafficLightState(matchRate, metrics)),
[matchRate, metrics, overallMet],
);
const { visualRef, lightRef } = useSignalVisualRailHeight([
metrics.length,