# Teacher Workflows — Figma Production Specs

---

## 1. INTERVENTION SYSTEM (TCH-19)

### Frame: `RP/Teacher/TCH-19-Interventions`

**Canvas sizes:** Desktop (1440), Tablet (768), Mobile (375) × Light + Dark

---

### Desktop Light (1440px)

```
Frame: TCH-19-Interventions-Desktop-Light
Width: 1440px
BG: color/background

├── RP/Sidebar (teacher, active: interventions)
├── RP/Topbar (teacher)
│
├── Content Area
│   Padding: 24px
│   Layout: Vertical, gap 24px
│
│   ├── PAGE HEADER
│   │   ├── H1: "Intervention Plans"
│   │   └── RP/Button (primary): "+ Create Intervention"
│   │
│   ├── KPI ROW
│   │   Layout: Horizontal, gap 16px (4 cards)
│   │
│   │   ├── KPI: "Active Plans" — 5 (color: secondary)
│   │   ├── KPI: "Completed" — 12 (color: success)
│   │   ├── KPI: "Overdue" — 2 (color: danger)
│   │   └── KPI: "Students Monitored" — 7 (color: warning)
│   │
│   ├── FILTER BAR
│   │   Search + Status filter + Student filter + Priority filter
│   │
│   ├── TABS
│   │   [Active (5)] [Completed (12)] [Overdue (2)] [All (19)]
│   │
│   ├── INTERVENTION CARDS
│   │   Layout: Vertical, gap 12px
│   │
│   │   Each intervention:
│   │   RP/Card (padding/md, shadow/sm)
│   │   Layout: Vertical, gap 12px
│   │
│   │   ├── Header Row (Horizontal, justify: space-between)
│   │   │   ├── Title: "Improve Math Performance" (Body/Base, Medium)
│   │   │   └── Status badge: "Active" (RP/Badge, success)
│   │   │
│   │   ├── Student Info
│   │   │   Layout: Horizontal, gap 8px, alignment: center
│   │   │   ├── RP/Avatar (xs)
│   │   │   ├── Name: "Amara Asante" (Body/SM)
│   │   │   ├── Class: "JSS 2" (Body/XS, muted)
│   │   │   └── OPS: "42%" (Body/SM, Bold, danger)
│   │   │
│   │   ├── Description
│   │   │   "Student is struggling with algebra. Plan includes
│   │   │    weekly tutoring sessions and additional practice
│   │   │    assignments." (Body/SM, muted, 2-line clamp)
│   │   │
│   │   ├── Progress Bar
│   │   │   RP/ProgressBar (value: 60, max: 100)
│   │   │   "3 of 5 actions completed"
│   │   │
│   │   ├── Actions List (collapsible)
│   │   │   Each action:
│   │   │   ├── Status icon: ✓ (completed) / ○ (pending) / ⏳ (in progress)
│   │   │   ├── Action text: "Weekly tutoring session"
│   │   │   ├── Assigned to: "Dr. Mensah" (teacher) / "Kofi Asante" (parent)
│   │   │   └── Due date: "Jun 20, 2026"
│   │   │
│   │   ├── Footer Row (Horizontal, justify: space-between)
│   │   │   ├── Meta: "Created: Jun 1, 2026 • Priority: High"
│   │   │   └── Actions: [View Detail] [Log Progress] [Edit]
│   │   │
│   │   └── Click → Intervention Detail (modal or page)
│   │
│   └── Pagination: RP/Pagination
│
└── Bottom padding: 48px
```

---

### Create Intervention Modal

```
RP/Modal (lg)
├── Header: "Create Intervention Plan"
├── Content:
│   Layout: Vertical, gap 16px
│
│   ├── Student Selector
│   │   RP/Select: "Select Student *"
│   │   Searchable dropdown
│   │   Shows: Name + Class + OPS score
│   │
│   ├── Title
│   │   RP/Input (text): "Intervention Title *"
│   │   "Improve Math Performance"
│   │
│   ├── Description
│   │   RP/Input (textarea, rows: 3): "Description"
│   │   "Describe the intervention plan..."
│   │
│   ├── Priority
│   │   RP/Select: "Priority"
│   │   Options: Normal / High / Urgent
│   │
│   ├── Target Metric
│   │   RP/Select: "Target Metric"
│   │   Options: OPS Score / Attendance / Assignment Completion / Exam Score
│   │
│   ├── Target Value
│   │   RP/Input (number): "Target Value"
│   │   "70" (e.g., OPS score target)
│   │
│   ├── Target Date
│   │   RP/Input (date): "Target Date"
│   │
│   ├── Actions (repeatable)
│   │   Each action:
│   │   ├── RP/Input (text): "Action description"
│   │   ├── RP/Select: "Assigned to"
│   │   │   Options: Teacher (self) / Parent (select from linked parents)
│   │   ├── RP/Input (date): "Due date"
│   │   └── [Remove Action]
│   │
│   └── [+ Add Action]
│
├── Footer:
│   [Cancel] (ghost)  [Create Intervention] (primary)
```

