oficina / docs Public

Phone Format sheet: Fable's follow-ups A–E from #181 open review pending

On branch fix/phone-format-followups

Phone Format sheet: Fable's follow-ups A–E from #181

The follow-ups from Fable's delta review of P2 on #181. Branch fix/phone-format-followups from main 1d03856: six commits, one per item, with E split into its two behaviour nits. Each test was seen to fail before its fix.

| Item | Commit | What changed | Proof | |---|---|---|---| | A (resync) | af93afa | keptPositions also records the kept words, the anchor block's words, and the offsets in each block. The Yjs relative positions are still tried first. The old absolute positions are used only where the same words sit in a block that reads the same; otherwise the block with the same words nearest the old place is used; otherwise the sheet closes (docs:format-sheet-close to phone.js), and the keyboard isn't brought back. The selection is set with TextSelection.between (from nit E). | TestAResyncAfterACollaboratorsChange: a collaborator's change is landed server-side before the 413, while the page's live ?since= fetch is held, so only the rebuild brings it in. With remote-before.bin (a line above), the selection is kept over "Second paragraph."; before the fix it was drawn over "irst line.". With a new remote-edit-second.bin (words written into the selection), the sheet closes; before the fix it drew over "Edited: Second pa". The P2 test TestAResyncKeepsTheSelectionDrawn still passes. | | B (menu) | 033f9d6 | mountMenu takes refocus, as createToolbar does, and editor-entry passes () => !formatSheet.open. | menu.test.mjs: a command refocuses with no refocus given or a true one, and not with a false one. It failed before. | | C (width key) | f8be2dd | The tallest-height baseline is keyed on documentElement.clientWidth. The comment now lists the edges: a turn of the phone or a resized iPad window starts over; a page loaded with the keyboard already up shows the strip only once the keyboard has been down at that width; toolbars that hide on scroll stay under 150 px. | TestWhenTheKeyboardIsUp now zooms in while a keyboard has shrunk the layout viewport, with innerWidth reporting the visual viewport's 195 px, as Mobile Safari long did. The strip stays; before the fix it went. | | D (tap) | 8a59e17 | When the sheet closes because of a tap (the editor already has focus), the kept selection goes 50 ms later, after ProseMirror has read the tap, and the document isn't refocused. Before, the old selection was written back over the tap. | TestATapInTheDocumentClosesTheSheet taps just after "First": the caret is collapsed there (offset 5). Before the fix, "Second paragraph." was still selected. iOS (real taps): with the sheet open, a tap at (180, 254) put the caret on that line, offset 80, at x 209, the edge of the tapped word (iOS snaps a tap to a word boundary). The sheet closed, the keyboard came up with the capsule, and nothing kept was drawn. | | E (dialog Esc) | 3bbc00d | Escape from inside a dialog, or while one is open, is left to the dialog. | TestEscapeInADialogLeavesTheSheet: a modal over the sheet, then Escape: the dialog closes and the sheet stays. Before the fix, both closed. | | E (VoiceOver) | 74d0aac | A click counts as a tap only if a pointer went down on that Aa within the last 1.5 s. Any other click (Enter or Space, or an assistive technology's click, whatever its detail) takes focus to the sheet's title. | TestAaActivatedWithoutAPointer: a click with detail: 1 and no pointer takes focus into the sheet (it failed before); a tap does not. Not checked by hand: VoiceOver doesn't run in the iOS Simulator. If iOS VoiceOver's double-tap reaches the page as touches, it counts as a tap and focus stays on Aa, which is no worse than before. | | E (TextSelection.between) | in af93afa | keepAgain was the only TextSelection.create; placeCaretFromPage already uses Selection.near. | |

Runs

  • All under the lock, one at a time: every touched browser test (the sheet, format, phone screen, pinch-zoom, keyboard, resync, carry, remote edit, bold, pickers, composition, forced colours, dialog, activation, zoom, rhythm and rename tests), the full internal/docs unit suite, and go vet -tags browser.
  • The toolbar, toolbar-roving and menu node tests.
  • All green. The bundle is fresh (editor.fe1db7ee4d4551b0.js).

iOS: the D check ran with real taps on the "Kass UI iOS" simulator. I booted it myself and shut down only that device; the other session's iPhone 18 Pro was left alone. Evidence: polish-audit/docs-phone-web/build/p2-followups/mobile-safari/.

Hub CI passed at 74d0aac on the first run: gate and native. Nothing is deployed.