Files
GSB-Construction/docs/PLAN-site-execution-dash.md

2.8 KiB

PLAN: Site Execution & Daily Field Dashboard

Phase -1 & Phase 0: Context Check & Socratic Gate

Before we write any code, we need to clarify the following architectural decisions to ensure the plan fits the gsb-cons ecosystem:

  1. Tech Stack & Frameworks: Will this be built using Livewire + AlpineJS (following the pattern of existing modules like Financial Reports and Complaints) or another stack?
  2. Database Models: Do the underlying models for Tasks, Weather, Labor, and Equipment already exist, or do they need to be designed and migrated from scratch?
  3. Weather Integration: Are we pulling live data via API (e.g., OpenWeatherMap) or will weather conditions be a manual daily entry by the Site Manager?
  4. Mobile Responsiveness: Is the primary target device for this dashboard a phone/tablet in the field? If yes, the UI must be designed Mobile-First.

Project Breakdown

Phase 1: Database & Backend Architecture

  • Data Modeling: Define schemas for DailyLogs, LaborRollCall, EquipmentStatus, and SiteBlockers.
  • Migrations & Seeders: Generate database tables and basic dummy data for testing.
  • Weather Service: Implement Weather API service class (or local entry model).

Phase 2: Core State & Components

  • Main Dashboard Component: Create the main Livewire container (SiteExecutionDashboard).
  • Sub-components:
    • WeatherWidget
    • TodayActivityFeed
    • BlockerList
    • ResourceRollCall
  • Query Logic: Implement queries to strictly fetch "Today's" specific context scoped to the current_branch_id or site user.

Phase 3: Frontend & UI Design

  • Layout Design: Implement the dashboard grid (optimized for touch targets and high-glare environments).
  • Weather & Conditions UI: Design clear icons and alert states (e.g., Red flags for rain delays).
  • Resource Visuals: Clean visual presentation for labor counts and equipment status.
  • Interactive Blockers: Checkbox lists and immediate action buttons for RFIs directly from the dashboard.

Phase 4: Quality Assurance & Testing

  • Run mobile_audit.py to ensure field device compatibility.
  • Run ux_audit.py to check for accessibility and correct contrast.
  • Verify query performance (ensure no N+1 issues when loading multi-resource feeds).

Agent Assignments

  • project-planner: Structure and gatekeeping (Current)
  • backend-specialist: Data models, external integrations, service logic.
  • frontend-specialist: Tailwind layout, component state, usability, and mobile-first design.

Verification Checklist

  • Dashboard loads quickly (< 500ms).
  • Weather API degradation falls back gracefully without crashing the app.
  • Fully functional on Mobile viewports (minimum 375px width).
  • All "Blockers" can be interacted with / updated directly from the dashboard view.