mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-04 23:40:48 +00:00
fix(app): session timeline jumping on scroll (#18993)
This commit is contained in:
parent
e837dcc1c5
commit
b848b7ebae
1 changed files with 9 additions and 4 deletions
|
|
@ -246,14 +246,19 @@ function createSessionHistoryWindow(input: SessionHistoryWindowInput) {
|
|||
|
||||
if (added <= 0) return
|
||||
if (growth <= 0) return
|
||||
|
||||
if (opts?.prefetch) {
|
||||
const current = turnStart()
|
||||
preserveScroll(() => setTurnStart(current + growth))
|
||||
return
|
||||
}
|
||||
|
||||
if (turnStart() !== start) return
|
||||
|
||||
const reveal = !opts?.prefetch
|
||||
const currentRendered = renderedUserMessages().length
|
||||
const base = Math.max(beforeRendered, currentRendered)
|
||||
const target = reveal ? Math.min(afterVisible, base + turnBatch) : base
|
||||
const nextStart = Math.max(0, afterVisible - target)
|
||||
preserveScroll(() => setTurnStart(nextStart))
|
||||
const target = Math.min(afterVisible, base + turnBatch)
|
||||
preserveScroll(() => setTurnStart(Math.max(0, afterVisible - target)))
|
||||
}
|
||||
|
||||
const onScrollerScroll = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue