cleanup(app): wrap entire MessageTimeline in ScrollView

This commit is contained in:
Brendan Allan 2026-05-14 20:34:29 +08:00
commit f9248e8faa
No known key found for this signature in database
GPG key ID: 41E835AEA046A32E

View file

@ -1163,8 +1163,17 @@ export function MessageTimeline(props: {
</div> </div>
</button> </button>
</div> </div>
<div <ScrollView
class="relative min-w-0 w-full h-full flex flex-col" viewportRef={bindListRoot}
onWheel={handleListWheel}
onTouchStart={handleListTouchStart}
onTouchMove={handleListTouchMove}
onTouchEnd={handleListTouchEnd}
onTouchCancel={handleListTouchEnd}
onPointerDown={handleListPointerDown}
onScroll={handleListScroll}
onClick={props.onAutoScrollInteraction}
class="relative min-w-0 w-full h-full"
style={{ style={{
"--session-title-height": showHeader() ? "40px" : "0px", "--session-title-height": showHeader() ? "40px" : "0px",
"--sticky-accordion-top": showHeader() ? "48px" : "0px", "--sticky-accordion-top": showHeader() ? "48px" : "0px",
@ -1179,7 +1188,6 @@ export function MessageTimeline(props: {
data-session-title data-session-title
classList={{ classList={{
"sticky top-0 z-30 bg-[linear-gradient(to_bottom,var(--background-stronger)_48px,transparent)]": true, "sticky top-0 z-30 bg-[linear-gradient(to_bottom,var(--background-stronger)_48px,transparent)]": true,
relative: true,
"w-full": true, "w-full": true,
"pb-4": true, "pb-4": true,
"pl-2 pr-3 md:pl-4 md:pr-3": true, "pl-2 pr-3 md:pl-4 md:pr-3": true,
@ -1460,18 +1468,6 @@ export function MessageTimeline(props: {
</div> </div>
</div> </div>
</Show> </Show>
<ScrollView
viewportRef={bindListRoot}
onWheel={handleListWheel}
onTouchStart={handleListTouchStart}
onTouchMove={handleListTouchMove}
onTouchEnd={handleListTouchEnd}
onTouchCancel={handleListTouchEnd}
onPointerDown={handleListPointerDown}
onScroll={handleListScroll}
onClick={props.onAutoScrollInteraction}
class="relative min-w-0 w-full h-full"
>
<Show when={scrollRoot()}> <Show when={scrollRoot()}>
{(root) => ( {(root) => (
<Virtualizer <Virtualizer
@ -1500,6 +1496,5 @@ export function MessageTimeline(props: {
</Show> </Show>
</ScrollView> </ScrollView>
</div> </div>
</div>
) )
} }