fix(panel): thread scroller opts out of scroll anchoring

This commit is contained in:
hh
2026-09-02 05:08:51 +02:00
parent 72d60b799f
commit 20568915db
+1 -4
View File
@@ -37,7 +37,6 @@
let loadedAt = $state(new Date(0).toISOString()); let loadedAt = $state(new Date(0).toISOString());
let scroller = $state<HTMLDivElement | null>(null); let scroller = $state<HTMLDivElement | null>(null);
let body = $state<HTMLDivElement | null>(null); let body = $state<HTMLDivElement | null>(null);
let end = $state<HTMLDivElement | null>(null);
const SETTLE_MS = 2500; const SETTLE_MS = 2500;
const SETTLE_STEP_MS = 120; const SETTLE_STEP_MS = 120;
let settleUntil = 0; let settleUntil = 0;
@@ -90,7 +89,6 @@
if (scroller) { if (scroller) {
scroller.scrollTop = 0; scroller.scrollTop = 0;
} }
end?.scrollIntoView({ block: "end" });
} }
async function scrollToBottom() { async function scrollToBottom() {
@@ -208,7 +206,7 @@
</script> </script>
<div <div
class="flex min-h-0 flex-1 flex-col-reverse overflow-y-auto overflow-x-hidden px-3 py-3 @md:px-6" class="flex min-h-0 flex-1 flex-col-reverse overflow-y-auto overflow-x-hidden px-3 py-3 [overflow-anchor:none] @md:px-6"
onscroll={() => { onscroll={() => {
if (Date.now() > settleUntil) { if (Date.now() > settleUntil) {
pinned = nearBottom(); pinned = nearBottom();
@@ -341,6 +339,5 @@
{#each tail as turn (turn.id)} {#each tail as turn (turn.id)}
<TurnCard {now} {turn} /> <TurnCard {now} {turn} />
{/each} {/each}
<div aria-hidden="true" class="h-px shrink-0" bind:this={end}></div>
</div> </div>
</div> </div>