Session Chat Auto-Scroll Adjustment
Nucleic-Session: 8FCEB1B7-A6C0-44E2-B00A-E4786F41A1FA Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -511,22 +511,13 @@ struct TranscriptList: View {
|
|||||||
// so every streamed delta keeps the view pinned to the bottom — but only while the
|
// so every streamed delta keeps the view pinned to the bottom — but only while the
|
||||||
// user is already parked there. Scrolling up to read history is never yanked down.
|
// user is already parked there. Scrolling up to read history is never yanked down.
|
||||||
.onChange(of: events.count) {
|
.onChange(of: events.count) {
|
||||||
if isScrolledToBottom { scrollToLast(proxy, animated: !transcriptSettling) }
|
if isScrolledToBottom { scrollToEnd(proxy, animated: !transcriptSettling) }
|
||||||
}
|
|
||||||
// An explicit jump — the chevron or sending a message — always wins.
|
|
||||||
.onChange(of: scrollToBottomRequest) { scrollToLast(proxy) }
|
|
||||||
// Floating chevron above the chat bar, shown only while scrolled up; tap to jump back
|
|
||||||
// to the latest output. Mirrors the Mac's `JumpToBottomButton`.
|
|
||||||
.overlay(alignment: .bottom) {
|
|
||||||
ZStack {
|
|
||||||
if !isScrolledToBottom {
|
|
||||||
JumpToBottomButton { scrollToLast(proxy) }
|
|
||||||
.padding(.bottom, 12)
|
|
||||||
.transition(.move(edge: .bottom).combined(with: .opacity))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.animation(.easeInOut(duration: 0.15), value: isScrolledToBottom)
|
|
||||||
}
|
}
|
||||||
|
// An explicit jump — the chevron or sending a message — always wins. The chevron
|
||||||
|
// itself lives in the parent's chat bar (above the composer), not as an overlay here,
|
||||||
|
// so it sits over the composer instead of behind the floating bar; a tap bumps this
|
||||||
|
// same request, and following resumes once the geometry reader sees the bottom.
|
||||||
|
.onChange(of: scrollToBottomRequest) { scrollToEnd(proxy) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user