---

### Intervention Detail View

```
RP/Modal (xl) or Page
├── Header: "Intervention Plan: Improve Math Performance"
├── Status: Active | Priority: High
│
├── Student Info
│   RP/Avatar + Name + Class + OPS + Attendance
│
├── Plan Details
│   Description, target metric, target value, target date
│
├── Actions Timeline
│   RP/Timeline
│   Each action:
│   ├── Status icon
│   ├── Action description
│   ├── Assigned to
│   ├── Due date
│   ├── Completed date (if done)
│   └── Notes
│
├── Progress
│   RP/ProgressBar (3/5 completed)
│   "60% complete"
│
├── Progress Log
│   RP/Timeline
│   Each log entry:
│   ├── Date + time
│   ├── Who logged
│   ├── What was done
│   └── Notes
│
└── Actions
    ├── [Log Progress] → modal
    ├── [Edit Plan]
    ├── [Mark Complete]
    └── [Cancel Plan]
```

---

### Log Progress Modal

```
RP/Modal (md)
├── Header: "Log Progress"
├── Content:
│   ├── Action: [Select action from list]
│   ├── Status: [Pending → In Progress → Completed]
│   ├── Notes: [textarea]
│   └── Date: [date picker, default: today]
├── Footer:
│   [Cancel]  [Save Progress]
```

---

## 2. PARENT ACTION ITEMS (TCH-20)

### Desktop Light

```
Frame: TCH-20-ActionItems-Desktop-Light
Width: 1440px
BG: color/background

├── RP/Sidebar (teacher, active: action-items)
├── RP/Topbar (teacher)
│
├── Content Area
│   Padding: 24px
│   Layout: Vertical, gap 24px
│
│   ├── PAGE HEADER
│   │   ├── H1: "Parent Action Items"
│   │   └── RP/Button (primary): "+ Create Action Item"
│   │
│   ├── KPI ROW
│   │   "Total: 15" | "Pending: 6" | "Completed: 7" | "Overdue: 2"
│   │
│   ├── FILTER BAR
│   │   Status filter: [All] [Pending] [In Progress] [Completed] [Overdue]
│   │
│   ├── ACTION ITEMS LIST
│   │   Layout: Vertical, gap 12px
│   │
│   │   Each item:
│   │   RP/Card (padding/md)
│   │   Layout: Vertical, gap 8px
│   │
│   │   ├── Header Row
│   │   │   ├── Title: "Review homework with Amara" (Body/Base, Medium)
│   │   │   └── Status badge + Priority badge
│   │   │
│   │   ├── Assignment Info
│   │   │   ├── Assigned to: "Kofi Asante (Primary Guardian)" (Body/SM)
│   │   │   ├── Student: "Amara Asante - JSS 2" (Body/SM)
│   │   │   └── Created by: "Dr. Mensah" (Body/XS, muted)
│   │   │
│   │   ├── Description
│   │   │   "Please review Amara's math homework chapters 5-7
│   │   │    and sign the practice log." (Body/SM, muted, 2-line clamp)
│   │
│   │   ├── Due Date
│   │   │   "Due: Jun 20, 2026"
│   │   │   Badge colors:
│   │   │   ├── Upcoming (>3 days): RP/Badge (info, sm)
│   │   │   ├── Due soon (1-3 days): RP/Badge (warning, sm)
│   │   │   └── Overdue: RP/Badge (danger, sm) with "2 days overdue"
│   │   │
│   │   ├── Action Log (collapsible)
│   │   │   "Parent acknowledged: Jun 15, 3:20 PM"
│   │   │   "Teacher reminder sent: Jun 18, 9:00 AM"
│   │   │
│   │   └── Footer
│   │       Actions: [View Log] [Edit] [Remind] [Mark Complete]
│   │
│   └── Pagination
│
└── Bottom padding: 48px
```

