AI disclaimer: also on the cards and the results

The note now rides along with the content itself, not only with the
generation screens and the chat composer:

- Under every card in the study feed and in the review, mistakes and exam
  sessions (the activity slide's last element — below the card, and below
  the feedback panel once answered).
- On the results slides: the study results screen and the shared session
  results (review, mistakes, exam).

Navigation surfaces (library, deck lists, chat history, settings) still
carry no note — it belongs to the moment of generation and to the card
being answered, not to browsing (README decision 50 updated).

The phase-2 grading check now scopes its placement (the disclaimer right
under the graded box) since the same text legitimately appears several
times on a session page; three new checks cover the feed, the results
slide and the exam (59 checks). SW -> freezmo-v40.
This commit is contained in:
Martin Dvořák 2026-10-12 10:59:49 +00:00
commit b5269d2844
5 changed files with 44 additions and 9 deletions

View file

@ -119,7 +119,13 @@ const browser = await launchBrowser();
await page.getByRole("button", { name: "Submit answer" }).click();
await page.waitForTimeout(800);
check("grading: AI feedback rendered", await page.getByText("Nice — scattering does the work.").isVisible());
check("grading: AI disclaimer under the feedback", await page.getByText("Freezmo uses AI and can make mistakes").isVisible());
// Scope it to the placement: the disclaimer directly under the graded box.
const feedbackDisclaimer = await page.evaluate(() => {
const feedback = [...document.querySelectorAll("p")].find((el) => el.textContent.includes("Nice — scattering does the work."));
const next = feedback?.closest("div")?.nextElementSibling;
return Boolean(next?.textContent?.includes("Freezmo uses AI"));
});
check("grading: AI disclaimer under the feedback", feedbackDisclaimer);
await context.close();
}
@ -184,7 +190,6 @@ const browser = await launchBrowser();
title: "Flashcards",
activities: [
{ type: "flashcard", id: "f1", xp: 10, topic: "Sky", front: "Why is the sky blue?", back: "Rayleigh scattering.", explanation: "e" },
{ type: "flashcard", id: "f2", xp: 10, topic: "Sky", front: "Second question", back: "Second answer", explanation: "e" },
],
};
await seed(page, { decks: [flashDeck] });
@ -201,6 +206,10 @@ const browser = await launchBrowser();
const atRest = await faces();
check("flashcard: front face painted at rest", atRest.front === "visible" && atRest.back === "hidden", JSON.stringify(atRest));
check(
"feed: AI disclaimer under the card",
(await page.getByText("Freezmo uses AI and can make mistakes").count()) >= 1,
);
await page.locator("button.group").first().click();
await page.waitForTimeout(900);
const flipped = await faces();
@ -214,6 +223,19 @@ const browser = await launchBrowser();
await page.waitForTimeout(1000);
const back = await faces();
check("flashcard: flipping back restores the question face", back.front === "visible" && back.back === "hidden", JSON.stringify(back));
// Answer it and check the results slide carries the disclaimer too.
await page.locator("button.group").first().click();
await page.waitForTimeout(800);
await page.getByRole("button", { name: "I knew it" }).click();
await page.waitForTimeout(500);
await page.getByRole("button", { name: "See results" }).click();
await page.waitForTimeout(800);
const resultsDisclaimer = await page.evaluate(() => {
const slides = [...document.querySelectorAll("[data-testid='study-feed'] section")];
return slides[slides.length - 1]?.textContent?.includes("Freezmo uses AI") ?? false;
});
check("results: AI disclaimer on the results slide", resultsDisclaimer);
await context.close();
}
@ -281,6 +303,7 @@ const browser = await launchBrowser();
(await page.getByText("What colour is a clear daytime sky?").count()) === 0 &&
(await page.getByText("What makes the sky blue?").count()) >= 1,
);
check("exam: AI disclaimer under the card", (await page.getByText("Freezmo uses AI and can make mistakes").count()) >= 1);
await context.close();
}