diff --git a/openspec/changes/refine-visitor-pages-and-shell/tasks.md b/openspec/changes/refine-visitor-pages-and-shell/tasks.md
index 389d6de..2a3e75f 100644
--- a/openspec/changes/refine-visitor-pages-and-shell/tasks.md
+++ b/openspec/changes/refine-visitor-pages-and-shell/tasks.md
@@ -21,13 +21,13 @@ Verify for every task: `cd solvway-admin-portal && npx vitest run; echo VITEST=$
- [x] 2.1 `VisitorCard` (ground, card, event header with the company label, the dates and location with icons, footer) and `VisitorState` (icon, heading, text, action). `RegistrationForm` drops its header, adds the "Mobile or email is required" hint (new key in `defaultMessages.ts`), sets the notice as fine print, and aligns the consent row.
- Depends on: 1.3
- Scope: `solvway-admin-portal/app/components/registration/**` except `QrCodeItem*`, `solvway-admin-portal/app/lib/i18n/defaultMessages.ts`
-- [ ] 2.2 `/r`, `/i` and `/c` render every state inside `VisitorCard`, with `VisitorState` for loading, inactive, error, too many, not yet, ended, thank you, welcome and checked in. Existing behaviour and text stay the same.
+- [x] 2.2 `/r`, `/i` and `/c` render every state inside `VisitorCard`, with `VisitorState` for loading, inactive, error, too many, not yet, ended, thank you, welcome and checked in. Existing behaviour and text stay the same.
- Depends on: 2.1
- Scope: `solvway-admin-portal/app/r/**`, `solvway-admin-portal/app/i/**`, `solvway-admin-portal/app/c/**`
## 3. Staff screens
-- [ ] 3.1 My QR codes as cards: the event name as the title, dates and location, the switched-off badge in the card header, the QR and a wrapping button row.
+- [x] 3.1 My QR codes as cards: the event name as the title, dates and location, the switched-off badge in the card header, the QR and a wrapping button row.
- Depends on: 2.2
- Scope: `solvway-admin-portal/app/my-qr/**`, `solvway-admin-portal/app/components/registration/QrCodeItem*`
- [x] 3.2 Reset password uses the login page's two-column frame. Remove the stale brown and gold comments in login.
diff --git a/solvway-admin-portal/app/c/[token]/page.card.test.tsx b/solvway-admin-portal/app/c/[token]/page.card.test.tsx
new file mode 100644
index 0000000..b8e673a
--- /dev/null
+++ b/solvway-admin-portal/app/c/[token]/page.card.test.tsx
@@ -0,0 +1,83 @@
+import { describe, it, expect, vi, beforeEach } from "vitest";
+import { render, screen } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+
+const mocks = vi.hoisted(() => ({ getCheckin: vi.fn(), lookupCheckin: vi.fn(), registerWalkIn: vi.fn() }));
+vi.mock("@/app/lib/services/publicInvite", () => mocks);
+vi.mock("next/navigation", () => ({ useParams: () => ({ token: "chk1" }) }));
+
+import { ApiError } from "@/app/lib/clientApi";
+import CheckinPage from "./page";
+
+const open = {
+ state: "OPEN", eventName: "Expo 2026", startDate: "2026-12-01", endDate: "2026-12-02", location: "KLCC", companyName: "INS",
+ notice: { id: 7, textEn: "We keep your data safe.", textMs: "Data anda selamat." }, interests: [],
+};
+
+beforeEach(() => {
+ mocks.getCheckin.mockReset().mockResolvedValue(open);
+ mocks.lookupCheckin.mockReset().mockResolvedValue({ result: "CHECKED_IN", firstName: "Aini" });
+ mocks.registerWalkIn.mockReset().mockResolvedValue({});
+});
+
+const h1s = () => screen.getAllByRole("heading", { level: 1 });
+
+describe("/c visitor card", () => {
+ it("lookup sits in the card under the event header with one h1", async () => {
+ render();
+ await screen.findByLabelText("Mobile number or email");
+ expect(screen.getByText("INS", { selector: "p" })).toBeTruthy();
+ expect(h1s().map((h) => h.textContent)).toEqual(["Expo 2026"]);
+ expect(screen.getByText("2026-12-01 - 2026-12-02")).toBeTruthy();
+ expect(document.querySelectorAll("main").length).toBe(1);
+ });
+
+ it("walk-in form shows the notice before consent under one h1", async () => {
+ const user = userEvent.setup();
+ mocks.lookupCheckin.mockResolvedValue({ result: "FORM" });
+ render();
+ await user.type(await screen.findByLabelText("Mobile number or email"), "0123456789");
+ await user.click(screen.getByRole("button", { name: "Check in" }));
+ await screen.findByLabelText("Your name");
+ const notice = screen.getByText("We keep your data safe.");
+ expect(notice.compareDocumentPosition(screen.getByLabelText(/I agree to INS/)) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
+ expect(h1s().map((h) => h.textContent)).toEqual(["Expo 2026"]);
+ });
+
+ it("welcome shows an icon and heading under the event header", async () => {
+ const user = userEvent.setup();
+ render();
+ await user.type(await screen.findByLabelText("Mobile number or email"), "0123456789");
+ await user.click(screen.getByRole("button", { name: "Check in" }));
+ const s = await screen.findByRole("status");
+ expect(s.querySelector("svg")).toBeTruthy();
+ expect(screen.getByRole("heading", { level: 2 }).textContent).toBe("Welcome, Aini. You're checked in.");
+ expect(h1s().map((h) => h.textContent)).toEqual(["Expo 2026"]);
+ });
+
+ it("not yet and ended have an icon and the heading as the only h1", async () => {
+ mocks.getCheckin.mockResolvedValue({ state: "NOT_YET", startDate: "2026-12-01" });
+ const { unmount } = render();
+ const s = await screen.findByRole("status");
+ expect(s.querySelector("svg")).toBeTruthy();
+ expect(h1s().map((h) => h.textContent)).toEqual(["Check-in opens on 2026-12-01."]);
+ unmount();
+ mocks.getCheckin.mockResolvedValue({ state: "ENDED", startDate: "2026-12-01" });
+ render();
+ await screen.findByText("This event has ended.");
+ expect(h1s().length).toBe(1);
+ expect(document.querySelectorAll("main").length).toBe(1);
+ });
+
+ it("inactive and load error are alerts with one h1 and no event details", async () => {
+ mocks.getCheckin.mockRejectedValue(new ApiError("x", 404, { code: "CODE_INACTIVE" }));
+ const { unmount } = render();
+ expect((await screen.findByRole("alert")).querySelector("svg")).toBeTruthy();
+ expect(h1s().map((h) => h.textContent)).toEqual(["This code is no longer active."]);
+ unmount();
+ mocks.getCheckin.mockRejectedValue(new ApiError("x", 500, {}));
+ render();
+ await screen.findByRole("alert");
+ expect(h1s().length).toBe(1);
+ });
+});
diff --git a/solvway-admin-portal/app/c/[token]/page.tsx b/solvway-admin-portal/app/c/[token]/page.tsx
index 9e22938..d25d82d 100644
--- a/solvway-admin-portal/app/c/[token]/page.tsx
+++ b/solvway-admin-portal/app/c/[token]/page.tsx
@@ -2,9 +2,11 @@
import { useEffect, useState, type FormEvent } from "react";
import { useParams } from "next/navigation";
+import { AlertCircle, CheckCircle2, Clock, Loader2 } from "lucide-react";
import { Button } from "@/app/components/ui/button";
import { Input } from "@/app/components/ui/input";
import { Label } from "@/app/components/ui/label";
+import { VisitorCard, VisitorState } from "@/app/components/registration/VisitorCard";
import { RegistrationForm, apiData, failMessage } from "@/app/components/registration/RegistrationForm";
import { getCheckin, lookupCheckin, registerWalkIn, type CheckinState } from "@/app/lib/services/publicInvite";
import { useT } from "@/app/lib/i18n/MessagesProvider";
@@ -57,19 +59,22 @@ export default function CheckinPage() {
}
const open = state?.state === "OPEN" ? state : null;
+ const alone = (icon: typeof Clock, heading: string, role: "status" | "alert", tone?: "error") => (
+
+ );
+ if (phase === "loading") return alone(Loader2, t("UiLoading"), "status");
+ if (phase === "inactive") return alone(AlertCircle, t("RegInactive"), "alert");
+ if (phase === "error" || !state) return alone(AlertCircle, error ?? "", "alert", "error");
+ if (!open) return alone(Clock, state.state === "NOT_YET" ? t("ChkNotYet", { date: state.startDate }) : t("ChkEnded"), "status");
+
let body;
- if (phase === "loading") body =
{t("UiLoading")}
;
- else if (phase === "inactive") body = {t("RegInactive")}
;
- else if (phase === "error" || !state) body = {error}
;
- else if (!open) body = {state.state === "NOT_YET" ? t("ChkNotYet", { date: state.startDate }) : t("ChkEnded")}
;
- else if (phase === "welcome") body = {firstName ? t("InviteWelcome", { name: firstName }) : t("InviteWelcomeAnon")}
;
- else if (phase === "done") body = {t("ChkDone", { event: open.eventName })}
;
+ if (phase === "welcome") body = ;
+ else if (phase === "done") body = ;
else if (phase === "form") {
body = registerWalkIn(token, b)} onDone={() => setPhase("done")} onInactive={() => setPhase("inactive")} />;
} else {
body = (