Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt

Use this file to discover all available pages before exploring further.

Phase 2 & 3: Gesture Preferences, Analytics, Advanced Gestures — Integration

Status: ✅ Complete — 2026-03-05
Spec Reference: PF-37 Phase 2 & 3 Expansion
Parent: PF-37 Mobile Swipe Gestures
Last Updated: 2026-03-04

Purpose

PF-37 Phase 2 adds user gesture preferences (sensitivity, haptic, per-gesture toggles) and gesture usage analytics. Phase 3 adds pinch-to-zoom, multi-touch, and custom gesture recognition. This document captures integration points: dependencies consumed by PF-37 Phase 2/3 and the platform layer consumed by other cores.

PF Dependencies (Consumed by PF-37 Phase 2/3)

DependencyUseType
PF-37 Phase 1Core gesture system (swipe-to-dismiss, swipe-actions, pull-to-refresh, edge-swipe)Same spec / platform
PF-06 (User Profile Management)pf_profiles.preferences JSONB for preferences.gesturesData
Settings HubAdd “Gestures” card and route /settings/gestures, /settings/gestures/analyticsPlatform UI
PF-11 (Document Management)Document/PDF viewer integration for ZoomableImage / pinch-to-zoom (Phase 3)Platform integration
PF-09 (Form Analytics)Batching pattern reference for gesture analytics (queue + flush)Pattern

Platform Integration Layer

Location: /src/platform/gestures/ (existing); settings pages in /src/platform/settings/
Import path: @/platform/gestures, @/platform/settings
Status: ✅ Complete — 2026-03-05

Public API (Phase 2 — from spec)

APITypeDescription
useGesturePreferences()HookRead/write gesture preferences from pf_profiles.preferences.gestures
useHapticFeedback()HookTrigger haptic patterns (success, error, warning) per user settings
useGestureAnalytics(options?)HookAggregate gesture usage and success rate for current user
trackGestureEvent(userId, orgId, type, success, metadata?)UtilityRecord analytics event (callers pass context; batched client-side)

Public API (Phase 3 — from spec)

APITypeDescription
usePinchToZoom(options)HookPinch-to-zoom and pan bindings; zoom limits, double-tap zoom
useMultiTouch(options)HookTwo-finger swipe/rotate; configurable per component
useCustomGesture(options)HookRegister custom gesture pattern and action
ZoomableImage / ZoomableImageViewerComponentImage with pinch-to-zoom and pan

Consumer Cores

  • All cores that use gesture-enabled components (e.g. swipe-to-dismiss lists, pull-to-refresh) automatically benefit from Phase 2 preferences and analytics when they use @/platform/gestures hooks.
  • Document/image viewers: PF-11, CL, PM, or any core with image/PDF preview consumes ZoomableImage / ZoomableImageViewer for Phase 3.

Event Contracts

PF-37 Phase 2/3 does not publish domain events. Analytics are written to pf_gesture_analytics_events; retention job (scheduled) deletes events older than 90 days.

API Contracts

No REST or edge API for gesture preferences or analytics. All access is via React hooks and utilities above. RLS on pf_gesture_analytics_events and pf_profiles enforces tenant and user isolation.

Integration Matrix

  • CROSS_CORE_INTEGRATIONS.md: PF-37 Phase 2/3 → PF-06, Settings Hub, PF-11 (Phase 3); Platform Layer (gestures) consumed by all cores. See matrix row added for this doc.

See Also