--- id: 015-availability-ui-and-settings-3b9397 title: Show peer availability with stale markers and add Sharing settings created: 2026-09-29 depends_on: [014-p2p-presence-hub-ceced8] est_files: 6 --- # 015 — Availability line + Sharing settings ## Objective Implements the UI half of flow 5 and the settings of `docs/p2p-architecture.md`. After this plan: - Under the now-playing title a small line shows peer availability, e.g. `📡 On 3 devices · 1 online now · last checked 2d ago`. Hovering lists each holder (`peer · online/offline · checked Xd ago (stale) · spot-checked`). When EVERY holder is older than the server's `staleDays`, the line says `(not checked recently)` and is styled dimmer — holders are **never hidden for age**. No holders → no line. - Settings gets a "Sharing (peer-to-peer)" group: **Share my saved videos** and **Get videos from other devices**, both ON by default, plus a status row (registered / online peer id, verified/saved counts). Pre-tested: `frontend/p2p-core.test.js` 5/5. ## Context the executor must NOT rediscover - `plans/patches/015-p2p-core-new.diff` creates `frontend/p2p-core.js` (`window.P2PCore`: `ago`, `formatAvailability(payload, now)`, `pickPeers(payload, cid)`) and its node test. - `frontend/index.html:223-227`: ```html