Skip to content

fix: nurse-doctor & dialog QA regressions from the zard/tailwind migration - #432

Merged
drtechie merged 2 commits into
angular-zard-migrationfrom
fix/nurse-doctor-migration-qa
Aug 3, 2026
Merged

fix: nurse-doctor & dialog QA regressions from the zard/tailwind migration#432
drtechie merged 2 commits into
angular-zard-migrationfrom
fix/nurse-doctor-migration-qa

Conversation

@gkbishnoi07

Copy link
Copy Markdown

Summary

A batch of QA fixes for regressions found while running the migrated nurse & doctor
flows
(Angular 20 standalone + Zard UI / Tailwind) against the UAT backend. Most are
migration side-effects — behaviour that Angular Material masked and Zard/Tailwind now
surfaces — plus a couple of genuine flow bugs and one layout tweak.

All changes are template/TS only; no dependency or config changes. Local-only files
(proxy.conf.js) and the Common-UI submodule are intentionally not included (see
Out of scope).

What & why

Step navigation loses state (systemic)

  • workarea — visited steps were *ngIf-gated, so leaving a step destroyed its
    component and wiped form state, option lists and dropdowns. Steps are now kept mounted
    and hidden (isStepRendered + [hidden]), so Back/Next preserves everything.
  • history sub-forms (past-history, family-history, family-history-ncdscreening,
    comorbidity-concurrent-conditions, medication-history, other-vaccines) — guard
    FormArray initialisation so revisiting a step no longer duplicates rows or leaves
    dropdowns dead.
  • visit-details — seed section visibility from the already-selected visit category
    on re-entry, so Chief Complaints / Investigations etc. don't disappear when navigating
    back.

Change-detection crash → frozen "Next" (Cancer Screening)

  • cancer-history — switching the visit category to Cancer Screening could create the
    component against a stale, non-cancer parent form, so .get(...) returned null and the
    child forms stayed null forever, throwing NG01052 / Cannot read properties of null
    and freezing change detection (Next stopped responding). Child form groups are now
    re-derived on every parent-form change (guarded so a transient stale form can't null a
    good reference), and the child components are *ngIf-guarded so they never mount against
    a null form.

Disabled/blocked controls

  • diseaseconfirmationisDoctor defaulted to true and was only ever re-set to
    true, so the nurse's Disease Confirmation checkboxes were disabled. Material's
    mat-checkbox hid this by re-enabling from the form control; z-checkbox honours
    [disabled] strictly. isDoctor is now derived from the route (attendant === 'doctor')
    — nurse can tick the boxes, doctor stays read-only.
  • chief-complaints — Duration/Description were enabled only on the input's (blur),
    which doesn't fire reliably when a complaint is picked via mousedown. They're now enabled
    the moment a complaint is selected.

Data/flow correctness

  • nurse.service — the chief-complaint serializer blanked the complaint string, so the
    doctor couldn't see what the nurse recorded. It now unwraps only the object form and
    preserves the string.
  • workarea-validation — removed the mandatory-prescription gate that blocked submit.

Dialog & layout polish

  • confirmation.service — info alert() dialogs are no longer mask-closable. They're
    frequently raised from (blur)/(change) handlers, and the same pointer interaction that
    opened them was landing on the backdrop and dismissing them within ~0.5s (Zard's
    outsidePointerEvents fires for the opening event). They now stay open until OK/Escape.
  • beneficiary-details — the details card stacks all fields in a single vertical column
    (dropped sm:grid-cols-2).

Testing

Ran the migrated build locally against the UAT backend and walked the nurse and doctor
flows: NCD screening / NCD care / Cancer Screening visit categories, step Back/Next,
chief complaint entry → doctor view, disease confirmation, BP validation alert, and the
beneficiary details dialog. Verified the reported symptoms are resolved and the console
cascade is gone.

Out of scope / follow-ups

  • The registrar "session expired" fix lives in Common-UI (location-information) and
    will go through the submodule's own PR + pointer bump.
  • The intermittent "History/Vitals steps missing" seen on one specific patient looked like
    corrupted visit data rather than a code defect (fresh patients build all steps correctly);
    will re-open with a console trace if it recurs on clean data.

…nd migration

Fixes a batch of QA regressions found while running the migrated nurse and doctor
flows against UAT:

- workarea: keep visited steps mounted (hidden) instead of destroying them, so
  form state, option lists and dropdowns survive back/next navigation
- cancer-history: re-derive child form groups on every parent-form change and
  guard the child components, fixing the null FormGroup crash and frozen Next
  button when the visit category is switched to Cancer Screening
- diseaseconfirmation: derive isDoctor from the route so the nurse's checkboxes
  are enabled; z-checkbox honours [disabled] where mat-checkbox effectively did not
- chief-complaints: enable Duration/Description as soon as a complaint is picked
  from the dropdown, not only on blur, so the dependent fields are usable
- nurse.service: stop blanking the chief-complaint string on serialization so the
  doctor sees the complaint the nurse recorded
- confirmation.service: make info alerts non-mask-closable so the blur/change that
  opens them cannot immediately dismiss them
- history sub-forms: guard array initialisation so revisiting a step does not add
  duplicate rows or leave dropdowns dead (past, family, family-ncd, comorbidity,
  medication, other-vaccines)
- visit-details: seed section visibility from the already-selected visit category
  on re-entry so sections do not vanish
- workarea-validation: drop the mandatory-prescription gate that blocked submit
- beneficiary-details: stack all fields in a single vertical column
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8af2610c-3456-4177-bc95-6fcb772558f0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…andler

SonarCloud flagged each clickable <z-step> (Web:MouseEventWithoutKeyboardEquivalentCheck,
11 reliability bugs) because it had (click) but no keyboard handler. Add tabindex="0" so
the step (a role="listitem") is focusable and a (keydown.enter) that mirrors the click, so
the stepper is operable by keyboard as well as mouse.
@sonarqubecloud

sonarqubecloud Bot commented Aug 1, 2026

Copy link
Copy Markdown

@drtechie
drtechie merged commit 2a4bbf0 into angular-zard-migration Aug 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants