detailed data for verifications

This commit is contained in:
2026-07-02 18:48:15 +05:30
parent bf019f86c3
commit 4d71e08aa4
5 changed files with 77 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
import { useCallback, useEffect, useState } from "react";
import {
api, exportProjectUrl, exportVideoUrl, fmtDuration, fmtWhen, setAuthToken,
api, exportProjectUrl, exportVideoUrl, fmtDuration, fmtWhen, passDeltas, setAuthToken,
type Activity, type Member, type ProjectSummary, type Stats, type UserRow, type VideoRow,
} from "./api";
import { RemarkCell } from "./RemarkCell";
@@ -505,15 +505,27 @@ export function App() {
{v.annotation_count > 0
? <a href={exportVideoUrl(v.id)} download title="Download this video's annotations (JSON)">{v.annotation_count} </a>
: 0}
{v.imported_count > 0 && (
<div className="imported-line" title="annotations present when verification started (imported baseline)">
<span className="dim">imported {v.imported_count}</span>
{v.annotation_count < v.imported_count &&
<span className="ann-del" title={`${v.imported_count - v.annotation_count} deleted by the user`}> · {v.imported_count - v.annotation_count}</span>}
{v.annotation_count > v.imported_count &&
<span className="ann-add" title={`${v.annotation_count - v.imported_count} added by the user`}> · +{v.annotation_count - v.imported_count}</span>}
</div>
)}
{(v.imported_count > 0 || (v.passes?.length ?? 0) > 0) && (() => {
const deltas = passDeltas(v.imported_count, v.passes ?? []);
return (
<div className="imported-line" title="imported baseline → per-pass changes (verify / re-verify)">
<span className="dim">imported {v.imported_count}</span>
{deltas.length > 0
? deltas.map((d, i) => (
<span key={i} className={d.delta >= 0 ? "ann-add" : "ann-del"}
title={`${d.label} by ${d.username}${d.total} total`}>
{" · "}{d.label} {d.delta >= 0 ? "+" : ""}{d.delta}
</span>
))
: <>
{v.annotation_count < v.imported_count &&
<span className="ann-del" title={`${v.imported_count - v.annotation_count} deleted by the user`}> · {v.imported_count - v.annotation_count}</span>}
{v.annotation_count > v.imported_count &&
<span className="ann-add" title={`${v.annotation_count - v.imported_count} added by the user`}> · +{v.annotation_count - v.imported_count}</span>}
</>}
</div>
);
})()}
</td>
<td>{v.review_count > 0
? <span className="review-flag" title={`${v.review_count} annotation(s) flagged for review`}>🚩 {v.review_count}</span>