Report button moves under the exercise, bottom-right
The red "!" left the top chrome (it read as chrome and was easy to mis-tap) and now sits in a row under the exercise: the AI disclaimer stays centred, the report control is right-aligned with the card edge and is a 44px target. Applies to study, Smart Review and exam sessions; the results slides keep just the disclaimer. phase-2 suite now asserts the placement (below the card, right-aligned, not in the header, >=44px) — 60 checks. README: decision 52 updated. SW -> freezmo-v43.
This commit is contained in:
parent
43dd4e4ec9
commit
33c0ad1ed0
6 changed files with 88 additions and 37 deletions
|
|
@ -142,7 +142,37 @@ const browser = await launchBrowser();
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
const report = page.getByRole("button", { name: "Report question" });
|
||||
check("report: button sits in the feed chrome", await report.isVisible());
|
||||
check("report: button visible", await report.isVisible());
|
||||
// It belongs under the card now: bottom-right corner of the exercise, not
|
||||
// in the top chrome where it was easy to mis-tap.
|
||||
const placement = await page.evaluate(() => {
|
||||
const prompt = [...document.querySelectorAll("p")].find(
|
||||
(el) => el.textContent === "What colour is a clear daytime sky?",
|
||||
);
|
||||
const card = prompt?.closest(".glass-solid");
|
||||
const button = document.querySelector('[aria-label="Report question"]');
|
||||
if (!card || !button) return null;
|
||||
const c = card.getBoundingClientRect();
|
||||
const b = button.getBoundingClientRect();
|
||||
return {
|
||||
inChrome: Boolean(button.closest("header")),
|
||||
belowCard: b.top >= c.bottom - 6,
|
||||
rightAligned: Math.abs(b.right - c.right) <= 10,
|
||||
rightSide: b.left + b.width / 2 > c.left + c.width / 2,
|
||||
size: [Math.round(b.width), Math.round(b.height)],
|
||||
};
|
||||
});
|
||||
check(
|
||||
"report: sits bottom-right under the card, 44px",
|
||||
Boolean(placement) &&
|
||||
!placement.inChrome &&
|
||||
placement.belowCard &&
|
||||
placement.rightAligned &&
|
||||
placement.rightSide &&
|
||||
placement.size[0] >= 43.5 &&
|
||||
placement.size[1] >= 43.5,
|
||||
JSON.stringify(placement),
|
||||
);
|
||||
await report.click();
|
||||
await page.waitForTimeout(700);
|
||||
check("report: toast with Undo", await page.getByText("Question reported").isVisible());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue