Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions components/reports/publish-flow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2448,9 +2448,12 @@ export function CheckRow({ name, result, advice = true, overruled = false }: { n
<motion.div className={cn("absolute inset-y-0 start-0 rounded-full", result.pass ? "bg-success" : result.blocking ? "bg-destructive" : "bg-warning")} initial={{ width: "0%" }} animate={{ width: `${Math.max(sure, 2)}%` }} transition={reduce ? { duration: 0 } : { duration: 0.5, ease: EASE }} />
<span aria-hidden className="absolute inset-y-0 w-0.5 bg-foreground/50" style={{ insetInlineStart: `${need}%` }} />
</div>
<span className="min-w-12 shrink-0 text-end text-xs tabular-nums">
<span className="font-medium text-foreground/80">{result.answer === "unclear" ? t("check.unclear") : t("check.sure", { percent: format.number(sure / 100, { style: "percent" }) })}</span>
</span>
{/* What the number is, on hover or focus: walkers read 99% as progress or a grade. */}
<TooltipHint label={t(result.answer === "unclear" ? "check.unclearWhy" : "check.sureWhy", { need: format.number(need / 100, { style: "percent" }) })}>
<span tabIndex={0} className="min-w-12 shrink-0 cursor-help rounded-sm text-end text-xs tabular-nums outline-offset-2 focus-visible:outline-2 focus-visible:outline-ring">
<span className="font-medium text-foreground/80">{result.answer === "unclear" ? t("check.unclear") : t("check.sure", { percent: format.number(sure / 100, { style: "percent" }) })}</span>
</span>
</TooltipHint>
</div>
) : result.evidence ? null : (
<p className="ms-8 mt-1.5 text-xs/5 text-muted-foreground">{inWords(result.detail)}</p>
Expand Down Expand Up @@ -3490,12 +3493,12 @@ function ReportCover({ basics, report, slot }: { basics: Basics; report: Report
};
}, []);
// The report's facts, as rows of a label and its value, as the bill under them reads.
const facts: Array<{ id: string; label: string; value: ReactNode; href?: string }> = [
const facts: Array<{ id: string; label: string; value: ReactNode; href?: string; /** What the value means, on hover or focus. */ why?: string }> = [
...(live ? [{ id: "status", label: t("status"), value: <span className="inline-flex items-center gap-1 font-medium ink-success"><BadgeCheck className="size-3.5" />{t("live")}</span> }] : []),
...(landing && landingHost ? [{ id: "landing", label: tLead("leadsTo"), value: landing.place === "notice" ? tLead("leadsToAfter", { host: landingHost, seconds: NOTICE_SECONDS }) : landingHost, href: landing.url.trim() }] : []),
...(report?.pdf?.pages !== undefined ? [{ id: "pdf", label: t("steps.upload"), value: t("pages", { count: report.pdf.pages }) }] : []),
...(report ? [{ id: "agreement", label: t("steps.agreement"), value: t("version", { version: report.agreementVersion }), href: `/publish/agreements/${report.key}` }] : []),
...(report?.checksVersion ? [{ id: "checks", label: t("steps.checks"), value: t("version", { version: report.checksVersion }) }] : []),
...(report ? [{ id: "agreement", label: t("steps.agreement"), value: t("version", { version: report.agreementVersion }), href: `/publish/agreements/${report.key}`, why: t("agreementVersionWhy") }] : []),
...(report?.checksVersion ? [{ id: "checks", label: t("steps.checks"), value: t("version", { version: report.checksVersion }), why: t("checksVersionWhy") }] : []),
// What was chosen when it was signed, kept in sight on the steps after, where the choices are locked. Live, the
// screen shows both itself: who gets the file, and the archive's chip.
...(report && !live ? [{ id: "file", label: t("fileAccess.short"), value: report.fileAccess.mode === "embargo" ? t("fileAccess.until", { date: format.dateTime(new Date(`${report.fileAccess.until}T00:00:00Z`), { dateStyle: "medium", timeZone: "UTC" }) }) : t(`fileAccess.${report.fileAccess.mode}`) }] : []),
Expand Down Expand Up @@ -3541,11 +3544,17 @@ function ReportCover({ basics, report, slot }: { basics: Basics; report: Report
{/* The labels are a word each and keep it; a long value ("Embargoed until Nov 20, 2027") wraps instead. */}
<dt className="shrink-0 text-muted-foreground">{fact.label}</dt>
<dd className="min-w-0 text-end tabular-nums">
{fact.href ? (
{fact.why && !fact.href ? (
<TooltipHint label={fact.why}>
<span tabIndex={0} className="cursor-help rounded-sm underline decoration-border decoration-dotted underline-offset-4 outline-offset-2 focus-visible:outline-2 focus-visible:outline-ring">{fact.value}</span>
</TooltipHint>
) : fact.href ? (
// The agreement as signed, in a tab of its own to read, save or print.
<Link href={fact.href} target="_blank" rel="noopener noreferrer" className="inline-flex items-center gap-0.5 rounded-sm underline-offset-2 outline-offset-2 hover:underline focus-visible:outline-2 focus-visible:outline-ring">
{fact.value} <ArrowUpRight className="size-3" />
</Link>
<TooltipHint label={fact.why}>
<Link href={fact.href} target="_blank" rel="noopener noreferrer" className="inline-flex items-center gap-0.5 rounded-sm underline-offset-2 outline-offset-2 hover:underline focus-visible:outline-2 focus-visible:outline-ring">
{fact.value} <ArrowUpRight className="size-3" />
</Link>
</TooltipHint>
) : (
fact.value
)}
Expand Down
10 changes: 7 additions & 3 deletions messages/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -6438,11 +6438,11 @@
"untitled": "Untitled report",
"action": {
"openPage": "Open its page",
"open": "Open",
"open": "See where it stands",
"activate": "Pay",
"carryOn": "Carry on",
"seeFailed": "See what failed",
"manage": "Open in Publish"
"manage": "Manage its DOI, file and details"
},
"seeChanges": "See your changes",
"correct": "Correct the details",
Expand Down Expand Up @@ -6920,6 +6920,8 @@
"saveFailed": "Your changes couldn't be saved",
"agreementTitle": "Publishing agreement for {series}",
"version": "Version {version}",
"agreementVersionWhy": "The wording of the agreement you signed. If the series changes its agreement later, yours stays this one.",
"checksVersionWhy": "The set of checks your report was checked with. Changes to the series' checks later never re-check it.",
"agreementIntro": "{id, select, docid {You keep the copyright and choose the licence, which can't change once you sign. Signing reserves your DOCiD.} other {You keep the copyright and choose the licence, which can't change once you sign. Signing reserves your DOI.}}",
"signedBy": "Signed by",
"agree": "I agree to this agreement for the report's authors, who have all agreed. I am one of them, or they asked me to sign",
Expand Down Expand Up @@ -7017,6 +7019,8 @@
"flagged": "Flagged",
"unclear": "Unclear",
"sure": "{percent}",
"sureWhy": "How sure the check is that your report passes. It passes at {need} or more, the line on the bar.",
"unclearWhy": "The check couldn't tell from your report whether it passes. A reviewer looks at it.",
"foundIn": "Found in {where}",
"foundAs": "Found as",
"said": {
Expand Down Expand Up @@ -7306,7 +7310,7 @@
"currency": "This workspace’s Stripe account is in {currency}, and reports are paid in US dollars, so a card can’t pay here until we change it.",
"emailUs": "Email us",
"saveCard": "Save a card",
"codeOff": "{off} off the {amount} a card pays",
"codeOff": "{off} off {amount}",
"charged": "Charged to a card",
"voucher": "Voucher"
},
Expand Down
10 changes: 7 additions & 3 deletions messages/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -6438,11 +6438,11 @@
"untitled": "Untitled report",
"action": {
"openPage": "Open its page",
"open": "Open",
"open": "See where it stands",
"activate": "Pay",
"carryOn": "Carry on",
"seeFailed": "See what failed",
"manage": "Open in Publish"
"manage": "Manage its DOI, file and details"
},
"seeChanges": "See your changes",
"correct": "Correct the details",
Expand Down Expand Up @@ -6920,6 +6920,8 @@
"saveFailed": "Your changes couldn't be saved",
"agreementTitle": "Publishing agreement for {series}",
"version": "Version {version}",
"agreementVersionWhy": "The wording of the agreement you signed. If the series changes its agreement later, yours stays this one.",
"checksVersionWhy": "The set of checks your report was checked with. Changes to the series' checks later never re-check it.",
"agreementIntro": "{id, select, docid {You keep the copyright and choose the license, which can't change once you sign. Signing reserves your DOCiD.} other {You keep the copyright and choose the license, which can't change once you sign. Signing reserves your DOI.}}",
"signedBy": "Signed by",
"agree": "I agree to this agreement for the report's authors, who have all agreed. I am one of them, or they asked me to sign",
Expand Down Expand Up @@ -7017,6 +7019,8 @@
"flagged": "Flagged",
"unclear": "Unclear",
"sure": "{percent}",
"sureWhy": "How sure the check is that your report passes. It passes at {need} or more, the line on the bar.",
"unclearWhy": "The check couldn't tell from your report whether it passes. A reviewer looks at it.",
"foundIn": "Found in {where}",
"foundAs": "Found as",
"said": {
Expand Down Expand Up @@ -7306,7 +7310,7 @@
"currency": "This workspace’s Stripe account is in {currency}, and reports are paid in US dollars, so a card can’t pay here until we change it.",
"emailUs": "Email us",
"saveCard": "Save a card",
"codeOff": "{off} off the {amount} a card pays",
"codeOff": "{off} off {amount}",
"charged": "Charged to a card",
"voucher": "Voucher"
},
Expand Down
Loading