oficina / equipo Public

Chat on the iOS keyboard: composer stays on the keyboard; bar aligned

Safari pans the visual viewport down when the keyboard opens; the chat
was sized to it but left at the top, so the composer jumped there. The
chat's shell is now a fixed box at the visual viewport's top and
height, with the window and body kept unscrolled and the viewport meta
asking to resize content. The phone's chat bar centres the back link,
title and notebook button in one bar below the safe area. WebKit test
simulating Safari's keyboard, bar centre checks, before and after shots.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 06c02176bd6892fe9821dc749d569156a97d268d parent f2eac36
24 files changed, +273 −4
  • docs/mockups/built/2026-11-08/ios-keyboard-after-chat-closed.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-after-chat-dark-closed.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-after-chat-dark-open.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-after-chat-open.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-after-empty-closed.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-after-empty-open.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-after-task-closed.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-after-task-open.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-before-chat-closed.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-before-chat-dark-closed.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-before-chat-dark-open.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-before-chat-open.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-before-empty-closed.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-before-empty-open.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-before-task-closed.png binary
  • docs/mockups/built/2026-11-08/ios-keyboard-before-task-open.png binary
  • docs/superpowers/plans/UX1-PROGRESS.md +41 −0
  • internal/equipo/static/chat-stream.js +16 −3
  • internal/equipo/static/equipo.css +15 −0
  • internal/equipo/templates/layout.html +1 −1
  • internal/thintest/inner_browser_test.go +14 −0
  • internal/thintest/keyboard_webkit_test.go +93 −0
  • internal/thintest/testdata/keyboard.mjs +72 −0
  • scripts/runner-reference-allowlist.json +21 −0

CI failed — run details

diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-after-chat-closed.png b/docs/mockups/built/2026-11-08/ios-keyboard-after-chat-closed.png
new file mode 100644
index 00000000..5436fe9c
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-after-chat-closed.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-after-chat-dark-closed.png b/docs/mockups/built/2026-11-08/ios-keyboard-after-chat-dark-closed.png
new file mode 100644
index 00000000..99fb2fda
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-after-chat-dark-closed.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-after-chat-dark-open.png b/docs/mockups/built/2026-11-08/ios-keyboard-after-chat-dark-open.png
new file mode 100644
index 00000000..df22207d
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-after-chat-dark-open.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-after-chat-open.png b/docs/mockups/built/2026-11-08/ios-keyboard-after-chat-open.png
new file mode 100644
index 00000000..bc47d3ca
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-after-chat-open.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-after-empty-closed.png b/docs/mockups/built/2026-11-08/ios-keyboard-after-empty-closed.png
new file mode 100644
index 00000000..ab35f8e0
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-after-empty-closed.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-after-empty-open.png b/docs/mockups/built/2026-11-08/ios-keyboard-after-empty-open.png
new file mode 100644
index 00000000..f59e3bdb
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-after-empty-open.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-after-task-closed.png b/docs/mockups/built/2026-11-08/ios-keyboard-after-task-closed.png
new file mode 100644
index 00000000..bd4a1513
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-after-task-closed.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-after-task-open.png b/docs/mockups/built/2026-11-08/ios-keyboard-after-task-open.png
new file mode 100644
index 00000000..425a174d
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-after-task-open.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-before-chat-closed.png b/docs/mockups/built/2026-11-08/ios-keyboard-before-chat-closed.png
new file mode 100644
index 00000000..f4b44768
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-before-chat-closed.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-before-chat-dark-closed.png b/docs/mockups/built/2026-11-08/ios-keyboard-before-chat-dark-closed.png
new file mode 100644
index 00000000..2deade5d
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-before-chat-dark-closed.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-before-chat-dark-open.png b/docs/mockups/built/2026-11-08/ios-keyboard-before-chat-dark-open.png
new file mode 100644
index 00000000..51b34434
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-before-chat-dark-open.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-before-chat-open.png b/docs/mockups/built/2026-11-08/ios-keyboard-before-chat-open.png
new file mode 100644
index 00000000..3f7512d2
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-before-chat-open.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-before-empty-closed.png b/docs/mockups/built/2026-11-08/ios-keyboard-before-empty-closed.png
new file mode 100644
index 00000000..e3ea6b8d
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-before-empty-closed.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-before-empty-open.png b/docs/mockups/built/2026-11-08/ios-keyboard-before-empty-open.png
new file mode 100644
index 00000000..3f7512d2
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-before-empty-open.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-before-task-closed.png b/docs/mockups/built/2026-11-08/ios-keyboard-before-task-closed.png
new file mode 100644
index 00000000..ec372eda
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-before-task-closed.png differ
diff --git a/docs/mockups/built/2026-11-08/ios-keyboard-before-task-open.png b/docs/mockups/built/2026-11-08/ios-keyboard-before-task-open.png
new file mode 100644
index 00000000..425a174d
Binary files /dev/null and b/docs/mockups/built/2026-11-08/ios-keyboard-before-task-open.png differ
diff --git a/docs/superpowers/plans/UX1-PROGRESS.md b/docs/superpowers/plans/UX1-PROGRESS.md
index fb5f665b..ed2936b8 100644
--- a/docs/superpowers/plans/UX1-PROGRESS.md
+++ b/docs/superpowers/plans/UX1-PROGRESS.md
@@ -140,6 +140,47 @@ pass". Conventions as in `SLICE1-PROGRESS.md` to `SLICE4C-PROGRESS.md`.
- Browser: the source link lands on the highlighted message in view;
a relative time re-renders on the tick.
+8. iOS keyboard and the phone's chat bar (Paul, staging f2eac36, Safari
+ on an iPhone): tapping the composer threw it to the top of the screen
+ behind the status bar, with blank space down to the keyboard; the bar's
+ back link sat above the title and the notebook button.
+ - Cause: Safari keeps the layout viewport and pans the visual viewport
+ down by the keyboard's height; the chat was sized to the visual
+ viewport's height but left at the page's top, so only its bottom
+ (the composer) showed, at the top. With `overflow: hidden` on both
+ html and body the body is its own scroll container, so a box moved
+ down inside it is scrolled back by focus.
+ - Fix: the chat's shell is a fixed box at the visual viewport's top and
+ height (`chat-stream.js` sets `--equipo-vvtop` and `--equipo-vvh` on
+ its resize and scroll; the window and body are kept unscrolled; the
+ feed, never the window, keeps the newest message above the
+ composer). The viewport meta asks for
+ `interactive-widget=resizes-content`, so browsers that honour it
+ shrink the layout instead. With the keyboard open the composer drops
+ the safe-area padding; closed, it keeps it.
+ - Bar: one 3.5rem bar below `env(safe-area-inset-top)`; the back link
+ overlay, the title (left-aligned, as on the other pages) and the
+ button centre in it. The task and project pages' back bar respects
+ the safe area too.
+ - Tests: `TestWebKitKeyboard` (`-tags webkit`, Playwright's WebKit at
+ 390x844 through `testdata/keyboard.mjs`, the visual viewport driven
+ as Safari moves it: 450 high, panned 394): the composer's bottom on
+ the visual viewport's bottom (within 2 px), its top well below the
+ status bar, the newest message just above it, back at the bottom on
+ close; light, dark, the empty conversation, and the task thread's
+ composer staying in view. It failed on f2eac36 (composer bottom 450
+ against 844). `TestBrowserInnerScreens` at 390: the conversation
+ bar's three centres within 1 px, and the task and project back links
+ on their bar's centre (fails without the bar rules). Screenshots:
+ `docs/mockups/built/2026-11-08/ios-keyboard-{before,after}-*.png`.
+ - Needs `EQUIPO_PLAYWRIGHT_CORE` pointing at a playwright-core
+ directory with its WebKit (1.63 here); not in CI, like the other
+ browser tests. The dead-reference scan has exact allowances for the
+ script's three lines.
+ - Seen, not caused here: `TestConversationLayout` and
+ `TestTeamsHierarchyBrowser` (plan3test, browser tag) fail on f2eac36
+ too.
+
## Staging
Release c14b833 (built by `scripts/staging-thin.py build`, deployed with
diff --git a/internal/equipo/static/chat-stream.js b/internal/equipo/static/chat-stream.js
index 037a26d1..b76bf630 100644
--- a/internal/equipo/static/chat-stream.js
+++ b/internal/equipo/static/chat-stream.js
@@ -569,10 +569,23 @@
};
}
// The keyboard on a phone shrinks the visual viewport, not the layout
- // one: size the chat to what is visible and keep the newest item above
- // the composer while following. A growing composer re-pins too.
+ // one, and Safari pans the visual viewport down to the focused field.
+ // The chat follows both: sized to what is visible and placed where it
+ // is (--equipo-vvtop), with the window kept unscrolled, so the composer
+ // sits on the keyboard. The newest item stays above the composer by
+ // scrolling the feed, never the window. A growing composer re-pins too.
+ // (Browsers that honour interactive-widget=resizes-content shrink the
+ // layout viewport instead, and the offset stays 0.)
+ var chat = document.querySelector("[equipo-conversation]");
function fit() {
- if (window.visualViewport) document.documentElement.style.setProperty("--equipo-vvh", window.visualViewport.height + "px");
+ var vv = window.visualViewport, root = document.documentElement;
+ if (vv) {
+ if (chat && (window.scrollY || window.scrollX)) window.scrollTo(0, 0);
+ if (chat && document.body.scrollTop) document.body.scrollTop = 0;
+ root.style.setProperty("--equipo-vvh", vv.height + "px");
+ if (chat) root.style.setProperty("--equipo-vvtop", Math.max(0, vv.offsetTop + window.scrollY) + "px");
+ root.toggleAttribute("data-keyboard", vv.height < window.innerHeight - 120);
+ }
scroll();
}
if (window.visualViewport) {
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css
index 5b1c3b59..42c7583c 100644
--- a/internal/equipo/static/equipo.css
+++ b/internal/equipo/static/equipo.css
@@ -694,3 +694,18 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex
[equipo-message] { transition: background-color 1.2s ease, box-shadow 1.2s ease; border-radius: calc(2 * var(--rst-radius)); }
[equipo-message][data-highlight] { background-color: color-mix(in oklab, var(--rst-accent-soft) 70%, transparent); box-shadow: 0 0 0 .5rem color-mix(in oklab, var(--rst-accent-soft) 70%, transparent); transition: none; }
@media (prefers-reduced-motion: reduce) { [equipo-message] { transition: none; } }
+/* The chat on a phone keyboard: a fixed box exactly where the visual
+ viewport is (chat-stream.js sets --equipo-vvtop and --equipo-vvh), so
+ the composer sits on the keyboard and nothing in the page's flow can
+ overflow or scroll; no safe-area gap above the keyboard. */
+[rst-shell-sidebar]:has([equipo-conversation]) { position: fixed; inset-inline: 0; inset-block-start: var(--equipo-vvtop, 0px); block-size: var(--equipo-vvh, 100dvh); }
+:root[data-keyboard] [equipo-conversation] #chat-composer { padding-block-end: var(--rst-sp-3); }
+/* The phone's chat bar: the back link, the title and the notebook button
+ on one centre line in a bar of one height, below the safe area. */
+@media (max-width: 799px) {
+ [rst-shell-sidebar~="page"] > [rst-shell-back] { padding-block-start: env(safe-area-inset-top, 0px); }
+ [rst-shell-sidebar]:has([equipo-conversation]) > [rst-shell-back] { inset-block-start: env(safe-area-inset-top, 0px); padding-block-start: 0; display: flex; align-items: center; block-size: 3.5rem; min-block-size: 3.5rem; }
+ [rst-shell-sidebar]:has([equipo-conversation]) > [rst-shell-back] > a { min-block-size: 0; block-size: 100%; line-height: 1.25; }
+ [equipo-chat-header] { block-size: auto; min-block-size: calc(3.5rem + env(safe-area-inset-top, 0px)); padding-block: env(safe-area-inset-top, 0px) 0; }
+ [equipo-chat-header] h1 { line-height: 1.25; }
+}
diff --git a/internal/equipo/templates/layout.html b/internal/equipo/templates/layout.html
index e4d8b1d9..8dcfe5fd 100644
--- a/internal/equipo/templates/layout.html
+++ b/internal/equipo/templates/layout.html
@@ -3,7 +3,7 @@
<html lang="{{block "lang" .}}en{{end}}" dir="{{block "dir" .}}ltr{{end}}">
<head>
<meta charset="utf-8">
-<meta name="viewport" content="width=device-width">
+<meta name="viewport" content="width=device-width, interactive-widget=resizes-content">
<title>{{block "title" .}}{{copy "brand"}}{{end}}</title>
<link rel="stylesheet" href="{{asset "static/tokens.css"}}">
<link rel="stylesheet" href="{{asset "static/theme.css"}}">
diff --git a/internal/thintest/inner_browser_test.go b/internal/thintest/inner_browser_test.go
index f94cb677..8a62dc7e 100644
--- a/internal/thintest/inner_browser_test.go
+++ b/internal/thintest/inner_browser_test.go
@@ -251,6 +251,20 @@ func TestBrowserInnerScreens(t *testing.T) {
p.check(`(()=>{const b=document.querySelector('[data-decision="`+g.unchecked+`"] [data-merge-choice="merge"]').getBoundingClientRect();return b.width>0 && b.height>=`+map[bool]string{true: "44", false: "30"}[size.touch]+`})()`, "Merge out of reach")
p.fits("needs")
+ if size.touch {
+ // The phone's bars: on the conversation the back link, the title
+ // and the notebook button share one centre line (Paul, f2eac36);
+ // on the task and project pages the back link sits on its bar's
+ // centre.
+ mid := `(e=>{const r=e.getBoundingClientRect();return (r.top+r.bottom)/2})`
+ p.open("/conversation")
+ p.check(`(()=>{const m=`+mid+`;const a=m(document.querySelector('[rst-shell-back] > a')),h=m(document.querySelector('[equipo-chat-header] h1')),b=m(document.querySelector('[equipo-chat-header] [equipo-header-button]'));return Math.abs(a-h)<=1 && Math.abs(h-b)<=1})()`, "conversation bar not on one centre line")
+ for _, path := range []string{"/tasks/" + g.unchecked, "/projects/" + a.conv.Tasks[g.unchecked].ProjectID} {
+ p.open(path)
+ p.check(`(()=>{const m=`+mid+`;const bar=document.querySelector('[rst-shell-back]'),l=bar.querySelector('a');const pad=parseFloat(getComputedStyle(bar).paddingTop);const r=bar.getBoundingClientRect();return Math.abs(m(l)-(r.top+pad+r.bottom)/2)<=1})()`, path+" back link off its bar's centre")
+ }
+ }
+
// Relative times keep current on their own (the minute tick).
p.check(`(()=>{const e=document.querySelector('[equipo-ago][data-at]');e.dataset.at=String(Date.now()-5*60000-1000);window.equipoAges();return e.textContent==='5 min ago'})()`, "relative time did not tick")
diff --git a/internal/thintest/keyboard_webkit_test.go b/internal/thintest/keyboard_webkit_test.go
new file mode 100644
index 00000000..c95c4558
--- /dev/null
+++ b/internal/thintest/keyboard_webkit_test.go
@@ -0,0 +1,93 @@
+//go:build webkit
+
+package thintest
+
+import (
+ "encoding/json"
+ "math"
+ "os"
+ "os/exec"
+ "testing"
+)
+
+type keyboardSpot struct {
+ VVTop, VVBottom, ScrollY float64
+ ComposerTop, ComposerBottom *float64
+ LastTop, LastBottom *float64
+}
+
+// TestWebKitKeyboard: Paul, staging f2eac36, Safari on an iPhone: the
+// composer jumped to the top of the screen when the keyboard opened. In
+// WebKit at 390x844 with the keyboard simulated as Safari does it (the
+// visual viewport shrinks to 450 and pans down; the layout viewport
+// stays), the chat's composer sits on the keyboard (its bottom on the
+// visual viewport's), well below the status bar, the newest message just
+// above it, and back at the bottom when the keyboard closes. The empty
+// conversation and the task thread's composer too. Needs
+// EQUIPO_PLAYWRIGHT_CORE (a playwright-core directory with its WebKit).
+func TestWebKitKeyboard(t *testing.T) {
+ core := os.Getenv("EQUIPO_PLAYWRIGHT_CORE")
+ if core == "" {
+ t.Skip("EQUIPO_PLAYWRIGHT_CORE is not set")
+ }
+ g := newGallery(t)
+ owner, member := g.a.inst.Cookie(), g.a.memberCookie()
+ type pageCfg struct {
+ Name string `json:"name"`
+ Path string `json:"path"`
+ Selector string `json:"selector"`
+ Scheme string `json:"scheme"`
+ Cookie map[string]string `json:"cookie"`
+ ScrollToComposer bool `json:"scrollToComposer"`
+ }
+ ck := func(name, value string) map[string]string { return map[string]string{"name": name, "value": value} }
+ pages := []pageCfg{
+ {Name: "chat", Path: "/conversation", Selector: "#chat-composer", Cookie: ck(owner.Name, owner.Value)},
+ {Name: "chat-dark", Path: "/conversation", Selector: "#chat-composer", Scheme: "dark", Cookie: ck(owner.Name, owner.Value)},
+ {Name: "empty", Path: "/conversation", Selector: "#chat-composer", Cookie: ck(member.Name, member.Value)},
+ {Name: "task", Path: "/tasks/" + g.unchecked, Selector: "#chat-composer", Cookie: ck(owner.Name, owner.Value), ScrollToComposer: true},
+ }
+ when := os.Getenv("EQUIPO_KEYBOARD_WHEN")
+ if when == "" {
+ when = "after"
+ }
+ raw, _ := json.Marshal(map[string]any{"base": g.a.inst.URL, "pages": pages, "art": os.Getenv("EQUIPO_BROWSER_ARTIFACTS"), "when": when})
+ cmd := exec.Command("node", "testdata/keyboard.mjs")
+ cmd.Env = append(os.Environ(), "EQUIPO_KEYBOARD="+string(raw))
+ cmd.Stderr = os.Stderr
+ got, err := cmd.Output()
+ if err != nil {
+ t.Fatalf("webkit: %v", err)
+ }
+ var res map[string]map[string]keyboardSpot
+ if err := json.Unmarshal(got, &res); err != nil {
+ t.Fatalf("webkit output %q: %v", got, err)
+ }
+ near := func(a, b float64) bool { return math.Abs(a-b) <= 2 }
+ for _, name := range []string{"chat", "chat-dark", "empty"} {
+ for _, state := range []string{"closed", "open", "reclosed"} {
+ s := res[name][state]
+ if s.ComposerBottom == nil {
+ t.Fatalf("%s %s: no composer", name, state)
+ }
+ if !near(*s.ComposerBottom, s.VVBottom) {
+ t.Fatalf("%s %s: composer bottom %.1f, visual viewport bottom %.1f (%+v)", name, state, *s.ComposerBottom, s.VVBottom, s)
+ }
+ // Below the status bar: well into the visible area, never at its top.
+ if *s.ComposerTop < s.VVTop+200 {
+ t.Fatalf("%s %s: composer top %.1f at the top of the visible area from %.1f", name, state, *s.ComposerTop, s.VVTop)
+ }
+ if name != "empty" && s.LastBottom != nil && (*s.LastBottom > *s.ComposerTop+1 || *s.LastBottom < *s.ComposerTop-160 || *s.LastBottom < s.VVTop) {
+ t.Fatalf("%s %s: newest message %.1f..%.1f not just above the composer at %.1f", name, state, *s.LastTop, *s.LastBottom, *s.ComposerTop)
+ }
+ }
+ }
+ // The task thread's composer is in the page's flow: with Safari's pan it
+ // stays where the focused field is, inside the visible area.
+ for _, state := range []string{"closed", "open"} {
+ s := res["task"][state]
+ if s.ComposerBottom == nil || *s.ComposerBottom > s.VVBottom+2 || *s.ComposerTop < s.VVTop-2 {
+ t.Fatalf("task %s: composer %v..%v outside %.1f..%.1f", state, s.ComposerTop, s.ComposerBottom, s.VVTop, s.VVBottom)
+ }
+ }
+}
diff --git a/internal/thintest/testdata/keyboard.mjs b/internal/thintest/testdata/keyboard.mjs
new file mode 100644
index 00000000..9e68e0ca
--- /dev/null
+++ b/internal/thintest/testdata/keyboard.mjs
@@ -0,0 +1,72 @@
+// The iOS keyboard, in WebKit: a 390x844 phone whose visual viewport
+// shrinks to 450 and pans down 394 when the keyboard opens, as Safari's
+// does (the layout viewport stays 844). The page's own visualViewport is
+// replaced by one the test drives. Prints one JSON object of measurements.
+import { createRequire } from "node:module";
+const require = createRequire(import.meta.url);
+const { webkit } = require(process.env.EQUIPO_PLAYWRIGHT_CORE);
+const cfg = JSON.parse(process.env.EQUIPO_KEYBOARD);
+
+const fake = `(() => {
+ const t = new EventTarget();
+ let h = 844, top = 0;
+ const vv = {
+ get height() { return h; }, get width() { return innerWidth; },
+ get offsetTop() { return top; }, get offsetLeft() { return 0; },
+ get pageTop() { return top + scrollY; }, get pageLeft() { return scrollX; }, get scale() { return 1; },
+ addEventListener: t.addEventListener.bind(t), removeEventListener: t.removeEventListener.bind(t), dispatchEvent: t.dispatchEvent.bind(t),
+ };
+ Object.defineProperty(window, "visualViewport", { configurable: true, get() { return vv; } });
+ window.__vv = { set(nh, ntop) { h = nh; top = ntop; t.dispatchEvent(new Event("resize")); t.dispatchEvent(new Event("scroll")); } };
+})();`;
+
+function measure(selector) {
+ const vv = window.visualViewport, c = document.querySelector(selector);
+ const r = c ? c.getBoundingClientRect() : null;
+ const msgs = [...document.querySelectorAll("[equipo-feed] > [data-message], [equipo-feed] > li[equipo-message]")].filter(e => e.getBoundingClientRect().height > 0);
+ const last = msgs.length ? msgs[msgs.length - 1].getBoundingClientRect() : null;
+ return { vvTop: vv.offsetTop + scrollY, vvBottom: vv.offsetTop + scrollY + vv.height, scrollY,
+ composerTop: r ? r.top + scrollY : null, composerBottom: r ? r.bottom + scrollY : null,
+ lastTop: last ? last.top + scrollY : null, lastBottom: last ? last.bottom + scrollY : null };
+}
+
+const out = {};
+const browser = await webkit.launch();
+try {
+ for (const p of cfg.pages) {
+ const ctx = await browser.newContext({ viewport: { width: 390, height: 844 }, deviceScaleFactor: 2, hasTouch: true, isMobile: true, colorScheme: p.scheme || "light" });
+ await ctx.addCookies([{ name: p.cookie.name, value: p.cookie.value, url: cfg.base }]);
+ await ctx.addInitScript(fake);
+ const page = await ctx.newPage();
+ await page.goto(cfg.base + p.path);
+ await page.waitForLoadState("load");
+ await page.waitForTimeout(400);
+ if (p.scrollToComposer) await page.evaluate(s => { const c = document.querySelector(s); window.scrollTo(0, c.getBoundingClientRect().bottom + scrollY - innerHeight); }, p.selector);
+ await page.evaluate(() => window.__vv.set(844, 0));
+ await page.waitForTimeout(200);
+ const res = { closed: await page.evaluate(measure, p.selector) };
+ if (cfg.art) await page.screenshot({ path: `${cfg.art}/ios-keyboard-${cfg.when}-${p.name}-closed.png` });
+ await page.focus(p.selector + " textarea");
+ // Safari pans the visual viewport so the focused field shows above
+ // the keyboard: on the chat, by the keyboard's height.
+ const pan = await page.evaluate(s => {
+ const c = document.querySelector(s).getBoundingClientRect();
+ return Math.max(0, Math.min(c.bottom + 0 - 450, document.documentElement.scrollHeight - scrollY - 450));
+ }, p.selector);
+ await page.evaluate(top => window.__vv.set(450, top), p.pan === undefined ? pan : p.pan);
+ await page.waitForTimeout(400);
+ res.open = await page.evaluate(measure, p.selector);
+ if (cfg.art) {
+ const vv = res.open;
+ await page.screenshot({ path: `${cfg.art}/ios-keyboard-${cfg.when}-${p.name}-open.png`, clip: { x: 0, y: vv.vvTop - vv.scrollY, width: 390, height: 450 } });
+ }
+ await page.evaluate(() => { document.activeElement && document.activeElement.blur(); window.__vv.set(844, 0); });
+ await page.waitForTimeout(400);
+ res.reclosed = await page.evaluate(measure, p.selector);
+ out[p.name] = res;
+ await ctx.close();
+ }
+} finally {
+ await browser.close();
+}
+console.log(JSON.stringify(out));
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json
index 137b718b..6e0dd04e 100644
--- a/scripts/runner-reference-allowlist.json
+++ b/scripts/runner-reference-allowlist.json
@@ -10533,5 +10533,26 @@
"match": "node",
"count": 1,
"reason": "Design mockup markup: track and timeline nodes are DOM elements, not Node.js."
+ },
+ {
+ "path": "internal/thintest/keyboard_webkit_test.go",
+ "line_sha256": "949eb8e6d3989632798021615c6b9d5b32229694e87735fa0e54f4d4ce7944f2",
+ "match": ".mjs",
+ "count": 1,
+ "reason": "WebKit keyboard test only: Playwright's WebKit is driven from a test script, never part of the runner or a release."
+ },
+ {
+ "path": "internal/thintest/keyboard_webkit_test.go",
+ "line_sha256": "949eb8e6d3989632798021615c6b9d5b32229694e87735fa0e54f4d4ce7944f2",
+ "match": "node",
+ "count": 1,
+ "reason": "WebKit keyboard test only: Playwright's WebKit is driven from a test script, never part of the runner or a release."
+ },
+ {
+ "path": "internal/thintest/testdata/keyboard.mjs",
+ "line_sha256": "db1eb2fe86d7c7b6fe41643bf42ea97453ec740d5d62e7867d6e33b9a25aa2f0",
+ "match": "node",
+ "count": 1,
+ "reason": "WebKit keyboard test only: Playwright's WebKit is driven from a test script, never part of the runner or a release."
}
]