diff --git a/context/code/clients.md b/context/code/clients.md index 50fff94a..96080d7c 100644 --- a/context/code/clients.md +++ b/context/code/clients.md @@ -1644,6 +1644,97 @@ client resolves nothing under them. `BrowserKey` drops anything held with the platform meta key precisely so `Cmd-R` does not arrive as a bare `r`; the page does not claim it either. +### The deployment notice, and the one thing this page remembers + +`#backend-notice` is a `
`. The collapsing is therefore the **browser's** +— keyboard operable, and correct with `app.js` absent, still loading, or thrown +— and the only thing the page adds is remembering the answer. That split is the +whole design: a static notice is what it was, and a notice whose open state is +decided in JavaScript would be a fourth thing that can be wrong on a page whose +job is not to be wrong about its own peer. + +**It starts collapsed for a visitor who has never answered**, and the argument +is that collapsing withholds nothing. The one fact a first-time visitor needs — +the document lives in this tab, is saved to this browser's private storage, and +never leaves the machine — is the ``, which never collapses. What is +behind the disclosure is `?doc=`, `?seed=`, `?ws=`, the `wss://` default and the +reverse proxy a plain-`ws://` server needs: *configuration reference*, looked up +rather than read, and irrelevant until a visitor has decided they want a second +document or a shared one. Expanded, it cost about 230px of an 820px window and +pushed the tile bar, the category tree and the grid below the fold on every +visit. The page is an application; it should open as one. + +**The state is read through `shell.js` and stored in `app.js`**, on the usual +split: what a stored value *means* is a decision and is `noticeOpen`, while +touching `localStorage` is a browser API and stays in the page. `localStorage` +**throws** in a private window and in a context with site data blocked, and +returns `null` having simply forgotten, so every access is wrapped and there are +exactly two recognised spellings. Everything else — absent, empty, a value an +older page wrote — is *unanswered*, which is the default rather than a third +state: a page that treated forgetting as its own case would have to decide what +to do about it, and there is nothing to decide. + +What is stored is per-viewer and per-origin by construction. It never reaches +Rust, never crosses to a peer, and is not state the application has any opinion +about — which is exactly the class browser storage is for, and exactly why it is +not a `ViewState` field (gotcha 30). + +**The page's own keydown listener must not claim the summary's keys.** `Enter` +is claimed by the client (it is forwarded upstream), and the listener calls +`preventDefault()` on anything claimed — so without an explicit guard the +disclosure would open by pointer and be dead by keyboard, which is the whole +reason for using `
` rather than a `