π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
ensu ios: prevent auto-scroll when generation completes
Prateek Sunalff1006aba862
diff --git a/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swift b/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swiftindex 5856658c4c..23391e06a2 100644--- a/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swift+++ b/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swift@@ -25,6 +25,7 @@ struct MessageListView: View {@State private var lastContentHeight: CGFloat = 0@State private var lastScrollChange = ScrollChange()@State private var didInitialScroll = false+ @State private var suppressAutoScrollAfterGeneration = falsevar body: some View {GeometryReader { proxy in@@ -63,7 +64,12 @@ struct MessageListView: View {let delta = newHeight - lastContentHeightlastContentHeight = newHeightlet lastMessageIsUser = messages.last?.role == .user- if delta > 1, autoScrollEnabled, !isUserDragging, !isGenerating, lastMessageIsUser {+ if delta > 1,+ autoScrollEnabled,+ !isUserDragging,+ !isGenerating,+ !suppressAutoScrollAfterGeneration,+ lastMessageIsUser {scrollToBottom(scrollProxy, force: true, animated: true)}}@@ -75,6 +81,14 @@ struct MessageListView: View {didInitialScroll = falsescheduleInitialScroll(scrollProxy)}+ .onChange(of: isGenerating) { generating in+ if !generating {+ suppressAutoScrollAfterGeneration = true+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.45) {+ suppressAutoScrollAfterGeneration = false+ }+ }+ }}}.sheet(item: $previewItem) { item in@@ -128,7 +142,11 @@ struct MessageListView: View {}if newValue.inputBarHeight != previous.inputBarHeight {- if autoScrollEnabled && !isUserDragging && !isGenerating && !didGenerationJustFinish {+ if autoScrollEnabled &&+ !isUserDragging &&+ !isGenerating &&+ !didGenerationJustFinish &&+ !suppressAutoScrollAfterGeneration {scrollToBottom(scrollProxy, force: true, animated: false)}}