From f28bfd9340482fcb03d854f5d348fc3a932deb8e Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Thu, 4 Dec 2025 18:00:52 -0800 Subject: [PATCH] Create task task-038 --- ...Location-Presence-with-Privacy-Controls.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 backlog/tasks/task-038 - Real-Time-Location-Presence-with-Privacy-Controls.md diff --git a/backlog/tasks/task-038 - Real-Time-Location-Presence-with-Privacy-Controls.md b/backlog/tasks/task-038 - Real-Time-Location-Presence-with-Privacy-Controls.md new file mode 100644 index 0000000..7e4a052 --- /dev/null +++ b/backlog/tasks/task-038 - Real-Time-Location-Presence-with-Privacy-Controls.md @@ -0,0 +1,58 @@ +--- +id: task-038 +title: Real-Time Location Presence with Privacy Controls +status: Done +assignee: [] +created_date: '2025-12-05 02:00' +labels: + - feature + - open-mapping + - privacy + - collaboration +dependencies: [] +priority: high +--- + +## Description + + +Implemented real-time location sharing with trust-based privacy controls for collaborative mapping. + +Key features: +- Privacy-preserving location via zkGPS commitments +- Trust circle precision controls (intimate ~2.4m → public ~630km) +- Real-time broadcasting and receiving of presence +- Proximity detection without revealing exact location +- React hook for easy canvas integration +- Map visualization components (PresenceLayer, PresenceList) + +Files created in src/open-mapping/presence/: +- types.ts: Comprehensive type definitions +- manager.ts: PresenceManager class with location watch, broadcasting, trust circles +- useLocationPresence.ts: React hook for canvas integration +- PresenceLayer.tsx: Map visualization components +- index.ts: Barrel export + +Integration pattern: +```typescript +const presence = useLocationPresence({ + channelId: 'room-id', + user: { pubKey, privKey, displayName, color }, + broadcastFn: (data) => automergeAdapter.broadcast(data), +}); + +// Set trust levels for contacts +presence.setTrustLevel(bobKey, 'friends'); // ~2.4km precision +presence.setTrustLevel(aliceKey, 'intimate'); // ~2.4m precision +``` + + +## Acceptance Criteria + +- [ ] #1 Location presence types defined +- [ ] #2 PresenceManager with broadcasting +- [ ] #3 Trust-based precision controls +- [ ] #4 React hook for canvas integration +- [ ] #5 Map visualization components +- [ ] #6 Proximity detection without exact location +