---

### Create Action Item Modal

```
RP/Modal (lg)
├── Header: "Create Parent Action Item"
├── Content:
│   Layout: Vertical, gap 16px
│
│   ├── Title
│   │   RP/Input (text): "Action Item Title *"
│   │   "Review homework with Amara"
│   │
│   ├── Description
│   │   RP/Input (textarea, rows: 3): "Description"
│   │   "Describe what the parent needs to do..."
│   │
│   ├── Related Student
│   │   RP/Select: "Student *"
│   │   Shows students linked to parents
│   │
│   ├── Assign to Parent
│   │   RP/Select: "Parent/Guardian *"
│   │   Shows linked parents for selected student
│   │   Prefills to primary guardian
│   │
│   ├── Due Date
│   │   RP/Input (date): "Due Date *"
│   │
│   ├── Priority
│   │   RP/Select: "Priority"
│   │   Options: Normal / High / Urgent
│   │
│   └── Notify Parent
│       RP/Toggle: "Send notification to parent"
│       Default: ON
│
├── Footer:
│   [Cancel] (ghost)  [Create Action Item] (primary)
```

---

### Action Item Detail View

```
RP/Card (shadow/md, padding/lg)
├── Header: "Review homework with Amara"
├── Status: In Progress | Priority: High
│
├── Details
│   ├── Assigned to: Kofi Asante (Primary)
│   ├── Student: Amara Asante — JSS 2
│   ├── Created by: Dr. Mensah
│   ├── Created: Jun 12, 2026
│   ├── Due: Jun 20, 2026
│   └── Description: "Please review..."
│
├── Activity Log (RP/Timeline)
│   ├── Jun 12, 9:00 AM — Dr. Mensah created action item
│   ├── Jun 12, 9:01 AM — Notification sent to Kofi Asante
│   ├── Jun 15, 3:20 PM — Kofi Asante acknowledged
│   └── Jun 18, 9:00 AM — Reminder sent
│
└── Actions
    ├── [Log Progress]
    ├── [Send Reminder] (ghost)
    ├── [Edit] (outline)
    └── [Mark Complete] (primary)
        → Confirmation: "Mark this action item as complete?"
```

---

## 3. ESCALATION WORKFLOW

### Risk Escalation Levels

| Level | Trigger | Badge | Parent Action | Admin Notification |
|-------|---------|-------|---------------|-------------------|
| Low | OPS 60-70% OR attendance 75-80% | RP/Badge (info, sm): "Low" | Informational note | No |
| Medium | OPS 50-59% OR attendance 60-74% | RP/Badge (warning, sm): "Medium" | Action item assigned | Weekly digest |
| High | OPS <50% OR attendance <60% | RP/Badge (danger, sm): "High" | Urgent action item + email | Immediate notification |
| Critical | OPS declining 3+ consecutive periods | RP/Badge (danger): "Critical" | Urgent action + phone call | Immediate + meeting |

### Escalation Visual in TCH-08 (Student Detail)

```
┌──────────────────────────────────────────────────────────────┐
│  ⚠ Risk Assessment                                           │
│                                                              │
│  Current Risk Level: [High ▾]                                │
│                                                              │
│  Risk Factors:                                               │
│  ├── OPS Trend: Declining (82% → 65% → 52%)     ⚠ Danger  │
│  ├── Attendance: 58% this term                    ⚠ Danger  │
│  ├── Exam Scores: Below average                   ⚠ Warning │
│  └── Assignment Completion: 75%                   ● Good    │
│                                                              │
│  Last Intervention: "Math Tutoring" (Active, 60% complete)  │
│                                                              │
│  [Create New Intervention]  [Escalate to Admin]              │
└──────────────────────────────────────────────────────────────┘
```

### Escalation Modal

```
RP/Modal (md)
├── Header: "Escalate to Admin"
├── Content:
│   "Escalating this student's case to the school administrator."
│   ""
│   Student: Amara Asante
│   Current Risk: High
│   Active Interventions: 1 (Math Tutoring)
│   ""
│   RP/Input (textarea): "Reason for escalation"
│   ""
│   RP/Banner (warning): "Admin will be notified immediately."
├── Footer:
│   [Cancel]  [Escalate]
```

---

## 4. STUDENT RISK MONITORING

### Risk Dashboard (Teacher View — TCH-01 Sidebar)

