fix(polygon): focus runs on operator playback

This commit is contained in:
DCCONSTRUCTIONS
2026-07-25 17:02:35 +03:00
parent b037076506
commit 2e5c4ba1c5
5 changed files with 100 additions and 65 deletions
@@ -1244,7 +1244,7 @@
display: flex;
height: 2.4rem;
align-items: stretch;
gap: 1px;
gap: 0;
overflow: hidden;
margin: 0 0.65rem;
border-radius: 0.42rem;
@@ -1253,8 +1253,8 @@
}
.polygon-review-timeline button {
min-width: 1px;
flex: 1 1 1px;
min-width: 0;
flex: 1 1 0;
border: 0;
border-radius: 0;
outline: 0;
@@ -1266,9 +1266,8 @@
.polygon-review-timeline button:hover,
.polygon-review-timeline button[data-active="true"] {
min-width: 3px;
opacity: 1;
box-shadow: 0 0 0 1px rgb(255 255 255 / 0.86);
box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.95);
}
.polygon-review-timeline-note {
@@ -88,17 +88,17 @@ function frameColors(
setRgb(
colors,
offset,
groundTruth ? 0.78 : 0.29,
groundTruth ? 0.9 : 0.33,
groundTruth ? 0.42 : 0.38,
groundTruth ? 0.76 : 0.29,
groundTruth ? 0.86 : 0.33,
groundTruth ? 0.52 : 0.36,
);
} else if (mode === "current") {
setRgb(
colors,
offset,
current ? 0.73 : 0.29,
current ? 1 : 0.36,
current ? 0.29 : 0.43,
current ? 0.88 : 0.29,
current ? 0.68 : 0.34,
current ? 0.28 : 0.37,
);
} else if (mode === "candidate") {
if (!candidateAssigned) {
@@ -107,9 +107,9 @@ function frameColors(
setRgb(
colors,
offset,
candidate ? 0.24 : 0.29,
candidate ? 0.84 : 0.36,
candidate ? 1 : 0.43,
candidate ? 0.78 : 0.29,
candidate ? 0.91 : 0.34,
candidate ? 0.48 : 0.37,
);
}
} else if (mode === "disagreement") {
@@ -131,7 +131,7 @@ function frameColors(
disagreement ? 0.22 : 0.35,
);
} else {
setRgb(colors, offset, candidate ? 0.24 : 0.29, candidate ? 0.84 : 0.36, 0.43);
setRgb(colors, offset, candidate ? 0.78 : 0.29, candidate ? 0.91 : 0.34, 0.4);
}
}
return colors;
@@ -430,6 +430,41 @@ export function PolygonRunWorkspace({ route }: PolygonRunWorkspaceProps) {
</div>
</header>
<div className="polygon-review-controls">
<button
type="button"
aria-label={playing ? "Пауза" : "Воспроизвести"}
onClick={() => setPlaying((value) => !value)}
>
{playing ? "Пауза" : "Play"}
</button>
<button
type="button"
aria-label="Предыдущий кадр"
disabled={selectedPosition <= 0}
onClick={() => selectPosition(selectedPosition - 1)}
>
</button>
<button
type="button"
aria-label="Следующий кадр"
disabled={selectedPosition >= orderedFrames.length - 1}
onClick={() => selectPosition(selectedPosition + 1)}
>
</button>
<input
type="range"
min={0}
max={Math.max(0, orderedFrames.length - 1)}
value={selectedPosition}
aria-label="Позиция в записи"
onChange={(event) => selectPosition(Number(event.target.value))}
/>
<span>{selectedPosition + 1} / {orderedFrames.length}</span>
</div>
<div className="polygon-review-stage">
{scene ? (
<LidarGroundPointCloud frame={scene} mode={reviewMode} />
@@ -469,41 +504,6 @@ export function PolygonRunWorkspace({ route }: PolygonRunWorkspaceProps) {
</div>
) : null}
<div className="polygon-review-controls">
<button
type="button"
aria-label={playing ? "Пауза" : "Воспроизвести"}
onClick={() => setPlaying((value) => !value)}
>
{playing ? "Пауза" : "Play"}
</button>
<button
type="button"
aria-label="Предыдущий кадр"
disabled={selectedPosition <= 0}
onClick={() => selectPosition(selectedPosition - 1)}
>
</button>
<button
type="button"
aria-label="Следующий кадр"
disabled={selectedPosition >= orderedFrames.length - 1}
onClick={() => selectPosition(selectedPosition + 1)}
>
</button>
<input
type="range"
min={0}
max={Math.max(0, orderedFrames.length - 1)}
value={selectedPosition}
aria-label="Позиция в записи"
onChange={(event) => selectPosition(Number(event.target.value))}
/>
<span>{selectedPosition + 1} / {orderedFrames.length}</span>
</div>
<div className="polygon-review-order">
<div>
{orderLabels.map(([order, label]) => (