π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
ensu ios: keep streaming anchor stable for outro playback
Prateek Sunalcd8bd15b472a
diff --git a/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swift b/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swiftindex 731a08f093..ecb79fc77a 100644--- a/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swift+++ b/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swift@@ -28,6 +28,7 @@ struct MessageListView: View {@State private var suppressAutoScrollAfterGeneration = false@State private var showStreamingBubble = false@State private var streamingWasGenerating = false+ @State private var streamingAnchorParentId: UUID?@State private var streamingHideWorkItem: DispatchWorkItem?var body: some View {@@ -84,6 +85,7 @@ struct MessageListView: View {didInitialScroll = falseshowStreamingBubble = isGeneratingstreamingWasGenerating = isGenerating+ streamingAnchorParentId = streamingParentIdscheduleInitialScroll(scrollProxy)}.onChange(of: isGenerating) { generating in@@ -91,6 +93,7 @@ struct MessageListView: View {streamingHideWorkItem?.cancel()streamingHideWorkItem = nilshowStreamingBubble = true+ streamingAnchorParentId = streamingParentIdsuppressAutoScrollAfterGeneration = false} else {suppressAutoScrollAfterGeneration = true@@ -109,11 +112,17 @@ struct MessageListView: View {}streamingWasGenerating = generating}+ .onChange(of: streamingParentId) { parentId in+ if isGenerating {+ streamingAnchorParentId = parentId+ }+ }.onChange(of: sessionId) { _ instreamingHideWorkItem?.cancel()streamingHideWorkItem = nilshowStreamingBubble = isGeneratingstreamingWasGenerating = isGenerating+ streamingAnchorParentId = streamingParentId}}}@@ -210,6 +219,9 @@ struct MessageListView: View {.frame(minHeight: emptyStateMinHeight)}+ let shouldShowStreaming = isGenerating || showStreamingBubble+ let activeStreamingParentId = isGenerating ? streamingParentId : streamingAnchorParentId+ForEach(messages) { message inif message.role == .user {UserMessageBubbleView(@@ -233,15 +245,24 @@ struct MessageListView: View {.transition(messageTransition)}+ if shouldShowStreaming && activeStreamingParentId == message.id {+ StreamingBubbleView(+ text: streamingResponse,+ isGenerating: isGenerating,+ isOutroPhase: !isGenerating && showStreamingBubble+ )+ .id("streaming-\(message.id.uuidString)")+ .transition(streamingTransition)+ }}- if isGenerating || showStreamingBubble {+ if shouldShowStreaming && activeStreamingParentId == nil {StreamingBubbleView(text: streamingResponse,isGenerating: isGenerating,isOutroPhase: !isGenerating && showStreamingBubble)- .id("streaming")+ .id("streaming-root").transition(streamingTransition)}}diff --git a/mobile/native/darwin/Apps/ensu/ensu/Components/EnsuBrandIllustration.swift b/mobile/native/darwin/Apps/ensu/ensu/Components/EnsuBrandIllustration.swiftindex 9340c6daef..104a1f5728 100644--- a/mobile/native/darwin/Apps/ensu/ensu/Components/EnsuBrandIllustration.swift+++ b/mobile/native/darwin/Apps/ensu/ensu/Components/EnsuBrandIllustration.swift@@ -112,41 +112,14 @@ struct EnsuBrandIllustration: View {discoverPlaybackTargets()let inputName = resolvedOutroInputName ?? outroInputName- if let boolInput = riveViewModel.boolInput(named: inputName) {- boolInput.setValue(true)- riveViewModel.play()- return- }- if let numberInput = riveViewModel.numberInput(named: inputName) {- numberInput.setValue(1)- riveViewModel.play()- return- }-- if let outroStateMachineName {- try? riveViewModel.configureModel(stateMachineName: outroStateMachineName)- riveViewModel.play()- return- }-- if let outroAnimationName {- try? riveViewModel.configureModel(animationName: outroAnimationName)- riveViewModel.play(loop: .oneShot)- return- }-++ // Try trigger input first (most common for state machine triggers)riveViewModel.triggerInput(inputName)+ riveViewModel.play()}private func resetOutroInputValue() {- let inputName = resolvedOutroInputName ?? outroInputName- if let boolInput = riveViewModel.boolInput(named: inputName) {- boolInput.setValue(false)- return- }- if let numberInput = riveViewModel.numberInput(named: inputName) {- numberInput.setValue(0)- }+ // Trigger inputs are one-time events and don't need to be reset}}