Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

10 — Interaction Specification (CRM Module)

Precise interaction rules per screen. Motion timings from 00-shared/08_Interaction_&_Motion.md (m-fast ≤120 ms, m-base ≤250 ms, m-slow ≤400 ms). All gestures keyboard-accessible.


1. Navigation & routes

RouteScreenGuard
/crmshell + leads tab (S1)authGuard + permissionGuard('crm.read')
/crm/leadsS1crm.read
/crm/leads/newS3 createcrm.lead.manage
/crm/leads/:idS2crm.read
/crm/leads/:id/editS3 edit (sheet)crm.lead.manage
/crm/admissionsS5crm.read
/crm/admissions/newS7crm.lead.manage
/crm/admissions/:idS6crm.read
/crm/campaignsS10crm.read
/crm/campaigns/newS11crm.campaign.manage
  • Guards evaluate client-side for UI; server enforcement (planned) (permissions exist at permissions.constants.ts:34-36).
  • Deep links: push notification → /crm/leads/:id (forward-looking).

2. List interactions (S1/S5/S10)

  • Status filter: chip tap → immediate server request (loading bar atop stale list, never blank page); "All" resets.
  • Client-side filters (S1 source / my-leads): filter current loaded page instantly; label "filtered on device" hint when server filter unavailable (04 §6).
  • Pull-to-refresh: resets page 1, bypasses cache; S5 also refetches stats.
  • Infinite scroll: loadMore when hasNext (mixin 00-shared/06 §3.2); row tap → detail push (phone) / detail pane (tablet).
  • Row press feedback: m-fast ripple; no long-press actions (no delete/duplicate today).

3. Lead detail interactions (S2)

  • Status change: dropdown chip → immediate PATCH, optimistic with rollback
    • snackbar on failure (00-shared/06 §3.5); converted option never selectable in the dropdown (Convert flow only).
  • Close lead: sets status closed → reveal closedReason inline field; save without reason auto-stamps closedAt server-side (crm.service.ts:94-96).
  • Add follow-up: bottom sheet (S3-style), pessimistic submit; success → new timeline entry slides in + snackbar; timeline order: scheduledAt asc.
  • Assignment: staff picker sheet; optimistic PATCH (update-lead.dto.ts:72-75), rollback on error.
  • Convert: S4 dialog. Pre-check rules client-side; disabled button carries tooltip with the unmet rule. Confirm → in-dialog progress (never optimistic); success → dialog swaps to success check m-base, S2 refreshes.
  • Edit: sheet with fields of 08 §2; save = PATCH; on 409 → inline banner (email conflict is the only 409 path).

4. Admission detail interactions (S6)

  • Documents: Add document sheet (08 §6); after success, status badge may flip submitted → documents_pending (admission.service.ts:112-114) — refresh detail; snackbar notes the transition.
  • Interview: Schedule sheet (08 §7); re-schedule allowed while open (overwrites, admission.service.ts:124-129); after save, status → interview_scheduled when not already (admission.service.ts:130-132).
  • Decision: S9 dialog; selection required; confirm disabled until choice; waitlist/reject warnings per choice; success → status + workflow timeline update.
  • Convert (approved only): S4-style dialog; success → converted + conversion card (admission.service.ts:212-217).
  • Locked admission: action bar replaced by read-only banner; PATCH attempts blocked (client + server 400 admission.service.ts:257-269).

5. Keyboard support

  • S1: status chips → left/right arrows + Enter; rows → up/down + Enter.
  • Forms: Tab order = field declaration order (08); Enter on last field submits; Esc closes sheets/dialogs; focus returns to invoker.
  • Dialogs (S4/S9): Esc = cancel; Enter = confirm (when enabled); focus lands on primary action after warnings read.

6. Motion

TransitionTimingNotes
Row tap → detailm-base push (phone) / fade pane (tablet)
Sheet/dialogm-base slide/fade
Status chip changem-fast color/icon swapno bounce
Timeline entry addslide-in m-base + 40 ms stagger
Error shakem-fast horizontal 2×6 pxforms only
Success check (S4)m-base scale-in check
Skeleton → contentfade m-baseno flash of empty

Reduced-motion: disable shake/stagger (.disableAnimations).

7. Realtime & freshness

  • No WS topics for CRM today (00-shared/07 §8) → no live updates; refetch on app foreground + pull-to-refresh. (forward-looking): subscribe crm.lead.updated / crm.admission.updated topics when gateway adds them.
  • Detail views: no client cache (always fetch, 00-shared/06 §3.3).

8. Optimistic vs pessimistic summary

MutationPolicyReason
PATCH lead fields/status/assignedTooptimistic + rollbackcheap, reversible (00-shared/06 §3.5)
Add follow-uppessimisticappend + server createdBy stamp
Create lead/admission/campaignpessimistic409/400 paths need server truth
Convert lead/admissionpessimisticside effects (User+Student)
Admission decisionpessimisticterminal side effects
Document/interviewpessimisticworkflow transitions

9. Accessibility interactions

  • Status/color changes always accompanied by icon + text (00-shared/09).
  • Convert/decision warnings read aloud before confirm; focus containment in dialogs; sheet scrims dismiss with confirmation only when form is dirty.