| … | … | @@ -7,6 +7,7 @@ |
| 7 | 7 | // Pure + injected: takes plain view-models ({ posts, cursor }, a viewer descriptor) and returns |
| 8 | 8 | // strings. It touches no P2P/index state, so it is unit-testable in isolation. |
| 9 | 9 | import { SCOPE_COLLECTION } from './scopes.js' |
| 10 | import { VERSION } from './version.js' |
| 10 | 11 | import { reachFor } from './reach.js' |
| 11 | 12 | import { isSafeCid } from './blob-serve.js' |
| 12 | 13 | |
| … | … | @@ -908,6 +909,8 @@ header nav a[aria-current=page]{color:var(--fg);font-weight:600;border-bottom-co |
| 908 | 909 | .themebtn:hover{background:var(--bg-soft);color:var(--fg)} |
| 909 | 910 | .themebtn.on{background:var(--accent);color:var(--on-accent);font-weight:600} |
| 910 | 911 | .themenote{font-size:var(--f0);color:var(--fg-faint);margin:var(--s2) 0 0;max-width:44ch} |
| 912 | .vernote{font-size:var(--f0);color:var(--fg-faint);margin:var(--s5) 0 0} |
| 913 | .vernote code{font-size:var(--f0)} |
| 911 | 914 | /* ── composer ────────────────────────────────────────────────────────────────────────────────────── |
| 912 | 915 | The composer was ~40% of the first screen on a phone, permanently expanded, with four gate selects |
| 913 | 916 | competing with the timeline before a reader had seen a single post. The gates move behind a native |
| … | … | @@ -1183,10 +1186,20 @@ export function themeControl (theme = null, returnTo = '/settings') { |
| 1183 | 1186 | <p class="themenote">System follows your device. On Android the in-app browser does not report that setting, so choose Light or Dark there.</p></section>` |
| 1184 | 1187 | } |
| 1185 | 1188 | |
| 1189 | // The version of the RUNNING code. `pgh app status` reports the version on DISK, which an app that |
| 1190 | // installed an update and never restarted will report while still serving the old one — so a number |
| 1191 | // rendered by the process itself is the only one that answers "what am I actually looking at". |
| 1192 | // |
| 1193 | // Shown SIGNED OUT as well, and on the phone this is the only place a version appears at all: the |
| 1194 | // handset has no `pgh app status`, and its worklet bundle arrives by OTA independently of any APK. |
| 1195 | export function versionNote () { |
| 1196 | return `<p class="vernote">favela-web <code>${esc(VERSION)}</code></p>` |
| 1197 | } |
| 1198 | |
| 1186 | 1199 | export function settingsPage ({ viewer = null, profile = null, did = null, devices = [], theme = null } = {}) { |
| 1187 | 1200 | if (!viewer) { |
| 1188 | 1201 | // Appearance still renders here — it is not an account setting. |
| 1189 | | return page({ title: 'settings · favela', viewer, active: null, theme, body: '<div class="viewhdr">Settings <a href="/">← back</a></div>' + themeControl(theme) + '<p class="empty">Sign in to manage your profile. <a href="/login">sign in →</a></p>' }) |
| 1202 | return page({ title: 'settings · favela', viewer, active: null, theme, body: '<div class="viewhdr">Settings <a href="/">← back</a></div>' + themeControl(theme) + versionNote() + '<p class="empty">Sign in to manage your profile. <a href="/login">sign in →</a></p>' }) |
| 1190 | 1203 | } |
| 1191 | 1204 | const cid = profile && profile.avatar && blobCid(profile.avatar.ref) |
| 1192 | 1205 | const current = (cid && did && isSafeCid(cid)) |
| … | … | @@ -1210,6 +1223,7 @@ export function settingsPage ({ viewer = null, profile = null, did = null, devic |
| 1210 | 1223 | theme, |
| 1211 | 1224 | body: `<div class="viewhdr">Settings <a href="/">← back</a></div> |
| 1212 | 1225 | ${themeControl(theme)} |
| 1226 | ${versionNote()} |
| 1213 | 1227 | <section class="authbox"> |
| 1214 | 1228 | <h3>Profile picture</h3> |
| 1215 | 1229 | <p class="empty">Signed in as <strong>${esc(viewer.did)}</strong>${profile && profile.displayName ? ' · ' + esc(profile.displayName) : ''}</p> |