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-05Spec 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)
| Dependency | Use | Type |
|---|---|---|
| PF-37 Phase 1 | Core 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.gestures | Data |
| Settings Hub | Add “Gestures” card and route /settings/gestures, /settings/gestures/analytics | Platform 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/settingsStatus: ✅ Complete — 2026-03-05
Public API (Phase 2 — from spec)
| API | Type | Description |
|---|---|---|
useGesturePreferences() | Hook | Read/write gesture preferences from pf_profiles.preferences.gestures |
useHapticFeedback() | Hook | Trigger haptic patterns (success, error, warning) per user settings |
useGestureAnalytics(options?) | Hook | Aggregate gesture usage and success rate for current user |
trackGestureEvent(userId, orgId, type, success, metadata?) | Utility | Record analytics event (callers pass context; batched client-side) |
Public API (Phase 3 — from spec)
| API | Type | Description |
|---|---|---|
usePinchToZoom(options) | Hook | Pinch-to-zoom and pan bindings; zoom limits, double-tap zoom |
useMultiTouch(options) | Hook | Two-finger swipe/rotate; configurable per component |
useCustomGesture(options) | Hook | Register custom gesture pattern and action |
ZoomableImage / ZoomableImageViewer | Component | Image 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/gestureshooks. - Document/image viewers: PF-11, CL, PM, or any core with image/PDF preview consumes
ZoomableImage/ZoomableImageViewerfor Phase 3.
Event Contracts
PF-37 Phase 2/3 does not publish domain events. Analytics are written topf_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 onpf_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
- PF-37 Mobile Swipe Gestures — Parent spec
- PF-06 User Profile Management — Preferences storage
- PF-09 Form Analytics — Batching pattern
- PLATFORM_INTEGRATION_LAYERS.md — PF-37 Gestures Integration Layer