diff --git a/README.md b/README.md index 50b7506..a3383a8 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Every successful button press also posts an automatic chat announcement with the The goal is to make waiting social and consequential without rewarding button spam or changing the current game's rules. Planned delivery order: -1. **Optional live presence — implemented.** Show participating players watching the clock and who is viewing Chat. Off by default; ephemeral heartbeats, automatic expiry, and no activity history. See the details below. +1. **Optional live presence — implemented.** Show participating players watching the clock and who is viewing Chat. On by default, with a remembered opt-out; ephemeral heartbeats, automatic expiry, and no activity history. See the details below. 2. **Personal bests and rivalries — implemented.** Your score shows closest call, highest-scoring press, leaderboard position, and the player immediately ahead with points needed to catch up. Existing history is credited automatically; no data migration is needed. 3. **Achievements — implemented.** Close call, Full spectrum, and Keeping us alive appear under Your score with unlock dates and progress. Existing press history counts, with no bonus points or press-volume rewards. 4. **Community milestones — implemented.** Eight one-time shared goals post gold announcements in chat. Unlocks persist across restarts, and historical milestones are silently credited on upgrade. @@ -100,7 +100,7 @@ Keep the page open. Background throttling, suspension, network failures, and OS ### Live presence -Logged-in players can enable **Show me online** in their score section. Presence is off by default. The count near the clock includes only opted-in players with a visible tab; Chat also lists opted-in players currently viewing that section. Multiple tabs/sessions count as one player. Updates run every 15 seconds, and stale presence expires after 45 seconds. Hiding a tab or opting out removes that tab's presence; logging out removes all presence for that session. Failed disconnect updates fall back to expiry. Presence lives only in server memory and is cleared on restart. Guests and players who leave the setting off are not tracked, so the count is not a total visitor count. +**Show me online** is enabled by default for logged-in players. Players can disable it in their score section; an existing saved opt-out is preserved, including across reloads and open tabs. The count near the clock includes only players sharing presence with a visible tab; Chat also lists those currently viewing that section. Multiple tabs/sessions count as one player. Updates run every 15 seconds, and stale presence expires after 45 seconds. Hiding a tab or opting out removes that tab's presence; logging out removes all presence for that session. Failed disconnect updates fall back to expiry. Presence lives only in server memory and is cleared on restart. Guests and players who turn the setting off are not tracked, so the count is not a total visitor count. Public `GET /api/presence` returns `{online_count, chat_players}`. Authenticated `POST /api/presence` accepts `{tab_id, active, in_chat}` with a 32-character lowercase hexadecimal tab ID and boolean flags. At most 10 active tabs per login session are accepted. No player IDs, session IDs, or last-seen timestamps are returned publicly. diff --git a/static/app.js b/static/app.js index 12f4027..5127da9 100644 --- a/static/app.js +++ b/static/app.js @@ -13,7 +13,7 @@ let selectedSection = null; let chatSignature = null; let chatLoading = false; const PRESENCE_KEY = "thebutton-share-presence"; -let sharePresence = localStorage.getItem(PRESENCE_KEY) === "true"; +let sharePresence = localStorage.getItem(PRESENCE_KEY) !== "false"; let presenceTab = sessionStorage.getItem("thebutton-presence-tab"); if (!presenceTab) { presenceTab = Array.from(crypto.getRandomValues(new Uint8Array(16)), (n) => n.toString(16).padStart(2, "0")).join(""); @@ -207,7 +207,7 @@ window.addEventListener("storage", (event) => { renderAlertSettings(); } if (event.key === PRESENCE_KEY || event.key === TOKEN_KEY) { - sharePresence = localStorage.getItem(PRESENCE_KEY) === "true"; + sharePresence = localStorage.getItem(PRESENCE_KEY) !== "false"; token = localStorage.getItem(TOKEN_KEY); updateButton(); syncPresence(); diff --git a/static/index.html b/static/index.html index d29ee25..33b2e54 100644 --- a/static/index.html +++ b/static/index.html @@ -133,7 +133,7 @@
You're on the mailing list. Thanks!
Optional. Share that you're here, and your name in chat while viewing it. Only visible tabs count; no activity history is saved.
+On by default. Uncheck to hide your online status and chat presence. Only visible tabs count; no activity history is saved.