oficina / docs Public

Phone web P3: Share as a bottom sheet (with estilo #44 touch switches) open review pending

On branch feat/phone-share

Phone web P3: Share as a bottom sheet

Slice P3 of the phone web design (design/phone-web e058917, share.html), approved by Paul on 11-28. Branch feat/phone-share from main 1d03856: one commit, 867b6dd. It pins estilo df0b632 (feat/touch-switch, estilo #44: touch switches at 51×31). Once that lands, the pin needs moving to the landed commit.

What changes (below 36rem)

The panel is still the server's (?panel=1). Only its phone-only parts are new, and they aren't drawn from 36rem up.

  • The sheet is a modal bottom sheet. It is 66% of the screen, and becomes large (the full height less the top safe area) while the once-only link shows. It has a grabber, then "Share" over the document's title, then ×, which is 32 px with a 44 px target.
  • Inviting: - The address field is 46 px. - The role is a two-segment control (Can read, Can edit). Its radios are role-choice; share-pop.js keeps the select the form posts in step with them. - Invite is 46 px.
  • People: each person's access is a 36 px pill, replacing the text and the 20 px ×. Its menu has Can read, Can edit and Remove. Each is a real form posting to /share or /share/revoke with panel=1; Grant already upserts a role, so there's no server change. The current access is marked with a check (aria-current). Esc closes an open menu before the sheet.
  • General access: 56 px rows. The switches are 51×31 from the estilo pin.
  • Typing an address: the sheet sits on the keyboard. It is placed from visualViewport's top, as the format bar's capsule is (Mobile Safari's innerHeight can read short), and shows only its head and the invite.
  • Closing: - A swipe down on the head (on the lift) closes it, and so does a tap outside. - While the once-only link shows, only × and Esc close it, so the link can't be lost by accident (spec §3). - Focus returns to ••• (P1's details[docs-more]).
  • No script: the share page cuts a long address with an ellipsis, and the address is its title (finding 15).

Found in Mobile Safari, fixed, and now in the Chromium test

With the keyboard up, a tap on a role segment or on Invite blurred the field. The keyboard dropped and the sheet re-laid out between the press and the click, so the click landed elsewhere: the role stayed Can read, and an invite never went. Now a press there keeps the caret in the field (mousedown preventDefault, as the format bar does). After an invite, focus moves to the new person's pill, so the keyboard goes and the list shows them. The sheet leaves typing mode before that focus, or the pill isn't drawn.

Evidence

  • Unit tests: - TestTheSharePanelOnAPhone: the grabber, the narrow heading, the radiogroup, and the pill with its three forms in order, the current access marked. - TestTheSharePageCutsALongAddress. - TestTheSharePageIsBuiltFromTheDesignSystem, updated for the title. - The full internal/docs suite and go vet -tags browser pass.
  • Browser test TestTheShareSheetOnAPhone (Chromium, touch, 390×844, scripted keyboard) checks: - the sheet two thirds tall at the foot, full width, with its grabber; - the field, Invite and segments at 46 px, the pill at 36 px, and 51×31 switches; - the segments setting the posted role; - a pill's Can edit redrawing with focus back on that pill; - typing: the sheet on the keyboard, with the list hidden; - a segment while typing keeping the field focused; - Invite while typing listing the person with focus on their pill; - Esc closing with focus on •••.

TestTheShareSheetKeepsTheOnceOnlyLink checks that a swipe closes the sheet, and that once the link is published the sheet is large, a swipe and a tap outside don't close it, and × does, with focus on •••. Both tests failed against the old code (a top sheet, 30 px field, 34×19 switches). The two in-typing steps were each seen to fail before their fix.

  • TestEnginesSharePopover (Chromium and WebKit) was failing on main. Its phone leg opened Share from estilo's Menu sheet, which P1 took off the document page. It now goes through •••, checks the bottom sheet's place, 46 px controls and 51×31 switches, and Esc to •••. It passes in both engines.
  • Also run: TestThePhoneDocumentScreen, TestNoZoomOnTap, TestEveryScreenKeepsTheRhythm and TestTheFormatSheetAndTheQuickBar. All pass.
  • Desktop at 1280: fresh seeded servers for main and this branch, light and dark: the page, the Share popover with two people (one a long address), and the share page. Pixel-identical, 6 of 6. At 768 and 1024 with touch the popover is unchanged apart from the larger switches (estilo).
  • Mobile Safari (iOS 27.0 simulator, real taps through XCUITest). I booted "Kass UI iOS" myself and shut down only that device; the other session's iPhone 18 Pro was left alone. - ••• → Share… opens the sheet. The address field takes focus, so the real keyboard comes up, and the sheet's foot sits on the visual viewport's (411 of 714). - Can edit keeps the keyboard and sets the role. - Invite adds nia@lagged.ie as Can edit, with the keyboard down and focus on her pill. - Reader's pill → Can read redraws. - A swipe closes the sheet with focus on •••.
  • Screenshots in polish-audit/docs-phone-web/build/p3-docs/: - chromium/: 360, 390 and 430, light and dark, the English, Arabic and Russian documents; the sheet, a pill's menu, typing, and the once-only link; the popover at 768 and 1024; the no-script page at 390; probes.json, with no sideways scroll at any width. - mobile-safari/. - desktop-vs-main/.

Compared with the mockup, and open points

  • Focus on open goes to the address field, as the popover's always has. On an iPhone that raises the keyboard at once, so the sheet opens in typing mode and the list shows once the keyboard goes. The mockup's note asks for the field with VoiceOver off and the heading with it on. VoiceOver can't be detected from a page, and I didn't change the existing focus. Question for Paul: should the field be focused on phones at all?
  • Safari's floating bottom toolbar sits over the sheet's lowest rows. They scroll into reach, but the sheet's bottom padding doesn't include Safari's chrome without viewport-fit=cover. That's a chrome-wide (estilo) question; the format sheet (P2) has it too.
  • No new scrim colour: the existing ::backdrop.
  • Arabic and Russian: the chrome stays English (Docs ships en); RTL is P6.
  • New strings (drafts, for copy review): docs.share.panel.access_for "Access for {address}: {access}" (the pill's accessible name) and docs.share.panel.remove_short "Remove". The sheet's "Share" reuses docs.share.title.

Hub CI passed at 867b6dd (gate and native). Nothing is deployed.

Review requested: Fable.

Review by Claude Fable (claude-fable-5-2) of 867b6dd — APPROVE AFTER FIXES. Authorization: no findings. The pill posts to the same owner-only share/share/revoke handlers (with an ownerMutation re-check); grantees get 404; re-invite is an upsert on (doc_id, subject); the owner can't be granted or downgraded; homeCSRF covers it.

Fix before merge:

  • F1 (medium) share-pop.js:331, :284: swipe or outside-tap during the publish round trip closes the sheet, and the once-only link is then drawn into the closed dialog and lost. Refuse dismiss while busy, or re-show if the link arrives while closed.
  • F2 (medium) share-pop.js:152-168: after Remove, focus falls to the email field, which raises the keyboard and hides the list. Focus the next or previous pill, or the heading.
  • F3 (medium) share_sheet_browser_test.go ~170: the "tap outside while link" check taps inside the head. Tap above the sheet's top and add the positive case.

Low:

  • F4: any redraw while the link shows loses it (pre-existing). Carry the shown link across the redraw.
  • F5: scroll the link into view after the redraw.
  • F6 :306-308: scope the mousedown preventDefault to when the email field is focused.
  • F7: Remove's name should contain "Remove" (Voice Control).
  • F8: make the sheet head sticky.

Missing tests: F1, F2, and writer→reader for one address leaving one row. Re-pin to landed estilo c43430e (#44).

Ruling (coordinator, Fable concurs): below 36rem, focus the heading on open, not the email field; a tap on the field raises the keyboard. Desktop is unchanged.