mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
Add the setup flow's browser journeys, axe sweep and string-headroom check
Four journeys, one account each, from the welcome screen to the dashboard: blood pressure and weight typed in, a daily medication added inline, a visit within a month with labs, and a child's managed profile created on the confirm screen. Each asserts what the walk wrote — the module map, the tile order, the checklist, the settled ledger — and the first proves that leaving after Q3 resumes at Q4. Two sweeps on accounts of their own drive the state through the answers route and visit every screen by URL: axe at both widths plus one keyboard-only answer, and every locale with every text node lengthened by 30% before the page, the shell, every clipping box and every control are measured. All six run in one project because each mutates the account it walks. The medication wizard learns to stay where it was mounted after a create, which the first-result screen needs and the medications list does not.
This commit is contained in:
1 parent
02ca15ad6e
commit
2686da2803
12 files changed
+1287
-2
No files matched your search
@@ -86,6 +86,12 @@ export interface MedicationWizardDialogProps {
|
||||
initial?: MedicationPayload;
|
||||
/** Fires with the medication id on a successful create / save. */
|
||||
onSuccess?: (id: string) => void;
|
||||
/**
|
||||
* v1.39 (C2) — whether a create lands on the new medication's page. The
|
||||
* medications list wants that; the setup flow's first-result screen mounts
|
||||
* the wizard inline and shows the result where it stands, so it opts out.
|
||||
*/
|
||||
navigateOnCreate?: boolean;
|
||||
}
|
||||
|
||||
const STEP_ICONS = {
|
||||
@@ -118,6 +124,7 @@ function WizardDialogShell({
|
||||
mode,
|
||||
initial,
|
||||
onSuccess,
|
||||
navigateOnCreate = true,
|
||||
}: MedicationWizardDialogProps) {
|
||||
const { t, locale } = useTranslations();
|
||||
const router = useRouter();
|
||||
@@ -331,7 +338,7 @@ function WizardDialogShell({
|
||||
toast.success(t("common.saved"));
|
||||
onSuccess?.(json.data.id);
|
||||
onOpenChange(false);
|
||||
if (mode === "create") {
|
||||
if (mode === "create" && navigateOnCreate) {
|
||||
router.push(`/medications/${json.data.id}`);
|
||||
}
|
||||
return;
|
||||
@@ -342,7 +349,17 @@ function WizardDialogShell({
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
}, [initial, mode, onOpenChange, onSuccess, payload, queryClient, router, t]);
|
||||
}, [
|
||||
initial,
|
||||
mode,
|
||||
navigateOnCreate,
|
||||
onOpenChange,
|
||||
onSuccess,
|
||||
payload,
|
||||
queryClient,
|
||||
router,
|
||||
t,
|
||||
]);
|
||||
|
||||
const Icon = STEP_ICONS[step];
|
||||
|
||||
|
||||
@@ -325,6 +325,7 @@ function AddMedicationTask({
|
||||
open={open}
|
||||
onOpenChange={setOpen}
|
||||
mode="create"
|
||||
navigateOnCreate={false}
|
||||
onSuccess={(id) => {
|
||||
setOpen(false);
|
||||
void onComplete(id);
|
||||
|
||||
Reference in new issue
Block a user