north-star / mobile / files / src / public_settings.ts
Branch mobile · default branch · all branches
public_settings.ts
9fda5271 2026-03-16 Pavel Safronov | 1 | /** |
| 2 | * Public runtime settings that tune app behavior. | |
| 3 | * | |
| 4 | * These values are safe to ship to clients and intentionally exclude secrets. | |
| 5 | * Keep this file as the single source of truth for behavioral constants. | |
| 6 | */ | |
| 7 | export const PUBLIC_SETTINGS = { | |
| 8 | app: { | |
| 9 | /** How often the render loop runs. */ | |
| 10 | renderIntervalMs: 100 | |
| 11 | }, | |
| 12 | location: { | |
| 13 | /** Stationary heartbeat write cadence. */ | |
| 14 | stationarySyncIntervalMs: 2 * 60 * 1000, | |
| 15 | /** Max write cadence while movement is detected. */ | |
| 16 | movingSyncIntervalMs: 10 * 1000, | |
0b65bf68 2026-03-16 Pavel Safronov | 17 | /** Minimum movement distance (meters) treated as meaningful movement. */ |
| 18 | changeThresholdMeters: 1 | |
9fda5271 2026-03-16 Pavel Safronov | 19 | }, |
| 20 | presence: { | |
| 21 | /** Time window where a friend is treated as online/solid. */ | |
| 22 | onlineGraceMs: 5 * 60 * 1000, | |
| 23 | /** Default time window where offline friends still show as "recent". */ | |
| 24 | defaultRecentlyOfflineMs: 60 * 60 * 1000 | |
| 25 | }, | |
| 26 | cleanup: { | |
| 27 | /** Friend records older than this are eligible for cleanup. */ | |
c18940ae 2026-03-16 Pavel Safronov | 28 | staleFriendTtlMs: 30 * 24 * 60 * 60 * 1000 |
9fda5271 2026-03-16 Pavel Safronov | 29 | }, |
| 30 | compass: { | |
| 31 | /** Delay before showing "no compass data" status. */ | |
| 32 | probeTimeoutMs: 2500 | |
| 33 | }, | |
efc31a14 2026-03-16 Pavel Safronov | 34 | features: { |
| 35 | /** Whether to render the synthetic Guardian Angel marker. */ | |
| 36 | guardianAngelEnabled: false | |
| 37 | }, | |
9fda5271 2026-03-16 Pavel Safronov | 38 | room: { |
| 39 | /** Length of generated room IDs. */ | |
| 40 | idLength: 8 | |
| 41 | }, | |
| 42 | links: { | |
| 43 | /** Hosted app base URL used in invite QR cards for local runs. */ | |
| 44 | gitlabPagesBaseUrl: 'https://pavelsafronov.gitlab.io/north-star/' | |
32796e53 2026-03-16 Pavel Safronov | 45 | }, |
| 46 | ui: { | |
| 47 | emojis: { | |
| 48 | darkMode: { | |
| 49 | off: '🌙', | |
| 50 | on: '☀️' | |
| 51 | }, | |
| 52 | wakeLock: { | |
| 53 | off: '💤', | |
| 54 | on: '🔆' | |
| 55 | }, | |
| 56 | presence: { | |
| 57 | online: '🟢', | |
| 58 | recentlyOffline: '🟡', | |
| 59 | staleOffline: '⚪' | |
| 60 | }, | |
| 61 | dragHandle: '☰' | |
| 62 | } | |
9fda5271 2026-03-16 Pavel Safronov | 63 | } |
| 64 | } as const; | |
| 65 | ||
| 66 | export type PublicSettings = typeof PUBLIC_SETTINGS; |