Skip to content

feat(mobile): implement single-tap rapid emergency trigger cards on employee dashboard (#116) - #133

Merged
Decuayer merged 1 commit into
mainfrom
feat/SDDC-80-rapid-emergency-trigger-cards
Aug 30, 2026
Merged

feat(mobile): implement single-tap rapid emergency trigger cards on employee dashboard (#116)#133
Decuayer merged 1 commit into
mainfrom
feat/SDDC-80-rapid-emergency-trigger-cards

Conversation

@Decuayer

@Decuayer Decuayer commented Aug 30, 2026

Copy link
Copy Markdown
Owner

🎯 Jira / Task Reference


📝 Summary of Changes

Simplifies EmployeeHomeView for refinery field workers by implementing high-visibility, single-tap rapid emergency action cards in accordance with FR-03 and NFR-03 operational safety requirements:

  • One-Tap Emergency Trigger Grid: Added high-contrast 2x2 grid (Fire / Explosion, Gas Leak / Vapor, Medical Emergency, SOS / Panic Alert) with heavy tactile feedback (HapticFeedback.heavyImpact()).
  • Silent GPS Acquisition & Dispatch: Implemented RapidDispatchService to acquire device coordinates within a 2-second timeout (fallback to cached location) and dispatch CreateIncidentRequestModel directly to POST /api/v1/incidents.
  • 5-Second Reversal Window: Added EmergencyDispatchToast banner displaying assigned Incident ID snippet, live 5-second countdown timer, and one-tap cancellation dispatching PATCH /api/v1/incidents/{id}/status with Canceled.
  • State Management: Integrated RapidIncidentCubit and RapidIncidentState managing loading spinners, countdown, and error handling.
  • Testing: Added complete suite of unit and widget tests (rapid_dispatch_service_test.dart, rapid_incident_cubit_test.dart, rapid_emergency_grid_test.dart).

🏷️ Type of Change

  • 🚀 Feature: New functionality or operational workflow
  • 🐛 Bug Fix: Non-breaking fix for an identified defect
  • ♻️ Refactor: Code restructuring without behavior alteration
  • Performance: Speed, query, or memory consumption optimization
  • 🛠️ Chore / Infra: Dependencies, Docker, CI/CD, or tooling updates
  • 📖 Documentation: README, API specs, or code documentation updates
  • ⚠️ Breaking Change: Requires schema migration or API contract changes

🧪 Testing & Verification

Automated Tests

  • Mobile tests executed: flutter test (20 passed)
  • Linter & formatting passed: flutter analyze (No issues found)

Manual Test Steps

  1. Log in as an Employee user (RoleType.employee) and open EmployeeHomeView.
  2. Verify the 2x2 emergency cards are displayed with high contrast and clear icons.
  3. Tap on the Fire / Explosion card; verify heavy haptic feedback, active spinner on the selected card, and dimmed opacity on remaining cards.
  4. Verify EmergencyDispatchToast appears with the incident ID snippet and a 5-second countdown timer.
  5. Tap "Cancel" within 5 seconds; verify the cancellation request succeeds and UI resets to initial state.
  6. Verify "Report Detailed Incident" wizard remains accessible at the bottom of the screen.

📋 Pre-Merge Checklist

  • My code adheres to the project's Clean Architecture & style guidelines.
  • I have self-reviewed my own code before requesting review.
  • Database migrations are backwards-compatible (not applicable).
  • Sensitive secrets / tokens are NOT committed (verified .env exclusions).
  • Jira status updated to In Review.

…ards

- Add RapidEmergencyPreset model and RapidDispatchService for instant GPS telemetry
- Add RapidIncidentCubit with 5-second reversal countdown timer
- Add RapidEmergencyButton and 2x2 RapidEmergencyGrid to EmployeeHomeView
- Add emergency dispatch banner with incident cancellation support via status patch
- Add unit and widget tests for rapid dispatch pipeline

Closes #116
Relates to SDDC-80
@Decuayer
Decuayer merged commit 01e2d51 into main Aug 30, 2026
1 check 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.

[SDDC-80] Implement Single-Tap Rapid Emergency Incident Trigger Cards on Employee Home View

1 participant