feat(ui): add WebChat auto-scroll mode selector#81629
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: not applicable. as a feature PR rather than a broken-contract bug. Source inspection confirms current main has only the implicit near-bottom policy and no Real behavior proof Next step before merge Security Review detailsBest possible solution: Review and land the PR if CI and maintainer UX review agree with adding a persisted WebChat auto-scroll preference; keep the default Do we have a high-confidence way to reproduce the issue? Not applicable as a feature PR rather than a broken-contract bug. Source inspection confirms current main has only the implicit near-bottom policy and no Is this the best way to solve the issue? Yes, the proposed direction is a coherent implementation path: a closed enum setting is normalized through storage, exposed in the existing chat controls, and used at the scroll scheduling boundary. The remaining decision is product/UX approval and normal validation, not a narrow repair. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 78eb92e62277. |
Summary
chatAutoScrollsetting withnear-bottomas the default and newalways/offmodes.scrollToBottomand New messages behavior.Fixes #7648
Fixes #81287
Refs #72957
Refs #81291
Triage
chatAutoScrollsetting and still used the implicit hard-coded near-bottom policy.gitcrawlstore did not contain [Feature]: WebChat — add a "disable autoscroll during streaming" toggle (current 450px threshold is implicit and unconfigurable) #81287 and had no embedding neighbors; liveghsearches were used for duplicate/related issue and PR evidence.prtagswas installed and authenticated, but the backend returned 502 during duplicate tagging, so duplicate metadata write-back was blocked.Security / bug review
near-bottom.offmode blocks automatic streaming scroll only; manual scroll-to-bottom is explicitly tagged as manual so users are not trapped away from the live tail.Real behavior proof
Behavior addressed: WebChat now has a persisted auto-scroll mode selector;
near-bottompreserves current behavior,alwaysfollows streaming output, andoffsuppresses automatic streaming scroll while keeping manual New messages / scroll-to-bottom available.Real environment tested: local macOS Codex worktree on rebased commit
1b8859c8ba7e83b9158eb6e6b25dbe31290444fe; Vite dev server athttp://localhost:5173/. The unauthenticated local gateway showed the auth gate, so selector proof used Vite-loaded Control UI render helpers in browser.Exact steps or command run after this patch:
pnpm test ui/src/ui/app-settings.test.ts ui/src/ui/views/chat.test.ts ui/src/ui/app-render.helpers.node.test.ts ui/src/ui/app-render.helpers.browser.test.ts ui/src/ui/storage.node.test.ts ui/src/ui/app-scroll.test.ts -- --reporter=verbosepnpm check:changedpnpm ui:i18n:checkpnpm ui:buildrenderChatControlsandrenderChatMobileTogglevia Vite imports; confirmed two auto-scroll selectors withAlways,Near bottom,Off; changed the first selector tooffand observedapplySettingsreceivedchatAutoScroll: "off".Evidence after fix: targeted UI/settings/scroll/chat tests passed (
136UI tests plus32unit-ui chat tests);check:changedpassed; i18n check was clean; Vite production build passed; browser proof returnedselectCount: 2, valuesnear-bottom, labelsAlways/Near bottom/Off, and appliedoff.Observed result after fix: auto-scroll policy is mode-gated in tests and the rendered selector updates persisted UI settings without console errors in the local browser proof.
What was not tested: live authenticated WebChat streaming against a real gateway, because the local gateway endpoint required credentials; full cross-browser/device matrix was not run.