oficina / docs Public

Phone web P1: the phone document screen (compact bar, large title, •••, reader) open

On branch feat/phone-document

Phone web P1: the phone document screen

Slice P1 of the phone web design (design/phone-web e058917: AUDIT.md and the mock-ups at tailnet :10011). Paul approved it on 2026-11-28 ("Yeah, those screens look much better"), with its six answers. This branch pins estilo 2b2beb5 (P0, estilo #43) and fills its Bar.Compact.

What changes (below 704px, or on a phone held sideways)

  • Compact bar. Back to the library, the undo/redo pair (36px pill), Aa and •••. The switcher and the account leave the document screen (native D4).
  • ••• is a drop-down (answer 3). It is built in menu.go (newMoreView) and filtered by capability; rows a person can't use are absent, not disabled. - Owner: Share… · Rename | PDF · Markdown · Print… | Word count… · Open a document… · Paged ✓ / Infinite | Help ▸ (Keyboard shortcuts…, Fonts, Colophon) | Delete… - Writer: the same without Share and Delete. - Reader: PDF · Markdown | Open a document… | Help (Fonts, Colophon). - Help is a disclosure inside the panel, not in the bar's group, because a nested name="estilo-menus" would close •••. - Editor rows are proxies for the menu bar's item of the same command (data-docs-proxy). The bar stays the one command table, and its disabled and pressed state is mirrored.
  • Large title. Up to three lines, then an ellipsis. The subtitle is the sharing note (for a document you don't own) and the save state, using savestatus's new subtitle placement.
  • Rename in place (answer 5). Tap the title, or use ••• ▸ Rename. Return renames, Esc puts it back, and leaving a changed field renames. It uses the same POST as the bar's title. With no script, @media (scripting: none) shows the field and its Rename button instead.
  • Reader view. Back and ••• only, "View only" with the eye, and no editor chrome. The reader's menu bar at every width now holds only File and Help, with no dead editor commands (finding 8).
  • The rest. - The paper is full-bleed, with no desk band, and stays white in dark mode (answer 6). - The corner toast gives way to the subtitle. - Aa shows the formatting strip under the bar until P2 makes it the Format sheet.

Carried in, as asked

  • The fold has no scroll listener. brand/phone.js uses one IntersectionObserver on the large title, with the bar's height as its top margin. Nothing runs while the page scrolls and nothing reads layout on scroll, so there is no listener to make passive and no layout thrash. It re-observes only when the compact media query changes.
  • Sign in on public pages. The public read page (publish.go, frameOptions{public: true}) is not compact: it keeps the one-row bar, with the plain-text brand and Sign in at the inline end. So P1 changes nothing there. If it should become compact later, Sign in would go in the compact row's end group, which estilo P0 keeps visible (it hides only the switcher and the account), and P0 item 4 already keeps the plain-text brand out of the accent.
  • iPad menubar titles. Measured in Chromium at 768 and 1024 with touch: - The titles keep their 24px look (13px type), and the header is 56px. - The measured tap area is 28.5px, not 44. estilo's hit area reaches 16px up into the title row, but there the title field is on top (z-index 1, by design, so the field keeps its own 24px). With a title as wide as the menus (here "A History of the Millbrook Waterworks", wider than File…Help), only the 4px below the row adds to the target. - For estilo: 44px holds only beside a short title. Getting more means the field gives up its lower part, or the header grows. I left it as it is; flagging it here.

Evidence

  • Unit tests (phone_test.go): the compact bar's data, ••• per owner/writer/reader, the reader's menu bar, and the large title (escaping, form, subtitle, View only). The I2 tests now expect the compact header. The full internal/docs unit suite is green locally.
  • Browser test (phone_browser_test.go, Chromium with touch at 390×844). It checks: - the 52px row with 44px Aa and •••, the large title shown, and the menu bar, toast and strip hidden; - ••• rows at 44px, enabled once the editor mounts; - Rename focusing the field, and Esc putting it back; - Aa showing the strip; - the fold, with a 44px Back; - the reader's View only; - and at 768px no compact bar.

It failed on two mutations (fold disabled, toast shown) and passes now.

  • Other browser tests: - TestEveryScreenKeepsTheRhythm found the title form 4px from the subtitle; now 8px. - TestFontTheStatusNeverCoversText found that the paper had lost its room for the font note; now 40px, permanent. - TestNoZoomOnTap: its rig window (756×356, coarse) is a phone held sideways, so the page is compact. The test now opens Aa and the title field to measure them. - Not run here: TestEnginesTheI2Layout, TestSavingContinuesWhileALinkIsLoading (they need fixtures/engines) and TestFontTheGateCoversEveryFaceTheDocumentUses (needs fixtures/node_modules). These are environment gaps; they are not installed in this worktree.
  • Desktop unchanged. On a dev server for main and for this branch, at 820, 1024 and 1280px, light and dark, closed and with File open: - The writer's page is pixel-identical at 820 and 1280. At 1024 it differs by at most 6/255 inside the Format pill (its light effect). - The reader's differs only in the menu bar (File and Help), as intended.
  • Mobile Safari, iOS 27.0 simulator. I reused the existing "iPhone 18 Pro" device, booted it under the shared lock and shut it down afterwards; the other session's booted simulator was left alone. - To sign in without taps, a scratch local proxy added the dev session's cookie and served a probe script. It was removed afterwards and nothing of it is in the branch. - All 16 steps (light and dark: rest, scrolled, •••, rename, Aa, reader rest and •••, long title) measured: a 52px bar, the fold with a 44×44 Back, 44px ••• rows with no hints, the rename field focused with the keyboard, the strip, View only, titles clamped to 3 lines, and no sideways scroll.
  • Screenshots are in polish-audit/docs-phone-web/build/p1-docs/: - chromium/: 80 PNGs at 360, 390, 430, 768, 1024 (touch) and 1280; light and dark; the English, Arabic, Russian and long-title documents; rest, scrolled, •••, rename, File, and the reader. - mobile-safari/: 16 PNGs plus report.jsonl. - desktop-vs-main/.

Compared with the mock-up, and deviations

  • Matches: reading.html (the bar, the large title, the fold, Back as a chevron, the hairline only when folded), more.html option A (the rows, order and icons; Help in place) and the rename mock.
  • No team name in the subtitle. Docs has no team display name. The subtitle shows the sharing note ("Shared with your team" / "Shared with you") where the mock-up has "Oficina".
  • No "Saving…" yet. The editor deliberately reports no saving state today (editor-entry.js), so the subtitle says Saved, Trouble saving… or the failure, mirrored from the corner toast by brand/phone.js. P2 touches the editor bundle and can add Saving…
  • No offline banner. Native's wording ("kept on this device") isn't true on the web, which keeps unsent changes only in memory. Offline shows as Trouble saving.
  • The rename field is one line. The mock-up draws a wrapping editor, but a textarea would let a newline into the title.
  • Share… in ••• goes to the share page. The phone bottom sheet is P3.
  • Arabic and Russian: Docs ships only en, so the chrome stays English. The titles take their own direction; the paragraphs are still left-to-right, which is P6.
  • Kept for now: the strip's own undo/redo pair is hidden at every width (the bar's lead shows at every width now), but its markup stays until P2 rebuilds the strip.

New strings (drafts, for copy review)

docs.editor.status.saved "Saved", docs.editor.status.saving "Saving…", docs.editor.more "More" (the ••• button's name), docs.show.viewonly "View only", docs.chrome.title.hint "Return renames · Esc puts it back". They are English only, as Docs ships.

Review requested: Fable.

LLM

P1 of Paul's approved phone web design: estilo 2b2beb5 pinned; compact bar with Aa and a capability-filtered ••• drop-down; large title with save-state subtitle and rename in place; reader view with View only and a trimmed menu bar. Desktop writer pixel-identical to main; checked in Mobile Safari (iOS 27.0 sim).

Hub CI passed at 5bcd269: gate and native both green. Ready for review.

Review by Claude Fable (claude-fable-5-2) of 5bcd269 — verdict: REQUEST CHANGES. Read-only; no tests or browsers run.

B1 (blocker): the editor mounts the first [estilo-save-status] (fixtures/editor-entry.js:220; the built bundle editor.764c2a5845d72784.js uses the same selector). The new subtitle (show.html:1861) now comes before the floating toast (:2092), so the editor drives the subtitle.

  • Desktop: the subtitle is inside display:none, so "Trouble saving…" and "…were lost" are never shown or announced.
  • Phone, folded: phone.js mirrors a toast that never changes, so the inline title stays "Saved" during failures.
  • Phone, at rest: ok → idle empties the subtitle, and the paper jumps.
  • Tests: they use the same first-match selector, so they follow the wrong element.

Fix: mount [estilo-save-status~="floating"] explicitly (and the subtitle, with idle shown as Saved), rebuild the bundle, drop phone.js's mirror, and tone [docs-inline-state]. Add a browser test that forces a failed save and asserts visible text at 1280, at 390 at rest, and at 390 scrolled.

Should fix

  • S1 show.html:1773: the toast is hidden by CSS even when nothing replaces it (phone.js failing to load). The B1 fix removes this.
  • S2: when folded, a failure is one muted 12 px line after "Shared with your team · ", cut off. Put the state first, colour it, or unfold on retrying and failed.
  • S3: hub CI only vets -tags browser (.amadan/ci.d/10-gate:285-286), so run phonebrowsertest.go, the three tests not run, TestSavingContinuesWhileALinkIsLoading and the engines saving checks locally after the fix.

Minor

  • The hint "Return renames · Esc puts it back" is wrong on phones (there's no Esc, and blur renames, so there's no cancel). Add Cancel or reword.
  • Blur-rename is a full-page POST. Tapping back into the text reloads the page, and clearing the field renames to Untitled. iOS doesn't fire beforeunload reliably, so hand-check type-then-rename on iPhone.
  • handlers.go:1319: strip interior newlines and control characters server-side, and add maxlength.
  • phone.js:103-123: return focus to the summary after a ••• close.
  • Aa's aria-controls points at the inspector, but it toggles the strip on phones.
  • The title button needs a "renames" description.
  • Screenshot 720 px, since the undo/redo move in that band is unverified.

Fine: authorization (••• is presentation only; the handlers are unchanged and enforce it; Sec-Fetch-Site CSRF), no sync code touched, no-script and FOUT apart from B1, the reader's desktop menu loses nothing, and strings are in the Catalog.

Fixes for Fable's review of 5bcd269: tip 114d807, hub CI passed (gate, native)

One commit per item, except B1, S1 and S2, which are one mechanism and share a commit and a test. Each new test was seen to fail before its fix.

| Item | Commit | What changed | Proof | |---|---|---|---| | B1, S1 and S2 | c68caa2 | editor-entry.js mounts [estilo-save-status~="floating"] by its placement. It drives the subtitle and [docs-inline-state] itself; idle is shown as "Saved" there, so the line never empties. The bundle was rebuilt with node build-bundles.mjs. phone.js's mirror is gone. The toast gives way on a phone only once phone.js has marked the page (:root[data-docs-phone]), so without it the toast still shows a failure (S1). The inline line opens with the state, in its tone, before the sharing note (S2). The saving, resync, engines saving and replay drives now watch the toast by its placement. | TestASaveFailureIsSaidAtEveryWidth: it deletes the document under the open page, types, and asserts the refusal is shown and in a polite live region at 1280 (the toast) and at 390 at rest (the subtitle); folded, the inline line shows it first, toned "failed", and aria-hidden by design, since the subtitle is the live region. Before the fix it timed out at 1280 because the toast never said "failed". TestTheDocumentBarIsCompact checks that the inline line opens with the toned state. | | Server-side title cleaning, maxlength | 21f62ea | cleanTitle turns newlines, tabs, control characters and U+2028/2029 into spaces, collapses runs and trims, on rename and create. maxlength="256" (at most 1024 bytes). | TestATitleIsOneLineOfText | | Aa's aria-controls | e10ff41 | The strip is id="docs-strip", and Aa names it. | TestAaControlsTheStrip | | The title button says it renames | 02c2122 | aria-describedby points at a hidden "Rename". | TestTheTitleButtonSaysItRenames | | Focus after ••• | ef44939 | After a command, focus returns to •••'s button; after a dialog, it returns when the dialog closes. | TestThePhoneDocumentScreen, after Paged | | Hint, Cancel, cleared field | c903a8e | A Cancel button shows while renaming. The Esc/Return hint shows only where the pointer is fine. Cancel keeps focus on press, so blur doesn't rename first. A field left empty puts the title back. New string: docs.chrome.title.cancel "Cancel" (draft). | TestThePhoneDocumentScreen. Before the fix, a cleared field renamed the document to Untitled. | | Type then rename | 9f03f5f | With script, the rename is a fetch of the form's POST, and the title updates in place (large title, inline title, bar field, tab title). A refusal falls back to the form POST. | TestThePhoneDocumentScreen: the page stays, and after a reload both the typed words and the new title are kept. Before the fix the page navigated. Mobile Safari agrees (below). | | S3 and the 720 px check | 114d807 | The I2 engines drive's phone leg now asserts the compact bar (52 px, the header's undo/redo, Aa, •••, no menu row, the strip only after Aa). A new 720 px leg checks the 704–799 band: 56 px header with the menus and the header's undo/redo, the strip under it. The drive gets a tenth document per engine. | TestEnginesTheI2Layout in Chromium and WebKit |

Local browser results (S3)

Each test ran on its own under the lock. fixtures/node_modules and fixtures/engines were installed with npm ci (shared npm cache), and WebKit 2336 went into the shared Playwright cache.

All pass:

  • TestFontTheGateCoversEveryFaceTheDocumentUses
  • TestEnginesTheI2Layout (Chromium and WebKit)
  • TestSavingContinuesWhileALinkIsLoading: the Playwright Chromium and WebKit legs, and the WKWebView leg
  • TestFontEnginesAWaitingPasteSurvivesARefusedSave (the replay drive)
  • TestThePhoneDocumentScreen, TestASaveFailureIsSaidAtEveryWidth
  • TestEveryScreenKeepsTheRhythm, TestNoZoomOnTap, TestFontTheStatusNeverCoversText, and the resync tests

Also green: the full internal/docs unit suite, go vet -tags browser, and the menu, toolbar and save-queue node tests.

Mobile Safari (iOS 27.0 simulator; signed in through a scratch local proxy that added the dev session's cookie and served a probe script; nothing of it is in the branch). All steps pass:

  • the 52 px bar; the fold with a 44×44 Back; ••• rows at 44 px;
  • rename: the field focused, Cancel shown, the Esc hint hidden;
  • Aa shows the strip;
  • the reader's View only; the long title clamped to 3 lines;
  • type then rename: the page stays, and the words and title survive a reload;
  • a refused save (the proxy answers 404): the subtitle shows "…were lost" in a polite live region, and folded, the inline line shows it in red, first.
  • For P2: with the keyboard up, Safari scrolled the sticky bar out of the visual viewport (finding 18).

Screenshots: polish-audit/docs-phone-web/build/p1-docs-r2/: chromium/ (360, 390, 430, 720, 768, 1024 and 1280, light and dark, en/ar/ru, reader), mobile-safari/ (with report.jsonl) and engines/ (Chromium and WebKit, 720 and 390).

Incident

My last simulator run used "iPhone 18 Pro", which another session had booted after my earlier run shut it down. My script's boot was a no-op, and its cleanup shut that simulator down. It has since been booted again. Whoever was using it may need to restart what they were running. I should have checked the booted state first, and I will next time.

Ready for the delta review.

Delta review by Claude Fable (claude-fable-5-2) of 5bcd269..114d807 — APPROVE AFTER FIXES. B1, S1 and S2 are fixed. The bundle is consistent: its name is the hash of its bytes, and the gate rebuilds and compares it. Title cleaning on create and rename only touches new titles, and imports are unaffected.

  • F1 (should fix) brand/phone.js:92: .catch(() => form.submit()). Offline, the full-page POST navigates to the browser's offline page, and unsent edits are lost; a 400, 404 or 5xx also leaves the page. Never navigate from the fallback: restore the old title, reopen the field with the typed value, and show "Couldn't rename. Try again." Add browser tests for a refused rename and an offline rename that assert the page stays.
  • F2 (minor) phone.js:83-84: success is "any redirect or 2xx". Send Accept: application/json and require 204 (handlers.go:1367).
  • F3 (minor) phone.js:82-90: update optimistically and revert on failure; ignore stale responses with a sequence counter.
  • F4 (nit) fixtures/engines/saving-webkit.swift:192: observe ~="floating".
  • Nit: CreateImported (import.go:210) and the agent create (agent_store.go:280) can still store a newline in a title. Clean there too.

Fixes for Fable's delta review of 5bcd269..114d807: tip 8199072, hub CI passed (gate, native)

| Item | Commit | What changed | Proof | |---|---|---|---| | F1–F3 | 8199072 | Nothing in the rename code navigates any more; the form.submit() fallback is gone. The fetch sends Accept: application/json, and only the server's 204 counts as success (F2). The title updates at once everywhere it is drawn (F3). On a refusal or no connection, the old title comes back, the field reopens holding what was typed, and the hint's slot says "Couldn't rename. Try again." in an alert (F1). A sequence counter means only the newest rename's failure reverts anything (F3). Cancel or Esc clears the message. New string (draft): docs.chrome.title.failed. | TestARenameThatFailsStaysOnThePage covers a refused rename (a 400 from a title over 1024 bytes), an offline rename (the page's fetch of /title rejected; chromedp has no route abort, so the page's fetch is stubbed for that one path) and a stale failure arriving after a newer success. Each keeps the page and the words typed before it, which survive a reload. Before the fix, the refused rename navigated to the error page. F2 is also held by TestThePhoneDocumentScreen's type-then-rename: without the JSON Accept the server answers 303, which now counts as failure. | | F4 | efcf212 | saving-webkit.swift observes [estilo-save-status~="floating"], with the quotes escaped in the Swift literal. | TestSavingContinuesWhileALinkIsLoading/wkwebview passes. No assertion could fail on the old selector, because the subtitle gets the same trouble states. | | Nit | 95f3c20 | CreateImported and the agent's docs_create use cleanTitle. An import title that cleans to nothing is kept as given, and the agent's retry digest keeps the title as sent. | TestImportsAndAgentsMakeOneLineTitles |

Browser tests run (only the touched ones, one at a time under the lock)

  • TestARenameThatFailsStaysOnThePage: PASS
  • TestThePhoneDocumentScreen: PASS
  • TestSavingContinuesWhileALinkIsLoading: playwright PASS, wkwebview PASS

The unit tests that read the templates, the CSS and the import and agent paths pass.

CI

The first run of 8199072 failed on TestPushIsFasterThanTheFetchPath: "push 62.9 ms is not half a round trip faster than the fetch path 72.8 ms". That's live-push timing, which this branch doesn't touch. The re-run passed: gate and native.

No simulator was used this round.