Chat panel follows its tail by scrolling its own body (SidePanel body gets data-slot side-panel-body) instead of scrollIntoView, which scrolls every ancestor
Docs / docs (push) Successful in 25s
Playwright Tests / test-playwright (1, 2) (push) Failing after 4m15s
Playwright Tests / test-playwright (2, 2) (push) Successful in 2m21s
pre-commit / pre-commit (push) Failing after 2m24s
Test Backend / test-backend (3.12) (push) Successful in 4m25s
Test Backend / test-backend (3.14) (push) Successful in 4m17s
Compose Smoke Test / test-compose (push) Successful in 36s
Playwright Tests / merge-reports (push) Successful in 1m38s
Docs / docs (push) Successful in 25s
Playwright Tests / test-playwright (1, 2) (push) Failing after 4m15s
Playwright Tests / test-playwright (2, 2) (push) Successful in 2m21s
pre-commit / pre-commit (push) Failing after 2m24s
Test Backend / test-backend (3.12) (push) Successful in 4m25s
Test Backend / test-backend (3.14) (push) Successful in 4m17s
Compose Smoke Test / test-compose (push) Successful in 36s
Playwright Tests / merge-reports (push) Successful in 1m38s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -179,7 +179,10 @@ export function ChatPanel() {
|
||||
const tailLength = tail && "text" in tail ? tail.text.length : 0
|
||||
// biome-ignore lint/correctness/useExhaustiveDependencies: scroll when the list or a streamed answer grows, not on every render.
|
||||
useEffect(() => {
|
||||
bottom.current?.scrollIntoView({ block: "end" })
|
||||
// Only the panel's body moves: `scrollIntoView` would scroll every
|
||||
// ancestor too, which is how the logs panel slid the code editor away.
|
||||
const body = bottom.current?.closest("[data-slot=side-panel-body]")
|
||||
body?.scrollTo({ top: body.scrollHeight })
|
||||
}, [shown.length, tailLength, waiting])
|
||||
|
||||
const send = async () => {
|
||||
|
||||
@@ -252,6 +252,7 @@ export function SidePanel({
|
||||
</div>
|
||||
|
||||
<div
|
||||
data-slot="side-panel-body"
|
||||
className={cn(
|
||||
"flex min-h-0 flex-1 flex-col",
|
||||
expanded ? "overflow-hidden" : "overflow-y-auto",
|
||||
|
||||
Reference in New Issue
Block a user