1.8 KiB
1.8 KiB
| id | title | status | assignee | created_date | updated_date | labels | dependencies | priority | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| task-038 | Real-Time Location Presence with Privacy Controls | Done | 2025-12-05 02:00 | 2025-12-05 02:00 |
|
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:
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