docs(chat): record task 3 in progress and re-lock the starter-home scroll guard on the hook
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JUei7K13cYxLHE3Axe4A45
This commit is contained in:
@@ -206,15 +206,15 @@ test("removes the user-facing admin button from the chat page", () => {
|
||||
});
|
||||
|
||||
test("keeps the empty starter home at the top instead of auto-scrolling", () => {
|
||||
const autoScrollEffect = sourceBetween(
|
||||
pageSource,
|
||||
"useEffect(() => {\n if (starterHomeVisible) return;",
|
||||
"profileComplete, starterHomeVisible]);",
|
||||
);
|
||||
|
||||
assert.match(autoScrollEffect, /if \(starterHomeVisible\) return/);
|
||||
assert.match(autoScrollEffect, /const container = conversation\.current/);
|
||||
assert.match(autoScrollEffect, /container\.scrollTo\(\{ top: container\.scrollHeight/);
|
||||
// Former lock: a page-level effect starting `if (starterHomeVisible) return;` that called
|
||||
// `container.scrollTo`. The follow now lives in useConversationScrollAnchor (BUG-478); the page
|
||||
// switches it off for the starter home through the hook's `active` argument instead.
|
||||
assert.match(pageSource, /useConversationScrollAnchor\(\n\s*conversation,\n\s*!rectificationSurfaceOpen && !starterHomeVisible,/);
|
||||
const anchorSource = readFileSync(new URL("../src/hooks/use-conversation-scroll-anchor.ts", import.meta.url), "utf8");
|
||||
const followEffect = anchorSource.slice(anchorSource.indexOf("// Follow: while anchored"));
|
||||
assert.match(followEffect, /if \(!active \|\| !element\) return;/);
|
||||
assert.ok(followEffect.indexOf("if (!active || !element) return;") < followEffect.indexOf("element.scrollTop = element.scrollHeight"));
|
||||
assert.doesNotMatch(pageSource, /container\.scrollTo\(/);
|
||||
assert.match(pageSource, /ref=\{conversation\} className=\{`conversation/);
|
||||
assert.doesNotMatch(pageSource, /conversationEnd|scrollIntoView/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user