Fieldforce Mobile Implementation

Overview

The Mobile Web app is meticulously designed for field teams operating on-site. It combines Astro for static shell rendering with Qwik islands for interactivity, delivering an extremely fast, touch-first mobile experience.

Architecture

  • Framework Structure: Astro pages (.astro) render the initial shell with minimal JS, while Qwik components (.tsx) hydrate lazily strictly upon interaction.
  • Pagination Strategy: Exclusively implements cursor-based infinite scroll (useInfiniteTasks) mapped to the Go backend, yielding a seamless vertical timeline.
  • Storage Abstraction: Defines a FieldforceStorageAdapter Interface to sandbox interactions with storage. This deliberate decision means components never interface directly with indexedDB, facilitating a future migration to Electric SQL.

Core Features

  1. My Tasks List: A prioritized list of assigned tasks utilizing touch-friendly cards, sorting (by due date/priority), and an immediate overdue visual badge.
  2. Interactive Islands:
    • TaskTimeline: Displays activities and audit logs merged into vertically stacked cards.
    • TaskStatusToggle: Offers rapid status transitions securely backed by confirmation dialogues.
  3. Log Activity Bottom Sheet:
    Provides a touch-friendly interface with four tabs: Note, Photo, Signature, Voice. In Phase 1, only “Note” is active, with the others styled as clear roadmap stubs for Phase 2.

Offline-First Preparation

Mobile connectivity is notoriously unstable for field teams. The app strictly enforces an architecture built for offline readiness. The Phase 2 IndexedDB rollout and Phase 4 Electric SQL upgrade will implement the pre-established FieldforceStorageAdapter, making offline synchronization completely transparent to the UI.