Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[ensu] add response verification footer across clients

Prateek Sunal12f677d6d4ce
diff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatMessages.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatMessages.kt
index 8712d41ca6..bf7ff63d89 100644
--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatMessages.kt
+++ b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatMessages.kt
@@ -295,6 +295,12 @@ internal fun MessageList(
}
}
+ if (messages.isNotEmpty()) {
+ item(key = "ai-safety-footer") {
+ AiSafetyFooter()
+ }
+ }
+
item(key = "bottom") {
Spacer(modifier = Modifier.height(1.dp))
}
@@ -331,6 +337,19 @@ private fun EmptyState(
}
}
+@Composable
+private fun AiSafetyFooter() {
+ Text(
+ text = "Ensu can make mistakes. Please verify important details before acting on any response.",
+ style = EnsuTypography.small,
+ color = EnsuColor.textMuted(),
+ textAlign = TextAlign.Center,
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(top = EnsuSpacing.sm.dp)
+ )
+}
+
@Composable
private fun DownloadOnboarding(
modifier: Modifier,
diff --git a/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swift b/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swift
index e366f7c7a3..808e9a7a3a 100644
--- a/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swift
+++ b/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swift
@@ -212,6 +212,10 @@ struct MessageListView: View {
inlineStreamingTextBubble
.id("streaming")
}
+
+ if !messages.isEmpty {
+ aiSafetyFooter
+ }
}
.padding(.horizontal, EnsuSpacing.pageHorizontal)
.padding(.top, EnsuSpacing.lg)
@@ -264,6 +268,15 @@ struct MessageListView: View {
.foregroundStyle(EnsuColor.textPrimary)
}
+ private var aiSafetyFooter: some View {
+ Text("Ensu can make mistakes. Please verify important details before acting on any response.")
+ .font(EnsuTypography.small)
+ .foregroundStyle(EnsuColor.textMuted)
+ .multilineTextAlignment(.center)
+ .frame(maxWidth: .infinity)
+ .padding(.top, EnsuSpacing.sm)
+ }
+
private var messageTransition: AnyTransition {
.identity
}
diff --git a/web/apps/ensu/src/components/chat/ChatMessageList.tsx b/web/apps/ensu/src/components/chat/ChatMessageList.tsx
index 72ba930bed..8e56ceb57c 100644
--- a/web/apps/ensu/src/components/chat/ChatMessageList.tsx
+++ b/web/apps/ensu/src/components/chat/ChatMessageList.tsx
@@ -106,6 +106,22 @@ const AttachmentCard = memo(({ attachment, onClick }: AttachmentCardProps) => {
);
});
+const AiSafetyFooter = memo(() => {
+ return (
+ <Typography
+ variant="small"
+ sx={{
+ color: "text.muted",
+ textAlign: "center",
+ width: "100%",
+ }}
+ >
+ Ensu can make mistakes. Please verify important details before
+ acting on any response.
+ </Typography>
+ );
+});
+
interface MessageRowProps {
message: ChatMessage;
branchSwitchers: Record<string, BranchSwitcher>;
@@ -696,6 +712,7 @@ export const ChatMessageList = memo(
{renderMessage(index, message)}
</React.Fragment>
))}
+ <AiSafetyFooter />
</Stack>
)}
</Box>