Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
Settings shows the account's id, one tap to copy, and the self-hosting guide answers which passkey providers work (#219, #101, #103)
Duarte Santos9dfe0d398149
diff --git a/docs/SELF_HOSTING.md b/docs/SELF_HOSTING.mdindex da401d0ca..5e8e4f19f 100644--- a/docs/SELF_HOSTING.md+++ b/docs/SELF_HOSTING.md@@ -122,8 +122,10 @@ INVITE_ONLY=1 # new profiles need an invite codeALLOW_GUEST=0 # remove "Continue without account"```-Register your own passkey profile first, then find your id in `./data/db.json` under `users[].id`-and put it in `ADMIN_UIDS`. You'll get an **Admin dashboard** link in Settings: who's training+Register your own passkey profile first, then copy your id from **Settings → Account → Account+ID** (tap it to copy; it is also in `./data/db.json` under `users[].id`) and put it in+`ADMIN_UIDS`. The same row is how anyone on your instance tells you which account is theirs when+they need help. You'll get an **Admin dashboard** link in Settings: who's trainingright now, each user's workout history and body weight, the ability to disable an account (signedout and locked out everywhere until you re-enable it), and — with `INVITE_ONLY=1` — generating andrevoking invite codes. Existing accounts keep working when you switch invite-only on. Admin access@@ -364,6 +366,40 @@ everybody registers again — which is why it pays to settle the domain before o> plain `http://192.168.x.x`: browsers only allow WebAuthn on HTTPS (or `localhost`). Use guest> mode, the standalone mobile app (`docs/MOBILE.md`), or put a certificate in front of it.+## Which passkey providers work++openGym asks for a passkey and nothing more specific: no particular kind of device, no platform+authenticator, no attestation, and sign-in lets the browser offer any passkey it can find for+your hostname. So whatever stores passkeys on your device works, and which one you get is+decided by your operating system and browser, not by openGym. The common questions:++**Can I keep my passkey in Bitwarden, 1Password, Proton Pass or another password manager on+Android?** Yes, on Android 14 or later. Switch the app on as a passkey provider in the system+settings (*Passwords, passkeys & accounts*, or *Passwords & accounts*; the name varies by+manufacturer). The system then offers that app when openGym asks to create or use a passkey. If+Chrome keeps offering only Google Password Manager, look under *Autofill services* in Chrome's+own settings for the option to use another service. On Android 13 and earlier, passkeys can only+be stored in Google Password Manager. (#101)++**Firefox on Windows 10 does not offer a QR code to sign in with my phone.** Firefox on Windows+hands passkeys to Windows' own dialog, and the Windows 10 dialog has no *use a phone* option;+Windows 11 added it. On Windows 10, sign in with Chrome or Edge, which show their own QR code, or+keep the passkey in a password manager that has a Firefox extension. (#103)++**Where does my passkey live?** Where you created it, and wherever that store syncs: Google+Password Manager to Chrome on your other devices signed in to the same Google account, iCloud+Keychain to your Apple devices, a password manager to every device it runs on. A passkey kept+only on one phone (or on a hardware key) goes with that phone.++**I lost my passkey.** An account has one passkey, the one it was registered with, and there is+no self-service recovery yet. If any device is still signed in (a browser, a paired phone),+export a backup there (**Settings → Export backup (JSON)**), register a new profile and import+it. When you ask your admin for help, the id under **Settings → Account → Account ID** tells them+exactly which account is yours.++The phone app never uses a passkey at all: it pairs with a one-time code from a signed-in+browser (see section 2).+## Troubleshooting| Symptom | Fix |diff --git a/frontend/src/index.css b/frontend/src/index.cssindex cdf223e75..76f77e803 100644--- a/frontend/src/index.css+++ b/frontend/src/index.css@@ -307,6 +307,9 @@ h4.sec{.lrow-m{flex:1;min-width:auto;display:flex;flex-direction:column;gap:1px}.lrow-t{font-size:17px;letter-spacing:-.012em;line-height:1.25}.lrow-s{font-size:13px;color:var(--label-2);line-height:1.3}+/* Settings → Account ID: a machine string, so a machine face, small, and free to break anywhere+ rather than push the row past a phone's edge. */+.acct-id{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;overflow-wrap:anywhere}/* flex:none would let a long value ("Follow the routine (Linear progression)") run straightthrough the title next to it, since the title's column only holds out for its longest word.Letting the value shrink and ellipsise instead keeps the two out of each other's way.diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.jsindex 4fd45de02..6b231c779 100644--- a/frontend/src/lib/pt-br-locale.test.js+++ b/frontend/src/lib/pt-br-locale.test.js@@ -28,10 +28,10 @@ describe('Brazilian Portuguese locale', () => {const fingerprint = createHash('sha256').update(JSON.stringify(inherited)).digest('hex')expect(Object.keys(PT_BR_OVERRIDES)).toHaveLength(680)- expect(inherited).toHaveLength(674)+ expect(inherited).toHaveLength(676)// If this fails, review the changed keys and wording before accepting a new hash. From// frontend/: node scripts/pt-br-inheritance-fingerprint.mjs --list- expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('f81cca4b7e73e229526217b8a3825069ee65fb6a5586c143b324038f99499f75')+ expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('7688ac3352bc6cef5f181a7cd7fe3eae75046c77f78d46b85188e67cd4fe731f')})test('does not leak European Portuguese UI terms', () => {diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.jsindex 2c59d308a..06ec38bd9 100644--- a/frontend/src/locales/de.js+++ b/frontend/src/locales/de.js@@ -311,6 +311,8 @@ export default {'Sign out': 'Abmelden','Sign out everywhere?': 'Überall abmelden?','Sign out everywhere': 'Überall abmelden',+ 'Account ID': 'Konto-ID',+ 'Account ID copied': 'Konto-ID kopiert','Ends this profile’s sessions on all your devices.': 'Beendet die Sitzungen dieses Profils auf all deinen Geräten.','Signed out on all devices': 'Auf allen Geräten abgemeldet','Could not sign out everywhere — you are still signed in.': 'Abmelden auf allen Geräten fehlgeschlagen — du bist weiterhin angemeldet.',@@ -942,9 +944,9 @@ export default {'An AI coach that can design your plan and adjust it from what you actually log. It runs with your own API key, it never changes anything without your say-so, and it is off until you turn it on.': 'Ein KI-Coach, der deinen Plan entwirft und ihn anhand dessen anpasst, was du wirklich einträgst. Er läuft mit deinem eigenen API-Schlüssel, ändert nie etwas ohne dein Okay und ist aus, bis du ihn einschaltest.','Bring my own API key': 'Eigenen API-Schlüssel verwenden','Could not reach the provider: {0}': 'Anbieter nicht erreichbar: {0}',+ 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android blockiert unverschlüsselte http://-Verbindungen aus Apps, deshalb erreicht dieses Handy nur einen https://-Endpunkt. Stell HTTPS davor (Tailscale oder ein Reverse Proxy) oder wähle „Mein selbst gehostetes openGym nutzen“: Dein Server erreicht ein http://-Modell in seinem eigenen Netzwerk.','Each request goes straight to {0} with your key — nobody else sees it, and you pay for it.': 'Jede Anfrage geht direkt mit deinem Schlüssel an {0} — niemand sonst sieht sie, und du bezahlst dafür.','Endpoint': 'Endpunkt',- 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android blockiert unverschlüsselte http://-Verbindungen aus Apps, deshalb erreicht dieses Handy nur einen https://-Endpunkt. Stell HTTPS davor (Tailscale oder ein Reverse Proxy) oder wähle „Mein selbst gehostetes openGym nutzen“: Dein Server erreicht ein http://-Modell in seinem eigenen Netzwerk.','Enter your API key': 'Gib deinen API-Schlüssel ein','How should the Coach run?': 'Wie soll der Coach laufen?','List models': 'Modelle laden',diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.jsindex 2724799e0..24621486c 100644--- a/frontend/src/locales/es.js+++ b/frontend/src/locales/es.js@@ -296,6 +296,8 @@ export default {'Sign out': 'Cerrar sesión','Sign out everywhere?': '¿Cerrar sesión en todos los dispositivos?','Sign out everywhere': 'Cerrar sesión en todos los dispositivos',+ 'Account ID': 'ID de la cuenta',+ 'Account ID copied': 'ID de la cuenta copiado','Ends this profile’s sessions on all your devices.': 'Termina las sesiones de este perfil en todos tus dispositivos.','Signed out on all devices': 'Sesión cerrada en todos los dispositivos','Could not sign out everywhere — you are still signed in.': 'No se pudo cerrar la sesión en todos los dispositivos — sigues con la sesión iniciada.',@@ -924,9 +926,9 @@ export default {'An AI coach that can design your plan and adjust it from what you actually log. It runs with your own API key, it never changes anything without your say-so, and it is off until you turn it on.': 'Un entrenador con IA que diseña tu plan y lo ajusta según lo que realmente registras. Funciona con tu propia clave de API, nunca cambia nada sin tu permiso y está apagado hasta que lo enciendas.','Bring my own API key': 'Usar mi propia clave de API','Could not reach the provider: {0}': 'No se pudo contactar con el proveedor: {0}',+ 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android bloquea las conexiones http:// sin cifrar desde las apps, así que este teléfono solo puede llegar a un endpoint https://. Pon HTTPS delante (Tailscale o un proxy inverso), o elige «Usar mi openGym autoalojado»: tu servidor sí puede llegar a un modelo http:// en su propia red.','Each request goes straight to {0} with your key — nobody else sees it, and you pay for it.': 'Cada solicitud va directamente a {0} con tu clave: nadie más la ve, y la pagas tú.','Endpoint': 'Endpoint',- 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android bloquea las conexiones http:// sin cifrar desde las apps, así que este teléfono solo puede llegar a un endpoint https://. Pon HTTPS delante (Tailscale o un proxy inverso), o elige «Usar mi openGym autoalojado»: tu servidor sí puede llegar a un modelo http:// en su propia red.','Enter your API key': 'Introduce tu clave de API','How should the Coach run?': '¿Cómo debe funcionar el entrenador?','List models': 'Listar modelos',diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.jsindex 6418026f9..4e01e1f90 100644--- a/frontend/src/locales/fr.js+++ b/frontend/src/locales/fr.js@@ -296,6 +296,8 @@ export default {'Sign out': 'Se déconnecter','Sign out everywhere?': 'Se déconnecter partout ?','Sign out everywhere': 'Se déconnecter partout',+ 'Account ID': 'Identifiant du compte',+ 'Account ID copied': 'Identifiant du compte copié','Ends this profile’s sessions on all your devices.': 'Met fin aux sessions de ce profil sur tous tes appareils.','Signed out on all devices': 'Déconnecté sur tous les appareils','Could not sign out everywhere — you are still signed in.': 'Impossible de se déconnecter partout — tu es toujours connecté.',@@ -924,9 +926,9 @@ export default {'An AI coach that can design your plan and adjust it from what you actually log. It runs with your own API key, it never changes anything without your say-so, and it is off until you turn it on.': 'Un coach IA qui conçoit ton plan et l’ajuste d’après ce que tu enregistres vraiment. Il fonctionne avec ta propre clé API, ne change jamais rien sans ton accord et reste désactivé tant que tu ne l’actives pas.','Bring my own API key': 'Utiliser ma propre clé API','Could not reach the provider: {0}': 'Impossible de joindre le fournisseur : {0}',+ 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android bloque les connexions http:// non chiffrées depuis les applis, donc ce téléphone ne peut joindre qu’un endpoint https://. Mets HTTPS devant (Tailscale ou un reverse proxy), ou choisis « Utiliser mon openGym auto-hébergé » : ton serveur, lui, peut joindre un modèle en http:// sur son propre réseau.','Each request goes straight to {0} with your key — nobody else sees it, and you pay for it.': 'Chaque requête part directement vers {0} avec ta clé — personne d’autre ne la voit, et c’est toi qui la paies.','Endpoint': 'Point d’accès',- 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android bloque les connexions http:// non chiffrées depuis les applis, donc ce téléphone ne peut joindre qu’un endpoint https://. Mets HTTPS devant (Tailscale ou un reverse proxy), ou choisis « Utiliser mon openGym auto-hébergé » : ton serveur, lui, peut joindre un modèle en http:// sur son propre réseau.','Enter your API key': 'Saisis ta clé API','How should the Coach run?': 'Comment le coach doit-il fonctionner ?','List models': 'Lister les modèles',diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.jsindex 05a66b6fe..db714d926 100644--- a/frontend/src/locales/hi.js+++ b/frontend/src/locales/hi.js@@ -296,6 +296,8 @@ export default {'Sign out': 'साइन आउट','Sign out everywhere?': 'हर जगह साइन आउट करें?','Sign out everywhere': 'हर जगह साइन आउट करें',+ 'Account ID': 'खाता ID',+ 'Account ID copied': 'खाता ID कॉपी हो गया','Ends this profile’s sessions on all your devices.': 'आपके सभी डिवाइस पर इस प्रोफ़ाइल के सेशन खत्म करता है।','Signed out on all devices': 'सभी डिवाइस पर साइन आउट हो गया','Could not sign out everywhere — you are still signed in.': 'हर जगह साइन आउट नहीं हो सका — आप अभी भी साइन इन हैं।',@@ -924,9 +926,9 @@ export default {'An AI coach that can design your plan and adjust it from what you actually log. It runs with your own API key, it never changes anything without your say-so, and it is off until you turn it on.': 'एक AI कोच जो आपकी योजना बनाता है और आपके वास्तविक रिकॉर्ड के आधार पर उसे समायोजित करता है। यह आपकी अपनी API कुंजी से चलता है, आपकी अनुमति के बिना कुछ नहीं बदलता, और जब तक आप इसे चालू न करें, बंद रहता है।','Bring my own API key': 'अपनी API कुंजी इस्तेमाल करें','Could not reach the provider: {0}': 'प्रदाता से संपर्क नहीं हो सका: {0}',+ 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android ऐप्स से बिना एन्क्रिप्शन वाले http:// कनेक्शन ब्लॉक करता है, इसलिए यह फ़ोन सिर्फ़ https:// एंडपॉइंट तक पहुँच सकता है। उसके आगे HTTPS लगाएं (Tailscale या रिवर्स प्रॉक्सी), या “मेरा सेल्फ़-होस्टेड openGym इस्तेमाल करें” चुनें: आपका सर्वर अपने नेटवर्क पर http:// मॉडल तक पहुँच सकता है।','Each request goes straight to {0} with your key — nobody else sees it, and you pay for it.': 'हर अनुरोध आपकी कुंजी के साथ सीधे {0} को जाता है — कोई और इसे नहीं देखता, और भुगतान आप करते हैं।','Endpoint': 'एंडपॉइंट',- 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android ऐप्स से बिना एन्क्रिप्शन वाले http:// कनेक्शन ब्लॉक करता है, इसलिए यह फ़ोन सिर्फ़ https:// एंडपॉइंट तक पहुँच सकता है। उसके आगे HTTPS लगाएं (Tailscale या रिवर्स प्रॉक्सी), या “मेरा सेल्फ़-होस्टेड openGym इस्तेमाल करें” चुनें: आपका सर्वर अपने नेटवर्क पर http:// मॉडल तक पहुँच सकता है।','Enter your API key': 'अपनी API कुंजी दर्ज करें','How should the Coach run?': 'कोच कैसे चले?','List models': 'मॉडल सूची',diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.jsindex f87c04c78..5a84d1bf9 100644--- a/frontend/src/locales/hu.js+++ b/frontend/src/locales/hu.js@@ -303,6 +303,8 @@ export default {'Sign out': 'Kijelentkezés','Sign out everywhere?': 'Kijelentkezel mindenhonnan?','Sign out everywhere': 'Kijelentkezés mindenhonnan',+ 'Account ID': 'Fiókazonosító',+ 'Account ID copied': 'Fiókazonosító kimásolva','Ends this profile’s sessions on all your devices.': 'Lezárja ennek a profilnak a munkameneteit minden eszközödön.','Signed out on all devices': 'Kijelentkezve minden eszközön','Could not sign out everywhere — you are still signed in.': 'Nem sikerült mindenhonnan kijelentkezni — továbbra is be vagy jelentkezve.',@@ -988,9 +990,9 @@ export default {'An AI coach that can design your plan and adjust it from what you actually log. It runs with your own API key, it never changes anything without your say-so, and it is off until you turn it on.': 'Egy MI-edző, amely megtervezi a programodat, és ahhoz igazítja, amit valóban rögzítesz. A saját API-kulcsoddal fut, a beleegyezésed nélkül semmit sem változtat, és ki van kapcsolva, amíg be nem kapcsolod.','Bring my own API key': 'Saját API-kulcsot használok','Could not reach the provider: {0}': 'A szolgáltató nem érhető el: {0}',+ 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Az Android letiltja az appokból induló titkosítatlan http:// kapcsolatokat, ezért ez a telefon csak https:// végpontot ér el. Tegyél elé HTTPS-t (Tailscale vagy reverse proxy), vagy válaszd „A saját openGym-szerveremet használom” lehetőséget: a szervered a saját hálózatán elér egy http:// modellt is.','Each request goes straight to {0} with your key — nobody else sees it, and you pay for it.': 'Minden kérés közvetlenül ide megy a kulcsoddal: {0} — más nem látja, és te fizeted.','Endpoint': 'Végpont',- 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Az Android letiltja az appokból induló titkosítatlan http:// kapcsolatokat, ezért ez a telefon csak https:// végpontot ér el. Tegyél elé HTTPS-t (Tailscale vagy reverse proxy), vagy válaszd „A saját openGym-szerveremet használom” lehetőséget: a szervered a saját hálózatán elér egy http:// modellt is.','Enter your API key': 'Add meg az API-kulcsodat','How should the Coach run?': 'Hogyan fusson az Edző?','List models': 'Modellek listázása',diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.jsindex 76d9d8825..78878a3f0 100644--- a/frontend/src/locales/it.js+++ b/frontend/src/locales/it.js@@ -296,6 +296,8 @@ export default {'Sign out': 'Esci','Sign out everywhere?': 'Uscire ovunque?','Sign out everywhere': 'Esci ovunque',+ 'Account ID': 'ID account',+ 'Account ID copied': 'ID account copiato','Ends this profile’s sessions on all your devices.': 'Chiude le sessioni di questo profilo su tutti i tuoi dispositivi.','Signed out on all devices': 'Uscito da tutti i dispositivi','Could not sign out everywhere — you are still signed in.': 'Impossibile uscire ovunque — sei ancora connesso.',@@ -924,9 +926,9 @@ export default {'An AI coach that can design your plan and adjust it from what you actually log. It runs with your own API key, it never changes anything without your say-so, and it is off until you turn it on.': 'Un coach con IA che progetta il tuo piano e lo adatta in base a ciò che registri davvero. Funziona con la tua chiave API, non cambia mai nulla senza il tuo consenso ed è spento finché non lo accendi.','Bring my own API key': 'Usare la mia chiave API','Could not reach the provider: {0}': 'Impossibile raggiungere il provider: {0}',+ 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android blocca le connessioni http:// non cifrate dalle app, quindi questo telefono può raggiungere solo un endpoint https://. Metti HTTPS davanti (Tailscale o un reverse proxy), oppure scegli «Usa il mio openGym self-hosted»: il tuo server può raggiungere un modello http:// sulla sua rete.','Each request goes straight to {0} with your key — nobody else sees it, and you pay for it.': 'Ogni richiesta va direttamente a {0} con la tua chiave: nessun altro la vede, e la paghi tu.','Endpoint': 'Endpoint',- 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android blocca le connessioni http:// non cifrate dalle app, quindi questo telefono può raggiungere solo un endpoint https://. Metti HTTPS davanti (Tailscale o un reverse proxy), oppure scegli «Usa il mio openGym self-hosted»: il tuo server può raggiungere un modello http:// sulla sua rete.','Enter your API key': 'Inserisci la tua chiave API','How should the Coach run?': 'Come deve funzionare il Coach?','List models': 'Elenca i modelli',diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.jsindex 5406fa689..663aa2e95 100644--- a/frontend/src/locales/ko.js+++ b/frontend/src/locales/ko.js@@ -296,6 +296,8 @@ export default {'Sign out': '로그아웃','Sign out everywhere?': '모든 기기에서 로그아웃할까요?','Sign out everywhere': '모든 기기에서 로그아웃',+ 'Account ID': '계정 ID',+ 'Account ID copied': '계정 ID를 복사했습니다','Ends this profile’s sessions on all your devices.': '모든 기기에서 이 프로필의 세션을 종료합니다.','Signed out on all devices': '모든 기기에서 로그아웃했습니다','Could not sign out everywhere — you are still signed in.': '모든 기기에서 로그아웃하지 못했습니다 — 아직 로그인 상태입니다.',@@ -924,9 +926,9 @@ export default {'An AI coach that can design your plan and adjust it from what you actually log. It runs with your own API key, it never changes anything without your say-so, and it is off until you turn it on.': '당신의 계획을 설계하고 실제 기록에 따라 조정하는 AI 코치입니다. 당신의 API 키로 실행되며, 동의 없이는 아무것도 바꾸지 않고, 켜기 전까지는 꺼져 있습니다.','Bring my own API key': '내 API 키 사용','Could not reach the provider: {0}': '제공자에 연결할 수 없습니다: {0}',+ 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android는 앱의 암호화되지 않은 http:// 연결을 차단하므로 이 휴대폰은 https:// 엔드포인트에만 연결할 수 있습니다. 앞단에 HTTPS를 두거나(Tailscale 또는 리버스 프록시) “내 자체 호스팅 openGym 사용”을 선택하세요. 서버는 자체 네트워크의 http:// 모델에 연결할 수 있습니다.','Each request goes straight to {0} with your key — nobody else sees it, and you pay for it.': '모든 요청은 당신의 키로 {0}에 바로 전송됩니다 — 다른 누구도 볼 수 없고, 비용은 당신이 냅니다.','Endpoint': '엔드포인트',- 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android는 앱의 암호화되지 않은 http:// 연결을 차단하므로 이 휴대폰은 https:// 엔드포인트에만 연결할 수 있습니다. 앞단에 HTTPS를 두거나(Tailscale 또는 리버스 프록시) “내 자체 호스팅 openGym 사용”을 선택하세요. 서버는 자체 네트워크의 http:// 모델에 연결할 수 있습니다.','Enter your API key': 'API 키를 입력하세요','How should the Coach run?': '코치를 어떻게 실행할까요?','List models': '모델 목록',diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.jsindex 295a7ae0e..780895298 100644--- a/frontend/src/locales/pl.js+++ b/frontend/src/locales/pl.js@@ -296,6 +296,8 @@ export default {'Sign out': 'Wyloguj','Sign out everywhere?': 'Wylogować wszędzie?','Sign out everywhere': 'Wyloguj wszędzie',+ 'Account ID': 'ID konta',+ 'Account ID copied': 'Skopiowano ID konta','Ends this profile’s sessions on all your devices.': 'Kończy sesje tego profilu na wszystkich Twoich urządzeniach.','Signed out on all devices': 'Wylogowano na wszystkich urządzeniach','Could not sign out everywhere — you are still signed in.': 'Nie udało się wylogować wszędzie — nadal jesteś zalogowany.',@@ -924,9 +926,9 @@ export default {'An AI coach that can design your plan and adjust it from what you actually log. It runs with your own API key, it never changes anything without your say-so, and it is off until you turn it on.': 'Trener AI, który projektuje Twój plan i dostosowuje go do tego, co naprawdę zapisujesz. Działa z Twoim własnym kluczem API, nigdy nic nie zmienia bez Twojej zgody i jest wyłączony, dopóki go nie włączysz.','Bring my own API key': 'Użyj mojego klucza API','Could not reach the provider: {0}': 'Nie można połączyć się z dostawcą: {0}',+ 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android blokuje nieszyfrowane połączenia http:// z aplikacji, więc ten telefon połączy się tylko z punktem końcowym https://. Postaw przed nim HTTPS (Tailscale albo reverse proxy) albo wybierz „Użyj mojego własnego openGym”: twój serwer połączy się z modelem http:// we własnej sieci.','Each request goes straight to {0} with your key — nobody else sees it, and you pay for it.': 'Każde zapytanie trafia prosto do {0} z Twoim kluczem — nikt inny go nie widzi, a płacisz Ty.','Endpoint': 'Endpoint',- 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android blokuje nieszyfrowane połączenia http:// z aplikacji, więc ten telefon połączy się tylko z punktem końcowym https://. Postaw przed nim HTTPS (Tailscale albo reverse proxy) albo wybierz „Użyj mojego własnego openGym”: twój serwer połączy się z modelem http:// we własnej sieci.','Enter your API key': 'Wpisz swój klucz API','How should the Coach run?': 'Jak ma działać trener?','List models': 'Pokaż modele',diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.jsindex 3bdcfea5a..65d3630ee 100644--- a/frontend/src/locales/pt.js+++ b/frontend/src/locales/pt.js@@ -296,6 +296,8 @@ export default {'Sign out': 'Terminar sessão','Sign out everywhere?': 'Terminar sessão em todos os dispositivos?','Sign out everywhere': 'Terminar sessão em todos os dispositivos',+ 'Account ID': 'ID da conta',+ 'Account ID copied': 'ID da conta copiado','Ends this profile’s sessions on all your devices.': 'Termina as sessões deste perfil em todos os teus dispositivos.','Signed out on all devices': 'Sessão terminada em todos os dispositivos','Could not sign out everywhere — you are still signed in.': 'Não foi possível terminar a sessão em todos os dispositivos — continuas com sessão iniciada.',@@ -924,9 +926,9 @@ export default {'An AI coach that can design your plan and adjust it from what you actually log. It runs with your own API key, it never changes anything without your say-so, and it is off until you turn it on.': 'Um treinador com IA que cria o teu plano e o ajusta com base no que registas. Corre com a tua própria chave de API, nunca muda nada sem a tua autorização e está desligado até o ligares.','Bring my own API key': 'Usar a minha própria chave de API','Could not reach the provider: {0}': 'Não foi possível contactar o fornecedor: {0}',+ 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'O Android bloqueia ligações http:// não cifradas a partir de apps, por isso este telemóvel só chega a um endpoint https://. Põe HTTPS à frente (Tailscale ou um reverse proxy), ou escolhe «Usar o meu openGym self-hosted»: o teu servidor consegue chegar a um modelo http:// na própria rede.','Each request goes straight to {0} with your key — nobody else sees it, and you pay for it.': 'Cada pedido vai diretamente para {0} com a tua chave — mais ninguém o vê, e és tu que pagas.','Endpoint': 'Endpoint',- 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'O Android bloqueia ligações http:// não cifradas a partir de apps, por isso este telemóvel só chega a um endpoint https://. Põe HTTPS à frente (Tailscale ou um reverse proxy), ou escolhe «Usar o meu openGym self-hosted»: o teu servidor consegue chegar a um modelo http:// na própria rede.','Enter your API key': 'Introduz a tua chave de API','How should the Coach run?': 'Como deve correr o Treinador?','List models': 'Listar modelos',diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.jsindex 98d28d7c5..3b6bd3f82 100644--- a/frontend/src/locales/ru.js+++ b/frontend/src/locales/ru.js@@ -296,6 +296,8 @@ export default {'Sign out': 'Выйти','Sign out everywhere?': 'Выйти на всех устройствах?','Sign out everywhere': 'Выйти на всех устройствах',+ 'Account ID': 'ID аккаунта',+ 'Account ID copied': 'ID аккаунта скопирован','Ends this profile’s sessions on all your devices.': 'Завершает сеансы этого профиля на всех твоих устройствах.','Signed out on all devices': 'Выход выполнен на всех устройствах','Could not sign out everywhere — you are still signed in.': 'Не удалось выйти на всех устройствах — ты всё ещё в системе.',@@ -924,9 +926,9 @@ export default {'An AI coach that can design your plan and adjust it from what you actually log. It runs with your own API key, it never changes anything without your say-so, and it is off until you turn it on.': 'ИИ-тренер, который составляет план и корректирует его по тому, что вы реально записываете. Работает с вашим собственным API-ключом, ничего не меняет без вашего согласия и выключен, пока вы его не включите.','Bring my own API key': 'Использовать свой API-ключ','Could not reach the provider: {0}': 'Не удалось связаться с провайдером: {0}',+ 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android блокирует незашифрованные подключения http:// из приложений, поэтому этот телефон может обращаться только к адресу https://. Поставьте перед ним HTTPS (Tailscale или обратный прокси) или выберите «Использовать мой собственный openGym»: ваш сервер может обращаться к модели по http:// в своей сети.','Each request goes straight to {0} with your key — nobody else sees it, and you pay for it.': 'Каждый запрос уходит напрямую в {0} с вашим ключом — больше никто его не видит, и платите за него вы.','Endpoint': 'Эндпоинт',- 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android блокирует незашифрованные подключения http:// из приложений, поэтому этот телефон может обращаться только к адресу https://. Поставьте перед ним HTTPS (Tailscale или обратный прокси) или выберите «Использовать мой собственный openGym»: ваш сервер может обращаться к модели по http:// в своей сети.','Enter your API key': 'Введите API-ключ','How should the Coach run?': 'Как должен работать тренер?','List models': 'Показать модели',diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.jsindex 09000465d..4cd79b3c2 100644--- a/frontend/src/locales/th.js+++ b/frontend/src/locales/th.js@@ -303,6 +303,8 @@ export default {'Sign out': 'ออกจากระบบ','Sign out everywhere?': 'ออกจากระบบทุกอุปกรณ์?','Sign out everywhere': 'ออกจากระบบทุกอุปกรณ์',+ 'Account ID': 'ID บัญชี',+ 'Account ID copied': 'คัดลอก ID บัญชีแล้ว','Ends this profile’s sessions on all your devices.': 'จะยุติเซสชันของโปรไฟล์นี้ในทุกอุปกรณ์ของคุณ','Signed out on all devices': 'ออกจากระบบทุกอุปกรณ์แล้ว','Could not sign out everywhere — you are still signed in.': 'ออกจากระบบทุกอุปกรณ์ไม่สำเร็จ — คุณยังคงเข้าสู่ระบบอยู่',@@ -996,9 +998,9 @@ export default {'An AI coach that can design your plan and adjust it from what you actually log. It runs with your own API key, it never changes anything without your say-so, and it is off until you turn it on.': 'โค้ช AI ที่ออกแบบแผนของคุณและปรับตามสิ่งที่คุณบันทึกจริง ทำงานด้วยคีย์ API ของคุณเอง ไม่เปลี่ยนแปลงอะไรโดยไม่ได้รับความยินยอมจากคุณ และปิดอยู่จนกว่าคุณจะเปิด','Bring my own API key': 'ใช้คีย์ API ของฉันเอง','Could not reach the provider: {0}': 'ไม่สามารถติดต่อผู้ให้บริการได้: {0}',+ 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android บล็อกการเชื่อมต่อ http:// ที่ไม่เข้ารหัสจากแอป โทรศัพท์เครื่องนี้จึงเข้าถึงได้เฉพาะ endpoint แบบ https:// ให้วาง HTTPS ไว้ด้านหน้า (Tailscale หรือ reverse proxy) หรือเลือก “ใช้ openGym ที่ฉันโฮสต์เอง”: เซิร์ฟเวอร์ของคุณเข้าถึงโมเดล http:// ในเครือข่ายของตัวเองได้','Each request goes straight to {0} with your key — nobody else sees it, and you pay for it.': 'ทุกคำขอส่งตรงไปยัง {0} ด้วยคีย์ของคุณ — ไม่มีใครเห็น และคุณเป็นผู้จ่าย','Endpoint': 'ปลายทาง',- 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android บล็อกการเชื่อมต่อ http:// ที่ไม่เข้ารหัสจากแอป โทรศัพท์เครื่องนี้จึงเข้าถึงได้เฉพาะ endpoint แบบ https:// ให้วาง HTTPS ไว้ด้านหน้า (Tailscale หรือ reverse proxy) หรือเลือก “ใช้ openGym ที่ฉันโฮสต์เอง”: เซิร์ฟเวอร์ของคุณเข้าถึงโมเดล http:// ในเครือข่ายของตัวเองได้','Enter your API key': 'ป้อนคีย์ API ของคุณ','How should the Coach run?': 'ให้โค้ชทำงานอย่างไร','List models': 'แสดงรายการโมเดล',diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.jsindex 6ab0261c9..ec982a0d8 100644--- a/frontend/src/locales/tr.js+++ b/frontend/src/locales/tr.js@@ -296,6 +296,8 @@ export default {'Sign out': 'Çıkış yap','Sign out everywhere?': 'Her yerden çıkış yapılsın mı?','Sign out everywhere': 'Her yerden çıkış yap',+ 'Account ID': 'Hesap kimliği',+ 'Account ID copied': 'Hesap kimliği kopyalandı','Ends this profile’s sessions on all your devices.': 'Bu profilin tüm cihazlarındaki oturumlarını sonlandırır.','Signed out on all devices': 'Tüm cihazlarda çıkış yapıldı','Could not sign out everywhere — you are still signed in.': 'Her yerden çıkış yapılamadı — hâlâ giriş yapmış durumdasın.',@@ -924,9 +926,9 @@ export default {'An AI coach that can design your plan and adjust it from what you actually log. It runs with your own API key, it never changes anything without your say-so, and it is off until you turn it on.': 'Planını tasarlayan ve gerçekten kaydettiklerine göre ayarlayan bir yapay zekâ koçu. Kendi API anahtarınla çalışır, onayın olmadan hiçbir şeyi değiştirmez ve sen açana kadar kapalıdır.','Bring my own API key': 'Kendi API anahtarımı kullan','Could not reach the provider: {0}': 'Sağlayıcıya ulaşılamadı: {0}',+ 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android, uygulamalardan gelen şifrelenmemiş http:// bağlantılarını engeller; bu yüzden bu telefon yalnızca bir https:// uç noktasına ulaşabilir. Önüne HTTPS koy (Tailscale ya da ters proxy) veya “Kendi openGym sunucumu kullan” seçeneğini seç: sunucun kendi ağındaki bir http:// modele ulaşabilir.','Each request goes straight to {0} with your key — nobody else sees it, and you pay for it.': 'Her istek anahtarınla doğrudan {0} adresine gider — başka kimse görmez ve ücretini sen ödersin.','Endpoint': 'Uç nokta',- 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android, uygulamalardan gelen şifrelenmemiş http:// bağlantılarını engeller; bu yüzden bu telefon yalnızca bir https:// uç noktasına ulaşabilir. Önüne HTTPS koy (Tailscale ya da ters proxy) veya “Kendi openGym sunucumu kullan” seçeneğini seç: sunucun kendi ağındaki bir http:// modele ulaşabilir.','Enter your API key': 'API anahtarını gir','How should the Coach run?': 'Koç nasıl çalışsın?','List models': 'Modelleri listele',diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.jsindex 1de127669..29acc8eeb 100644--- a/frontend/src/locales/zh.js+++ b/frontend/src/locales/zh.js@@ -296,6 +296,8 @@ export default {'Sign out': '退出登录','Sign out everywhere?': '在所有设备上退出登录?','Sign out everywhere': '在所有设备上退出登录',+ 'Account ID': '账号 ID',+ 'Account ID copied': '已复制账号 ID','Ends this profile’s sessions on all your devices.': '结束此档案在你所有设备上的会话。','Signed out on all devices': '已在所有设备上退出登录','Could not sign out everywhere — you are still signed in.': '无法在所有设备上退出登录——你仍处于登录状态。',@@ -924,9 +926,9 @@ export default {'An AI coach that can design your plan and adjust it from what you actually log. It runs with your own API key, it never changes anything without your say-so, and it is off until you turn it on.': '一个能为你设计计划并根据你实际记录进行调整的 AI 教练。它使用你自己的 API 密钥运行,未经你同意不会更改任何内容,并且在你开启之前保持关闭。','Bring my own API key': '使用我自己的 API 密钥','Could not reach the provider: {0}': '无法连接到提供商:{0}',+ 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android 会阻止应用发起未加密的 http:// 连接,所以这部手机只能连接 https:// 端点。请在它前面加一层 HTTPS(Tailscale 或反向代理),或选择“使用我自托管的 openGym”:你的服务器可以访问它自己网络中的 http:// 模型。','Each request goes straight to {0} with your key — nobody else sees it, and you pay for it.': '每个请求都会用你的密钥直接发送到 {0}——其他人看不到,费用由你承担。','Endpoint': '端点',- 'Android blocks unencrypted http:// connections from apps, so this phone can only reach an https:// endpoint. Put HTTPS in front of it (Tailscale or a reverse proxy), or choose “Use my self-hosted openGym”: your server can reach an http:// model on its own network.': 'Android 会阻止应用发起未加密的 http:// 连接,所以这部手机只能连接 https:// 端点。请在它前面加一层 HTTPS(Tailscale 或反向代理),或选择“使用我自托管的 openGym”:你的服务器可以访问它自己网络中的 http:// 模型。','Enter your API key': '请输入你的 API 密钥','How should the Coach run?': '教练应如何运行?','List models': '列出模型',diff --git a/frontend/src/views/Settings.account-id.test.jsx b/frontend/src/views/Settings.account-id.test.jsxnew file mode 100644index 000000000..6093ef785--- /dev/null+++ b/frontend/src/views/Settings.account-id.test.jsx@@ -0,0 +1,112 @@+// @vitest-environment happy-dom+import React, { act } from 'react'+import { createRoot } from 'react-dom/client'+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'+import Settings from './Settings.jsx'++globalThis.IS_REACT_ACT_ENVIRONMENT = true++/* Settings → Account ID (#219): the signed-in account's id, small, one tap to copy. It is what+ an admin puts in ADMIN_UIDS and what names an account beyond doubt in a support request. A+ browser shows it under Account, a paired phone in its Server & sync block, a guest nowhere. */+const mocks = vi.hoisted(() => {+ const state = { S: null, user: null, MOBILE: false }+ state.toast = vi.fn()+ state.snapshot = () => ({+ S: state.S, user: state.user, coachLocal: null,+ sync: { status: 'ok', offline: false, pending: false, auth: false, lastError: null, lastSynced: Date.now(), server: 'https://gym.example.com' },+ update: vi.fn(), replaceState: vi.fn(), setUser: vi.fn(), pullState: vi.fn(), pushState: vi.fn(), resetDemo: vi.fn(),+ syncNow: vi.fn(), unsyncedChanges: () => ({ owed: false, count: 0 }), keptChanges: async () => [],+ disconnectServer: vi.fn(), signOut: vi.fn(), signOutAll: vi.fn(), adoptProfile: vi.fn(),+ })+ return state+})+vi.mock('../store/useStore.js', () => {+ const useStore = selector => selector ? selector(mocks.snapshot()) : mocks.snapshot()+ useStore.getState = mocks.snapshot+ return { useStore, DEF: { reminder: { time: '17:30' } }, hasData: () => false }+})+vi.mock('../store/useUI.js', () => {+ const snap = () => ({ toast: (...a) => mocks.toast(...a), openSheet: vi.fn() })+ const useUI = selector => selector ? selector(snap()) : snap()+ useUI.getState = snap+ return { useUI }+})+vi.mock('react-router-dom', () => ({ useNavigate: () => () => {} }))+vi.mock('../lib/api.js', () => ({+ api: vi.fn(() => Promise.resolve({})), webauthnOK: () => true, passkeyLogin: vi.fn(), passkeyRegister: vi.fn(), IS_ANDROID: false,+}))+vi.mock('../lib/push.js', () => ({ pushSupported: () => false, enablePush: vi.fn(), disablePush: vi.fn(), sendTestPush: vi.fn() }))+vi.mock('../lib/wakelock.js', () => ({ wakeLockSupported: () => false }))+vi.mock('../lib/mobile.js', () => ({+ get MOBILE() { return mocks.MOBILE },+ isAndroid: () => Promise.resolve(false), shareExport: vi.fn(), syncReminder: vi.fn(),+}))+vi.mock('./MobileOnboarding.jsx', () => ({ ConnectSheet: () => null }))+vi.mock('../sheets.jsx', () => ({+ starterPlanSheet: vi.fn(), confirmSheet: vi.fn(), importFromApp: vi.fn(),+ importFromHevy: vi.fn(), equipmentProfileSheet: vi.fn(), menuSheet: vi.fn(), askAddDeviceData: vi.fn(),+}))++globalThis.__APP_VERSION__ ??= 'test'++const ID = 'k3v9q0x2mz7a'+const mounted = []+function mount(el) {+ const host = document.createElement('div')+ document.body.appendChild(host)+ const root = createRoot(host)+ mounted.push({ root, host })+ act(() => root.render(el))+ return host+}+// The copy only calls the clipboard and a toast, no React state, so a plain tick lets the+// clipboard promise settle; nothing here needs act() to flush.+const tick = () => new Promise(r => setTimeout(r, 0))+const section = (page, title) => [...page.querySelectorAll('.sect')].find(s => s.querySelector('.sect-t')?.textContent === title)+const idRow = el => [...el.querySelectorAll('.lrow')].find(r => r.querySelector('.lrow-t')?.textContent === 'Account ID')++let writeText+beforeEach(() => {+ mocks.S = { unit: 'kg', restSec: 90, restPauseSec: 15, sound: false, effort: 'none', gifSize: 'full', workouts: [], routines: [], exWeights: {} }+ mocks.user = { id: ID, name: 'andi' }+ mocks.MOBILE = false+ mocks.toast.mockClear()+ writeText = vi.fn(() => Promise.resolve())+ Object.defineProperty(navigator, 'clipboard', { value: { writeText }, configurable: true })+})+afterEach(() => { act(() => { mounted.splice(0).forEach(({ root, host }) => { root.unmount(); host.remove() }) }) })++describe('Settings → Account ID', () => {+ it('a signed-in browser shows the id under Account, and a tap copies it', async () => {+ const page = mount(<Settings />)+ const row = idRow(section(page, 'Account'))+ expect(row).toBeTruthy()+ expect(row.querySelector('.acct-id').textContent).toBe(ID)+ act(() => row.click())+ await tick()+ expect(writeText).toHaveBeenCalledWith(ID)+ expect(mocks.toast).toHaveBeenCalledWith('Account ID copied')+ })++ it('a paired phone shows it in the Server & sync block', () => {+ mocks.MOBILE = true+ const page = mount(<Settings />)+ expect(idRow(section(page, 'Server & sync')).querySelector('.acct-id').textContent).toBe(ID)+ })++ it('a clipboard that refuses says nothing, and the id stays on screen', async () => {+ writeText.mockImplementation(() => Promise.reject(new Error('denied')))+ const page = mount(<Settings />)+ act(() => idRow(page).click())+ await tick()+ expect(mocks.toast).not.toHaveBeenCalled()+ expect(idRow(page).textContent).toContain(ID)+ })++ it('a guest has no account and no id', () => {+ mocks.user = null+ const page = mount(<Settings />)+ expect(idRow(page)).toBeUndefined()+ })+})diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsxindex e2c48b19a..0967948f2 100644--- a/frontend/src/views/Settings.jsx+++ b/frontend/src/views/Settings.jsx@@ -205,6 +205,7 @@ export default function Settings() {{user && !DEMO && <ServerSyncSection>{MOBILE && <>{user.admin && <Row icon="wrench" iconTint="var(--indigo)" title={t('Admin dashboard')} accessory="chevron" onClick={() => nav('/admin')} />}+ <AccountIdRow id={user.id} /><Row icon="signOut" iconTint="var(--red)" title={t('Disconnect')} danger onClick={disconnect} /></>}</ServerSyncSection>}@@ -228,6 +229,7 @@ export default function Settings() {onClick={() => useUI.getState().openSheet(close => <PairSheet close={close} />)} /><Row icon="signOut" iconTint="var(--red)" title={t('Sign out')} danger onClick={signOutHere} /><Row icon="shield" iconTint="var(--red)" title={t('Sign out everywhere')} subtitle={t('Ends this profile’s sessions on all your devices.')} danger onClick={signOutEverywhere} />+ <AccountIdRow id={user.id} /></> : webauthnOK() ? <><Row icon="sparkles" iconTint="var(--acc)" title={t('Create passkey profile')} subtitle={t('Keeps your data safe and separate per person.')} accessory="chevron" onClick={registerHere} /><Row icon="person" iconTint="var(--blue)" title={t('Sign in with passkey')} accessory="chevron" onClick={signInAgain} />@@ -688,6 +690,17 @@ function EquipmentCard({ S, update }) {</Section>}+// The account's id, small and one tap to copy (#219). It is what an admin puts in ADMIN_UIDS,+// and the one thing that names an account beyond doubt when someone asks their admin for help:+// display names are free text and need not be unique. Where the clipboard is out of reach the+// id is still on screen to read out.+function AccountIdRow({ id }) {+ const toast = useUI(s => s.toast)+ if (!id) return null+ const copy = () => navigator.clipboard?.writeText(id).then(() => toast(t('Account ID copied')), () => {})+ return <Row icon="person" iconTint="var(--grey)" title={t('Account ID')} subtitle={<span className="acct-id">{id}</span>} onClick={copy} />+}+// Lets the mobile app's "connect to my server" mode (lib/remote.js) authenticate without a// WebAuthn ceremony of its own — the code is minted here, from an already signed-in session,// and redeemed by the app for a bearer token. See /api/pair/create in api/server.js.