```
AT-RISK STUDENTS (TCH-01 widget)
├── Kofi Mensah — OPS: 42% — [High] — ↑ worsening
├── Esi Boateng — OPS: 55% — [Medium] — → stable
├── Yaa Asantewaa — OPS: 48% — [High] — ↑ worsening
├── Kwame Darko — Attendance: 52% — [High] — → stable
├── Ama Sarpong — OPS: 62% — [Low] — ↓ improving
└── [View All Students →]
```

### Risk Trend Chart (CH-06)

```
┌──────────────────────────────────────────────────────────────┐
│  Risk Student Distribution                                    │
│                                                              │
│  ApexCharts: Donut chart                                     │
│  Series: [2 Low, 3 Medium, 1 High, 1 Critical]              │
│  Colors: [#22C55E, #F59E0B, #DC2626, #7F1D1D]              │
│                                                              │
│  Legend: Low (2) | Medium (3) | High (1) | Critical (1)     │
│                                                              │
│  Click segment → Filtered student list                       │
└──────────────────────────────────────────────────────────────┘
```

---

## 5. INTERVENTION EFFECTIVENESS TRACKING

### Effectiveness Chart (CH-07)

```
┌──────────────────────────────────────────────────────────────┐
│  Intervention Effectiveness                                  │
│                                                              │
│  ApexCharts: Grouped bar chart                               │
│  X-axis: Intervention name                                   │
│  Series 1: OPS Before (red)                                  │
│  Series 2: OPS After (green)                                 │
│                                                              │
│  "Math Tutoring"    [████ 42%] [████████ 68%]  +26%        │
│  "Attendance Plan"  [████ 55%] [██████████ 78%] +23%       │
│  "Reading Support"  [████ 61%] [██████████ 75%] +14%       │
│                                                              │
└──────────────────────────────────────────────────────────────┘
```

---

## 6. WORKFLOW: FROM RISK DETECTION TO RESOLUTION

```
Risk Detection:
    OPSCalculatorService identifies low OPS
        ↓
Risk Level Assignment:
    System calculates risk level (Low/Medium/High/Critical)
        ↓
Teacher Notification:
    "7 students are at risk" appears on TCH-01 dashboard
        ↓
Teacher Review (TCH-07 → TCH-08):
    Teacher reviews student detail
    Sees risk factors, OPS breakdown, attendance
        ↓
Intervention Creation (TCH-08 → TCH-19):
    Teacher creates intervention plan
    Assigns actions to self and/or parent
        ↓
Parent Notification:
    Action item appears in parent's PAR-06
    Parent receives email/SMS notification
        ↓
Progress Tracking (TCH-19):
    Teacher logs progress
    Actions marked complete by teacher or parent
        ↓
Effectiveness Monitoring:
    OPS recalculated automatically
    If OPS improves → Risk level decreases
    If no improvement → Escalation to Admin
        ↓
Escalation (if needed):
    Teacher escalates to Admin
    Admin reviews case
    Additional resources assigned
        ↓
Resolution:
    OPS reaches target
    Risk level drops to Low
    Intervention marked Complete
```

---

## 7. NOTIFICATION WORKFLOWS

### Teacher Notification Triggers

| Trigger | Channel | Recipients |
|---------|---------|------------|
| Student submits assignment | In-App | Teacher |
| Exam attempt completed | In-App | Teacher |
| New student enrolled in class | In-App + Email | Teacher |
| Parent message received | In-App | Teacher |
| Payroll processed | In-App + Email | Teacher |
| Session reminder (15 min before) | In-App | Teacher |
| At-risk student alert | In-App | Teacher |
| Action item overdue | In-App | Teacher |
| Intervention progress logged | In-App | Teacher |

### Notification Display (Teacher Topbar)

```
RP/NotificationBell
├── Badge count: 5 (unread)
├── Click → Dropdown (320px)
│   ├── Header: "Notifications" [Mark All Read]
│   ├── List:
│   │   ├── Unread (blue dot):
│   │   │   "Amara Asante submitted Math Quiz Ch.5"
│   │   │   2 minutes ago
│   │   ├── Unread:
│   │   │   "Kofi Mensah's action item is overdue"
│   │   │   1 hour ago
│   │   └── Read (no dot):
│   │       "New student enrolled in JSS 2"
│   │       Yesterday
│   └── Footer: [View All Notifications →]
│
└── Click notification → Navigate to relevant screen