diff --git a/src/components/exams/exam-questions-panel.tsx b/src/components/exams/exam-questions-panel.tsx index e6dfc9f..71168de 100644 --- a/src/components/exams/exam-questions-panel.tsx +++ b/src/components/exams/exam-questions-panel.tsx @@ -142,7 +142,11 @@ export function ExamQuestionsPanel(props: { const insertFromBank = async (bankQuestionId: string, subjectId: string) => { await postExamQuestionFromBank(props.examId, bankQuestionId, subjectId); - closeAfterGesture(() => setBankOpen(false)); + // The request finishes after the original pointer gesture, so deferring + // this close leaves the panel open until another event loop turn and can + // race with the surrounding refetch. Close the controlled surface now; + // the async request already guarantees the tap cannot fall through. + setBankOpen(false); setFlash(t("bank.inserted")); await refetch(); }; @@ -268,7 +272,7 @@ export function ExamQuestionsPanel(props: { closeAfterGesture(() => setBankOpen(false))} + onCancel={() => setBankOpen(false)} /> diff --git a/src/pages/builder-login-page.tsx b/src/pages/builder-login-page.tsx index 745f1e3..f650756 100644 --- a/src/pages/builder-login-page.tsx +++ b/src/pages/builder-login-page.tsx @@ -6,6 +6,7 @@ import { AuthPageShell } from "@/components/auth/auth-page-shell"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; +import { GuestGuard } from "@/components/layout/guest-guard"; import { IconEye, IconEyeOff } from "@/components/ui/icons"; import { PageSpinner } from "@/components/ui/page-spinner"; import { useAuth } from "@/stores/auth-context"; @@ -20,9 +21,11 @@ const MAX_PASSWORD_LEN = 128; export default function BuilderLoginPage() { return ( - - - + + + + + ); } diff --git a/src/test-setup.ts b/src/test-setup.ts index 9b0cda2..1753ec7 100644 --- a/src/test-setup.ts +++ b/src/test-setup.ts @@ -2,6 +2,9 @@ // --localstorage-file is provided, and this jsdom version does not expose one // for the configured test origin. Keep the test storage local to each worker. if (typeof window !== "undefined") { + // jsdom intentionally does not implement scrolling and logs a warning when + // UI code calls it. Scrolling is outside the scope of these component tests. + window.scrollTo = () => undefined; const values = new Map(); const storage = { get length() { return values.size; },