commit 597ac62e48bc48745186c03427fff5d588c89155 parent 294ee65999993477479fb1106b42358747d95b81 Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st> Date: Mon, 5 Oct 2026 03:13:22 -0400 report views carry a claim's title and a source's note; the report page heads a claim with its title and quotes the claim under it; the fixture uses both Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Diffstat:
6 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/common/lib/report/views.test.ts b/common/lib/report/views.test.ts @@ -35,6 +35,7 @@ const report: Report = { kind: "article", title: "An article", url: "https://example.org/a", + note: "The first edition.", archives: [{ label: "archive", url: "https://archive.example.org/a" }], saved: "sources/s0/page.html", }, @@ -54,6 +55,7 @@ const report: Report = { claims: [ { id: "c1", + title: "One", text: "Claim one.", verdict: "CONTRADICTED", sourceQuote: { citation: "s1" }, @@ -122,6 +124,7 @@ test("a source citation carries its document (never the saved copy) and its publ assert.equal(s1.href, "https://example.org/a"); assert.equal("saved" in s1.source, false); assert.equal(view.subject?.title, "An article"); + assert.equal(view.subject?.note, "The first edition."); assert.equal(view.subject && "saved" in view.subject, false); assert.ok(!JSON.stringify(view).includes("sources/s0/page.html")); }); @@ -137,6 +140,7 @@ test("a page citation links out; the verdict overrides are laid over the default test("the view keeps the claim structure, with the source sentence as an id", () => { assert.deepEqual(view.sections[0].claims[0], { id: "c1", + title: "One", text: "Claim one.", verdict: "CONTRADICTED", sourceQuote: "s1", @@ -175,10 +179,10 @@ test("cited-in entries resolve to the claim's anchor with titles and the citatio const index = buildCitedIn([report]); const entries = citedInViews(index["demo-podcast/ep-1/10.50-20.00"], [view]); assert.deepEqual( - entries.map((e) => [e.href, e.claimText, e.verdict, e.verdictStyle?.label, e.number]), + entries.map((e) => [e.href, e.claimTitle, e.claimText, e.verdict, e.verdictStyle?.label, e.number]), [ - ["/reports/demo/#c1", "Claim one.", "CONTRADICTED", "Contradicted", 4], - ["/reports/demo/#c2", "Claim two.", "PARTLY", "Half", 4], + ["/reports/demo/#c1", "One", "Claim one.", "CONTRADICTED", "Contradicted", 4], + ["/reports/demo/#c2", undefined, "Claim two.", "PARTLY", "Half", 4], ], ); const summary = citedInViews(index["demo-channel/abc123/3126.00-3151.00"], [view]); diff --git a/common/lib/report/views.ts b/common/lib/report/views.ts @@ -337,7 +337,7 @@ function sourceView(id: string, s: Source): SourceView { ...(s.publisher ? { publisher: s.publisher } : {}), ...(s.author ? { author: s.author } : {}), ...(s.date ? { date: s.date } : {}), - ...((s as { note?: string }).note ? { note: (s as { note?: string }).note } : {}), + ...(s.note ? { note: s.note } : {}), archives: s.archives ?? [], }; } @@ -444,7 +444,7 @@ export function buildReportPageView(report: Report, resolve: ReportViewResolver) claims: (s.claims ?? []).map((c) => defined({ id: c.id, - title: (c as { title?: string }).title, + title: c.title, text: c.text, verdict: c.verdict, sourceQuote: c.sourceQuote?.citation, diff --git a/export/app/lib/reports.test.ts b/export/app/lib/reports.test.ts @@ -87,7 +87,12 @@ test("the report page: header, tally, sections and claims, inline cites, referen assert.ok(html.includes("as published on the day")); assert.match(html, /data-verdict-tally=""/); for (const v of ["CORROBORATED", "PARTLY", "CONTRADICTED", "UNTESTABLE"]) assert.match(html, new RegExp(`data-verdict="${v}"`)); + assert.ok(html.includes("Read in the edition published on the day"), "the source's note, under its byline"); assert.match(html, /<section id="bridge"/); + // a claim with a title: the title heads it, the claim's text follows as what the article says + assert.match(html, /<article id="claim-1"[^]*?<h3[^>]*><a href="#claim-1"[^>]*>“He opened it himself”<\/a><\/h3>[^]*?The article says: <q[^>]*>He opened the bridge himself in 2018.<\/q>/); + // a claim without one is headed by its text + assert.match(html, /<h3[^>]*><a href="#claim-2"[^>]*>He went back to the bridge every year.<\/a>/); assert.match(html, /<article id="claim-1"/); // the source sentence's still, under the claim assert.match(html, /data-source-sentence="a01"[^]*?<img src="\/reports\/demo-factcheck\/stills\/a01.png"/); @@ -116,6 +121,7 @@ test("a video moment: the clip, quote, verification, cue lines, original link, c assert.match(html, /data-cited-in=""/); assert.match(html, /href="\/reports\/demo-factcheck\/"[^>]*>Checking an example article/); assert.match(html, /href="\/reports\/demo-factcheck\/#claim-1"/); + assert.ok(html.includes("— “He opened it himself”"), "a cited-in entry names the claim by its title"); assert.match(html, /href="\/reports\/demo-factcheck\/#claim-5"/); }); diff --git a/export/fixtures/report-site/public/m/demo-channel/abc123/3126.00-3151.00/moment.json b/export/fixtures/report-site/public/m/demo-channel/abc123/3126.00-3151.00/moment.json @@ -83,6 +83,7 @@ "href": "/reports/demo-factcheck/#claim-1", "reportTitle": "Checking an example article", "sectionTitle": "The bridge", + "claimTitle": "“He opened it himself”", "claimText": "He opened the bridge himself in 2018.", "verdict": "CONTRADICTED", "verdictStyle": { diff --git a/export/fixtures/report-site/public/reports/demo-factcheck/page.json b/export/fixtures/report-site/public/reports/demo-factcheck/page.json @@ -16,6 +16,7 @@ "publisher": "Example Gazette", "author": "A. Writer", "date": "2026-09-20", + "note": "Read in the edition published on the day; it has since been revised.", "archives": [ { "label": "archive.org", @@ -109,6 +110,7 @@ "publisher": "Example Gazette", "author": "A. Writer", "date": "2026-09-20", + "note": "Read in the edition published on the day; it has since been revised.", "archives": [ { "label": "archive.org", @@ -143,6 +145,7 @@ "publisher": "Example Gazette", "author": "A. Writer", "date": "2026-09-20", + "note": "Read in the edition published on the day; it has since been revised.", "archives": [ { "label": "archive.org", @@ -181,6 +184,7 @@ "claims": [ { "id": "claim-1", + "title": "“He opened it himself”", "text": "He opened the bridge himself in 2018.", "verdict": "CONTRADICTED", "sourceQuote": "a01", diff --git a/export/fixtures/report-site/source/demo-factcheck/report.json b/export/fixtures/report-site/source/demo-factcheck/report.json @@ -17,6 +17,7 @@ "publisher": "Example Gazette", "author": "A. Writer", "date": "2026-09-20", + "note": "Read in the edition published on the day; it has since been revised.", "archives": [ { "label": "archive.org", "url": "https://web.archive.org/web/2026/https://example.org/articles/demo", "context": "as published on the day" } ] @@ -83,6 +84,7 @@ "claims": [ { "id": "claim-1", + "title": "“He opened it himself”", "text": "He opened the bridge himself in 2018.", "verdict": "CONTRADICTED", "sourceQuote": { "citation": "a01" },