Receive and Act on Scenario-based Prompt Notifications
The scenario trigger engine evaluates predefined rules against each peer mentor's data (activity frequency, contact engagement patterns, time since last session, contact profile attributes). When a scenario rule fires, it creates a scenario-prompt notification that appears in the Notification Centre as a scenario-prompt-notification-card. Each card displays the scenario title, a short explanatory message, and an optional action button that deep-links to the most relevant screen (e.g. 'Schedule a session', 'Review contact notes'). Scenario detail can be expanded in a scenario-prompt-detail-sheet. Peer mentors can snooze or dismiss individual scenario notifications. Notification preferences allow disabling specific scenario categories.
User Story
Acceptance Criteria
- Given a scenario rule condition is met for a peer mentor, when the scenario evaluation edge function runs, then a scenario-prompt notification record is created in the database.
- Given a scenario notification exists, when the Notification Centre loads, then it renders as a scenario-prompt-notification-card with the scenario title and action text.
- Given the peer mentor taps the expansion area of the scenario card, when the sheet opens, then the scenario-prompt-detail-sheet displays the full scenario context and recommended action.
- Given the peer mentor taps the action button on a scenario card, when deep link navigation resolves, then the relevant screen opens with contextual pre-filling.
- Given the peer mentor dismisses a scenario notification, when the dismiss gesture is completed, then the notification is removed from the unread list and does not reappear unless the rule re-evaluates as true after a reset period.
- Given notification preferences are configured to disable a scenario category, when the scenario evaluation fires for that category, then no notification is created for that peer mentor.
Business Value
HLF's workshop raised concerns that 40% of peer mentors provided insufficient follow-up. Scenario-based prompts operationalise best-practice guidance within the app itself rather than relying on annual training. By delivering contextual nudges at the right moment, the system raises average peer support quality across the entire volunteer base without increasing coordinator overhead, directly improving outcomes for the contacts being supported.
Components
- Scenario Prompt Notification Card ui
- Scenario Prompt Detail Bottom Sheet ui
- Scenario Rule Engine service
- Scenario Deep Link Handler service
- Scenario Rule Repository data
- Prompt History Repository data
- Scenario Evaluation Edge Function infrastructure
- Scenario Notification Detail View ui
- Scenario Trigger Engine service
- Scenario Notification Content Builder service
- Scenario Deep-Link Router service
- Scenario Notification Repository data
- Notification BLoC service
- Notification Centre Screen ui