feat(ui): differentiate pull vs site update blame in colophon staleness notice

Show whether staleness is due to crawler checks or site updates in Colophon, and add an expandable per-source breakdown.
This commit is contained in:
Lucas Winther committed 2026-09-18 08:55:10 +02:00
1 parent 6c09accc20
commit 347d4ddad8
4 files changed
+110 -4

No files matched your search

+27
View File
@@ -237,6 +237,8 @@ describe("Colophon freshness notice (PRD F7)", () => {
game: "genshin" as const,
url: "https://game8.co/games/Genshin-Impact/archives/301601",
lastSuccessAt: new Date(NOW - 3 * HOUR).toISOString(),
lastConfirmedAt: null,
contentChangedAt: null,
eventCount: 9,
parsedCount: 9,
@@ -277,6 +279,31 @@ describe("Colophon freshness notice (PRD F7)", () => {
expect(html).toContain("3h 0m ago");
});
test("differentiates blame when data was pulled recently but site has not changed", () => {
const html = renderToStaticMarkup(
<Colophon
sources={[
fresh,
{
...fresh,
sourceId: "endfield-wikigg-events",
game: "endfield",
url: "https://endfield.wiki.gg/wiki/Event",
lastSuccessAt: new Date(NOW - 57 * HOUR).toISOString(),
lastConfirmedAt: new Date(NOW - 11 * HOUR).toISOString(),
contentChangedAt: new Date(NOW - 57 * HOUR).toISOString(),
},
]}
now={NOW}
/>,
);
expect(html).toContain("Arknights: Endfield");
expect(html).toContain("data pulled 11h 0m ago, site updated 2d 9h ago");
expect(html).toContain("Source breakdown");
expect(html).toContain("wiki.gg");
expect(html).toContain("site has no new updates");
});
test("summarises instead of listing when every game is behind", () => {
// What a refresh that stopped running looks like. Ten names each repeating
// the same age is less readable than the count this replaced.
+2
View File
@@ -165,6 +165,8 @@ describe("the app's links into them", () => {
game: "genshin",
url: "https://game8.co/games/Genshin-Impact/archives/301601",
lastSuccessAt: new Date(NOW - 3 * 60 * 60 * 1000).toISOString(),
lastConfirmedAt: null,
contentChangedAt: new Date(NOW - 3 * 60 * 60 * 1000).toISOString(),
eventCount: 9,
parsedCount: 9,