diff --git a/NucleicRemote/NucleicRemote/Views/SessionDetailView.swift b/NucleicRemote/NucleicRemote/Views/SessionDetailView.swift index d45693c..60bac70 100644 --- a/NucleicRemote/NucleicRemote/Views/SessionDetailView.swift +++ b/NucleicRemote/NucleicRemote/Views/SessionDetailView.swift @@ -521,16 +521,17 @@ struct TranscriptList: View { } } - /// Scroll the last message to the bottom edge; `animated: false` during the open-settle + /// Scroll the fixed bottom anchor into view; `animated: false` during the open-settle /// window so a chat that's still laying out snaps to the tail instead of easing into place. - private func scrollToLast(_ proxy: ScrollViewProxy, animated: Bool = true) { - guard let last = items.last else { return } + private func scrollToEnd(_ proxy: ScrollViewProxy, animated: Bool = true) { if animated { - withAnimation { proxy.scrollTo(last.id, anchor: .bottom) } + withAnimation { proxy.scrollTo(Self.bottomAnchorID, anchor: .bottom) } } else { - proxy.scrollTo(last.id, anchor: .bottom) + proxy.scrollTo(Self.bottomAnchorID, anchor: .bottom) } } + + private static let bottomAnchorID = "nucleic.transcript-bottom" } /// The floating "jump to the latest" chevron shown above the chat bar while the user has