From 01253d8a239057c1defe02fd256997b90d377cf6 Mon Sep 17 00:00:00 2001 From: Cato <41178744+catomean@users.noreply.github.com> Date: Sun, 1 Nov 2026 21:09:02 +0100 Subject: [PATCH] fix(scroll): back at the bottom by hand, the jump button goes; chips answer the question (0.22.1) (#62) * fix(scroll): back at the bottom by hand, the jump button goes (0.22.1) A finger rocks back a pixel or two as it lifts; that last touchmove read as scrolling up and paused following at the bottom, so the jump button stayed over the reply chips with nowhere to jump to (OrangeCat's Diplodoctor chat on Android, 2026-11-01). A touch that ends at the very bottom, or a downward scroll that arrives there, resumes following. Browser test on ChatScreen at 390px with real touch: fails on 0.22.0, passes now; a real tap on the button still lands at the latest message. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019MDtms1H9g9uu7AdDgJzLQ * feat(replies): when an answer ends on a question, the chips answer it Under four questions about a sore finger, Diplodoctor's chips were "I have more info" and "Consult a doctor": a tap answered nothing. On its live model, 2 of 9 chip sets answered the question; 7 of 9 with this sentence. In REPLIES_INSTRUCTION, every fleet chat gets it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019MDtms1H9g9uu7AdDgJzLQ --------- Co-authored-by: Claude --- CHANGELOG.md | 7 ++++ dist/react/hooks.d.ts.map | 2 +- dist/react/hooks.js | 18 +++++++++- dist/react/hooks.js.map | 2 +- dist/replies.js | 2 +- dist/replies.js.map | 2 +- dist/scroll.d.ts | 11 ++++++ dist/scroll.d.ts.map | 2 +- dist/scroll.js | 9 +++++ dist/scroll.js.map | 2 +- package.json | 2 +- src/react/hooks.ts | 16 ++++++++- src/replies.ts | 2 +- src/scroll.ts | 14 ++++++++ test/browser-scroll.mjs | 71 +++++++++++++++++++++++++++++++++++++++ test/replies.test.js | 6 ++++ 16 files changed, 158 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d36034..efbdf16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.22.1 — Back at the bottom by hand, the jump button goes; chips answer the question + +- `REPLIES_INSTRUCTION`: when an answer ends on a question to the person, the replies are short answers to it, never the question repeated and not next steps. Found 2026-11-01 on Diplodoctor's live model: under four questions about a sore finger, the chips were "I have more info" and "Consult a doctor", and a tap answered nothing (2 of 9 chip sets were answers; 7 of 9 with this sentence added). + +- A finger rocks back a pixel or two as it lifts. `useStickToBottom` read that last touchmove as "scrolling up" and paused following, so a reader who scrolled back down to the latest message by hand was left with the jump button sitting over the reply chips, and a tap on it did nothing: there was nowhere to jump to. Found 2026-11-01 in OrangeCat's Diplodoctor chat on Android. Where the gesture ends now decides: a touch that lifts at the very bottom (`isAtBottom`, 16px — far tighter than the follow threshold, so a deliberate small scroll up still pauses), or any downward scroll that arrives there (a fling running on after the finger lifted), is following again. +- Checked in `test/browser-scroll.mjs` on `ChatScreen` at 390px with real touch input: read up, come back down by hand with a 2px lift-off wobble, the button is gone; read up again, a TAP (not a scripted click) on the button lands at the latest message. The test fails on 0.22.0. + ## 0.22.0 — The microphone listens until you press done, in every product - With a server leg (`transcribe` or `transcribeUrl`) and no `prefer`, a press of the microphone now records until the person presses done, and the server transcribes. It used to start on the browser's recogniser, which on Android ends the take at the first pause whatever `continuous` says. Found 2026-11-01 in OrangeCat's bot chats: the composer there passed no `prefer`, so a person speaking to Causius was cut off after one or two seconds, while the Cat's composer (`prefer: "server"`) in the same app listened to the end. The same microphone now works the same way wherever it has a server leg. `prefer: "browser"` keeps the old order for an app that wants it; with no server leg nothing changes. diff --git a/dist/react/hooks.d.ts.map b/dist/react/hooks.d.ts.map index 9a17bba..9009b18 100644 --- a/dist/react/hooks.d.ts.map +++ b/dist/react/hooks.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/react/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,SAAO;;iBAUhC,MAAM;EAYhB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM;;;;;;;EA8KrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,OAAO,UAAO,QAqBvF;AAED;;;;;;;;gFAQgF;AAChF,wBAAgB,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,SAAM,QAqB/F"} \ No newline at end of file +{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/react/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,SAAO;;iBAUhC,MAAM;EAYhB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM;;;;;;;EA4LrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,OAAO,UAAO,QAqBvF;AAED;;;;;;;;gFAQgF;AAChF,wBAAgB,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,SAAM,QAqB/F"} \ No newline at end of file diff --git a/dist/react/hooks.js b/dist/react/hooks.js index 995a4fb..fc3e9f6 100644 --- a/dist/react/hooks.js +++ b/dist/react/hooks.js @@ -1,6 +1,6 @@ "use client"; import { useCallback, useEffect, useLayoutEffect, useRef, useState, } from "react"; -import { isFollowing } from "../scroll.js"; +import { isAtBottom, isFollowing } from "../scroll.js"; /** * Copy + a checkmark that resets. Failures are swallowed on purpose (insecure * origin, denied permission): the text stays selectable, so a failed copy @@ -60,6 +60,11 @@ export function useStickToBottom(changes, grew) { else if (top > previousTop.current + 1 && (downwardIntent.current || draggingScrollbar.current)) follow(isFollowing(el)); + // Arriving at the very bottom by any downward scroll (a fling that runs + // on after the finger lifted, a scroll anchored by the browser) is being + // back at the latest message, whatever the last touch event said. + else if (top > previousTop.current + 1 && isAtBottom(el)) + follow(true); previousTop.current = top; }, [follow]); const pin = useCallback((smooth = false) => { @@ -128,6 +133,15 @@ export function useStickToBottom(changes, grew) { const touchStart = (event) => { touchY = event.touches[0]?.clientY; }; + // A finger rocks back a pixel or two as it lifts. That last touchmove + // reads as "scrolling up" and paused following at the bottom, leaving + // the jump button on screen with nowhere to jump to (OrangeCat on + // Android, 2026-11-01). Where the gesture ENDS decides: at the very + // bottom, the reader is following again. + const touchEnd = (event) => { + if (event.touches.length === 0 && isAtBottom(selected)) + follow(true); + }; const touchMove = (event) => { const y = event.touches[0]?.clientY; if (y !== undefined && touchY !== undefined) { @@ -168,6 +182,8 @@ export function useStickToBottom(changes, grew) { ["wheel", wheel], ["touchstart", touchStart], ["touchmove", touchMove], + ["touchend", touchEnd], + ["touchcancel", touchEnd], ["keydown", key], ]; for (const [name, listener] of events) diff --git a/dist/react/hooks.js.map b/dist/react/hooks.js.map index 6f99bcb..40f7fc5 100644 --- a/dist/react/hooks.js.map +++ b/dist/react/hooks.js.map @@ -1 +1 @@ -{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/react/hooks.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EACL,WAAW,EACX,SAAS,EACT,eAAe,EACf,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,OAAO,GAAG,IAA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,EAAE;YACvC,IAAI,EAAE,CAAC,WAAW,KAAK,KAAK;gBAAE,OAAO;YACrC,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC;YACvB,GAAG,EAAE,CAAC;QACR,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrB,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IACrC,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/dist/replies.js b/dist/replies.js index 0ac09c5..ebfc6b0 100644 --- a/dist/replies.js +++ b/dist/replies.js @@ -31,7 +31,7 @@ export const REPLIES_INSTRUCTION = [ "```" + REPLIES_FENCE, '["Yes, do it", "Show me first", "Not now"]', "```", - "Rules: write them in the person's language, in their voice (what THEY would say, not what you would). Each under 40 characters. Each must make sense sent on its own. Never repeat what they already said. Put the block last, after everything else. Do not write any heading or label before it (no Quick replies, Follow-up questions or the like, in any language): the replies are drawn as buttons. Leave it out only when the conversation is over (a goodbye, a thanks with nothing left to do).", + 'Rules: write them in the person\'s language, in their voice (what THEY would say, not what you would). Each under 40 characters. Each must make sense sent on its own. Never repeat what they already said. When your answer ends on a question to them, the replies are short answers to that question ("About two weeks", "After a fall"), never your own question repeated and not next steps. Put the block last, after everything else. Do not write any heading or label before it (no Quick replies, Follow-up questions or the like, in any language): the replies are drawn as buttons. Leave it out only when the conversation is over (a goodbye, a thanks with nothing left to do).', ].join("\n"); const COMPLETE = new RegExp("\\n?```" + REPLIES_FENCE + "\\s*([\\s\\S]*?)```", "i"); // A complete JSON array of short strings as the answer's last paragraph, with diff --git a/dist/replies.js.map b/dist/replies.js.map index 750adc3..0fb6a9a 100644 --- a/dist/replies.js.map +++ b/dist/replies.js.map @@ -1 +1 @@ -{"version":3,"file":"replies.js","sourceRoot":"","sources":["../src/replies.ts"],"names":[],"mappings":"AAAA;;;;;;;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I,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QAC9C,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC;QAChF,CAAC;IACH,CAAC;IACD,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,yEAAyE;IACzE,4CAA4C;IAC5C,IAAI,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK,EAAE,CAAC;QACrC,OAAO,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC1E,CAAC;IACD,IAAI,OAAO,CAAC,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACpE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,CAAC"} \ No newline at end of file diff --git a/dist/scroll.d.ts b/dist/scroll.d.ts index 6d7f541..e58c60a 100644 --- a/dist/scroll.d.ts +++ b/dist/scroll.d.ts @@ -10,4 +10,15 @@ export declare function isFollowing(el: { scrollTop: number; clientHeight: number; }, threshold?: number): boolean; +/** + * Close enough to the bottom that nothing is left to jump to: a finger's + * lift-off wobble, sub-pixel rounding. Far tighter than the follow threshold, + * so a deliberate small scroll up still pauses following. + */ +export declare const AT_BOTTOM_PX = 16; +export declare function isAtBottom(el: { + scrollHeight: number; + scrollTop: number; + clientHeight: number; +}, slack?: number): boolean; //# sourceMappingURL=scroll.d.ts.map \ No newline at end of file diff --git a/dist/scroll.d.ts.map b/dist/scroll.d.ts.map index bf88dcd..1f7f60d 100644 --- a/dist/scroll.d.ts.map +++ b/dist/scroll.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../src/scroll.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,wBAAgB,WAAW,CACzB,EAAE,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,EACrE,SAAS,SAAsB,GAC9B,OAAO,CAET"} \ No newline at end of file +{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../src/scroll.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,wBAAgB,WAAW,CACzB,EAAE,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,EACrE,SAAS,SAAsB,GAC9B,OAAO,CAET;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B,wBAAgB,UAAU,CACxB,EAAE,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,EACrE,KAAK,SAAe,GACnB,OAAO,CAET"} \ No newline at end of file diff --git a/dist/scroll.js b/dist/scroll.js index cd096fd..7cb41fc 100644 --- a/dist/scroll.js +++ b/dist/scroll.js @@ -8,4 +8,13 @@ export const FOLLOW_THRESHOLD_PX = 120; export function isFollowing(el, threshold = FOLLOW_THRESHOLD_PX) { return el.scrollHeight - el.scrollTop - el.clientHeight < threshold; } +/** + * Close enough to the bottom that nothing is left to jump to: a finger's + * lift-off wobble, sub-pixel rounding. Far tighter than the follow threshold, + * so a deliberate small scroll up still pauses following. + */ +export const AT_BOTTOM_PX = 16; +export function isAtBottom(el, slack = AT_BOTTOM_PX) { + return el.scrollHeight - el.scrollTop - el.clientHeight <= slack; +} //# sourceMappingURL=scroll.js.map \ No newline at end of file diff --git a/dist/scroll.js.map b/dist/scroll.js.map index 3378c31..154dd40 100644 --- a/dist/scroll.js.map +++ b/dist/scroll.js.map @@ -1 +1 @@ -{"version":3,"file":"scroll.js","sourceRoot":"","sources":["../src/scroll.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC,MAAM,UAAU,WAAW,CACzB,EAAqE,EACrE,SAAS,GAAG,mBAAmB;IAE/B,OAAO,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC,YAAY,GAAG,SAAS,CAAC;AACtE,CAAC"} \ No newline at end of file +{"version":3,"file":"scroll.js","sourceRoot":"","sources":["../src/scroll.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC,MAAM,UAAU,WAAW,CACzB,EAAqE,EACrE,SAAS,GAAG,mBAAmB;IAE/B,OAAO,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC,YAAY,GAAG,SAAS,CAAC;AACtE,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAE/B,MAAM,UAAU,UAAU,CACxB,EAAqE,EACrE,KAAK,GAAG,YAAY;IAEpB,OAAO,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC,YAAY,IAAI,KAAK,CAAC;AACnE,CAAC"} \ No newline at end of file diff --git a/package.json b/package.json index 58ca500..3670db4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bitbaum/chatkit", - "version": "0.22.0", + "version": "0.22.1", "description": "One chat for every product: a composer with a microphone that always works, a thread that does not fight the reader, messages with copy and retry, and LLM markdown — the fleet's chat standard as a package.", "license": "MIT", "author": "Cato", diff --git a/src/react/hooks.ts b/src/react/hooks.ts index 707944e..a12cd53 100644 --- a/src/react/hooks.ts +++ b/src/react/hooks.ts @@ -9,7 +9,7 @@ import { type DependencyList, type RefObject, } from "react"; -import { isFollowing } from "../scroll.js"; +import { isAtBottom, isFollowing } from "../scroll.js"; /** * Copy + a checkmark that resets. Failures are swallowed on purpose (insecure @@ -75,6 +75,10 @@ export function useStickToBottom(changes: DependencyList, grew: number) { (downwardIntent.current || draggingScrollbar.current) ) follow(isFollowing(el)); + // Arriving at the very bottom by any downward scroll (a fling that runs + // on after the finger lifted, a scroll anchored by the browser) is being + // back at the latest message, whatever the last touch event said. + else if (top > previousTop.current + 1 && isAtBottom(el)) follow(true); previousTop.current = top; }, [follow]); const pin = useCallback((smooth = false) => { @@ -145,6 +149,14 @@ export function useStickToBottom(changes: DependencyList, grew: number) { const touchStart = (event: Event) => { touchY = (event as TouchEvent).touches[0]?.clientY; }; + // A finger rocks back a pixel or two as it lifts. That last touchmove + // reads as "scrolling up" and paused following at the bottom, leaving + // the jump button on screen with nowhere to jump to (OrangeCat on + // Android, 2026-11-01). Where the gesture ENDS decides: at the very + // bottom, the reader is following again. + const touchEnd = (event: Event) => { + if ((event as TouchEvent).touches.length === 0 && isAtBottom(selected)) follow(true); + }; const touchMove = (event: Event) => { const y = (event as TouchEvent).touches[0]?.clientY; if (y !== undefined && touchY !== undefined) { @@ -182,6 +194,8 @@ export function useStickToBottom(changes: DependencyList, grew: number) { ["wheel", wheel], ["touchstart", touchStart], ["touchmove", touchMove], + ["touchend", touchEnd], + ["touchcancel", touchEnd], ["keydown", key], ]; for (const [name, listener] of events) diff --git a/src/replies.ts b/src/replies.ts index e621895..84f817e 100644 --- a/src/replies.ts +++ b/src/replies.ts @@ -47,7 +47,7 @@ export const REPLIES_INSTRUCTION = [ "```" + REPLIES_FENCE, '["Yes, do it", "Show me first", "Not now"]', "```", - "Rules: write them in the person's language, in their voice (what THEY would say, not what you would). Each under 40 characters. Each must make sense sent on its own. Never repeat what they already said. Put the block last, after everything else. Do not write any heading or label before it (no Quick replies, Follow-up questions or the like, in any language): the replies are drawn as buttons. Leave it out only when the conversation is over (a goodbye, a thanks with nothing left to do).", + 'Rules: write them in the person\'s language, in their voice (what THEY would say, not what you would). Each under 40 characters. Each must make sense sent on its own. Never repeat what they already said. When your answer ends on a question to them, the replies are short answers to that question ("About two weeks", "After a fall"), never your own question repeated and not next steps. Put the block last, after everything else. Do not write any heading or label before it (no Quick replies, Follow-up questions or the like, in any language): the replies are drawn as buttons. Leave it out only when the conversation is over (a goodbye, a thanks with nothing left to do).', ].join("\n"); const COMPLETE = new RegExp("\\n?```" + REPLIES_FENCE + "\\s*([\\s\\S]*?)```", "i"); diff --git a/src/scroll.ts b/src/scroll.ts index 61a33b7..b2df5f9 100644 --- a/src/scroll.ts +++ b/src/scroll.ts @@ -12,3 +12,17 @@ export function isFollowing( ): boolean { return el.scrollHeight - el.scrollTop - el.clientHeight < threshold; } + +/** + * Close enough to the bottom that nothing is left to jump to: a finger's + * lift-off wobble, sub-pixel rounding. Far tighter than the follow threshold, + * so a deliberate small scroll up still pauses following. + */ +export const AT_BOTTOM_PX = 16; + +export function isAtBottom( + el: { scrollHeight: number; scrollTop: number; clientHeight: number }, + slack = AT_BOTTOM_PX, +): boolean { + return el.scrollHeight - el.scrollTop - el.clientHeight <= slack; +} diff --git a/test/browser-scroll.mjs b/test/browser-scroll.mjs index 9f19932..455dcac 100644 --- a/test/browser-scroll.mjs +++ b/test/browser-scroll.mjs @@ -140,6 +140,77 @@ try { ); } + // ChatScreen on a phone, driven by a finger (OrangeCat's Diplodoctor chat, + // 2026-11-01). Read up, come back down by hand: a finger rocks back a + // pixel or two as it lifts, and that last move used to read as "scrolling + // up", so the jump button stayed on screen at the bottom with nowhere to + // go. Then the button itself, TAPPED, not clicked from script. + { + const page = await browser.newPage({ + viewport: { width: 390, height: 780 }, + hasTouch: true, + isMobile: true, + }); + const errors = []; + page.on("pageerror", (e) => errors.push(e.message)); + await page.goto(`http://localhost:${server.address().port}/demo/screen.html`); + await page.waitForSelector(".ck-screen .ck-thread"); + await page.waitForTimeout(400); + const state = () => + page.evaluate(() => { + const t = document.querySelector(".ck-screen .ck-thread"); + return { + gap: Math.round(t.scrollHeight - t.scrollTop - t.clientHeight), + jump: !!document.querySelector(".ck-screen .ck-jump"), + }; + }); + const cdp = await page.context().newCDPSession(page); + const swipe = async (from, to, wobble = 0) => { + await cdp.send("Input.dispatchTouchEvent", { + type: "touchStart", + touchPoints: [{ x: 120, y: from }], + }); + const step = from < to ? 30 : -30; + let y; + for (y = from + step; step > 0 ? y <= to : y >= to; y += step) { + await cdp.send("Input.dispatchTouchEvent", { + type: "touchMove", + touchPoints: [{ x: 120, y }], + }); + await page.waitForTimeout(16); + } + if (wobble) + await cdp.send("Input.dispatchTouchEvent", { + type: "touchMove", + touchPoints: [{ x: 120, y: y - step + wobble }], + }); + await cdp.send("Input.dispatchTouchEvent", { type: "touchEnd", touchPoints: [] }); + await page.waitForTimeout(500); + }; + await swipe(200, 560); + await swipe(200, 560); + const up = await state(); + assert.ok(up.gap > 300 && up.jump, `screen: reading up shows the jump button (${up.gap})`); + for (let i = 0; i < 12 && (await state()).gap > 0; i++) await swipe(500, 150, 2); + const down = await state(); + assert.ok(down.gap <= 16, `screen: a hand scroll reaches the bottom (${down.gap})`); + assert.ok(!down.jump, "screen: back at the bottom by hand, the jump button is gone"); + await swipe(200, 560); + const box = await page.locator(".ck-screen .ck-jump").boundingBox(); + assert.ok(box, "screen: reading up again shows the jump button"); + await page.touchscreen.tap(box.x + box.width / 2, box.y + box.height / 2); + await page.waitForTimeout(900); + const tapped = await state(); + assert.ok( + tapped.gap <= 2 && !tapped.jump, + `screen: a tap on it lands at the latest message (${tapped.gap})`, + ); + await cdp.detach(); + assert.deepEqual(errors, [], "screen: no browser errors"); + await page.close(); + console.log("PASS screen 390: hand scroll back down hides the jump button; a tap on it jumps"); + } + // Reproduce DOM implementations where document.scrollingElement is absent. // Start with a real thread scroll owner, then remove its scrollability so // the hook must safely replace a stale owner with no document fallback. diff --git a/test/replies.test.js b/test/replies.test.js index d7c2020..7e4ab04 100644 --- a/test/replies.test.js +++ b/test/replies.test.js @@ -131,6 +131,12 @@ test("replies: the instruction forbids a heading over the replies", () => { test("replies: the instruction makes the model lead — every answer, best reply first", () => { assert.match(REPLIES_INSTRUCTION, /End every answer/); assert.match(REPLIES_INSTRUCTION, /FIRST/); + // A question asked is answered by the chips (Diplodoctor, 2026-11-01: + // "I have more info" under four questions answered none of them). + assert.match( + REPLIES_INSTRUCTION, + /ends on a question to them, the replies are short answers to that question/, + ); }); test("replies: the instruction teaches the same fence the parser reads", () => {