Skip to content

armgit / ente

Public Imported from GitHub
0

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

Hide increase-context option on overflow dialog

Prateek Sunal0fab909c58b0
diff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeNavigation.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeNavigation.kt
index 2c782a1543..2771c15080 100644
--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeNavigation.kt
+++ b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeNavigation.kt
@@ -133,10 +133,6 @@ internal fun HomeNavigation(
store.startModelDownload(userInitiated = userInitiated)
},
onOverflowTrim = store::confirmOverflowTrim,
- onOverflowIncreaseContext = {
- store.cancelOverflowDialog()
- navController.navigate(HomeRoute.ModelSettings)
- },
onOverflowCancel = store::cancelOverflowDialog
)
}
diff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatOverlays.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatOverlays.kt
index 9140de2d39..e0b30049a9 100644
--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatOverlays.kt
+++ b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatOverlays.kt
@@ -1,7 +1,6 @@
package io.ente.ensu.chat
import androidx.compose.foundation.background
-import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
@@ -37,15 +36,16 @@ import io.ente.ensu.utils.rememberEnsuHaptics
internal fun OverflowDialog(
state: OverflowDialogState,
onTrim: () -> Unit,
- onIncreaseContext: () -> Unit,
onCancel: () -> Unit
) {
+ val overflowMessage = "Input uses ${state.inputTokens} tokens (budget ${state.inputBudget}). Trim history to continue."
+
AlertDialog(
onDismissRequest = onCancel,
title = { Text(text = "Context limit reached", style = EnsuTypography.h3) },
text = {
Text(
- text = "Input uses ${state.inputTokens} tokens (budget ${state.inputBudget}). Trim history or increase context size?",
+ text = overflowMessage,
style = EnsuTypography.body,
color = EnsuColor.textPrimary()
)
@@ -56,13 +56,8 @@ internal fun OverflowDialog(
}
},
dismissButton = {
- Row(horizontalArrangement = Arrangement.spacedBy(EnsuSpacing.sm.dp)) {
- TextButton(onClick = onIncreaseContext) {
- Text(text = "Increase context", color = EnsuColor.textPrimary())
- }
- TextButton(onClick = onCancel) {
- Text(text = "Cancel", color = EnsuColor.textMuted())
- }
+ TextButton(onClick = onCancel) {
+ Text(text = "Cancel", color = EnsuColor.textMuted())
}
},
containerColor = EnsuColor.backgroundBase()
diff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatView.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatView.kt
index 1bff5fa9a0..6c710918cc 100644
--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatView.kt
+++ b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatView.kt
@@ -52,7 +52,6 @@ fun ChatView(
onOpenAttachment: (Attachment) -> Unit,
onStartDownload: (Boolean) -> Unit,
onOverflowTrim: () -> Unit,
- onOverflowIncreaseContext: () -> Unit,
onOverflowCancel: () -> Unit
) {
val showDownloadOnboarding by remember(
@@ -187,7 +186,6 @@ fun ChatView(
OverflowDialog(
state = overflow,
onTrim = onOverflowTrim,
- onIncreaseContext = onOverflowIncreaseContext,
onCancel = onOverflowCancel
)
}
diff --git a/mobile/native/darwin/Apps/ensu/ensu/Chat/ChatView.swift b/mobile/native/darwin/Apps/ensu/ensu/Chat/ChatView.swift
index 32e661068e..8f4c1d8bfa 100644
--- a/mobile/native/darwin/Apps/ensu/ensu/Chat/ChatView.swift
+++ b/mobile/native/darwin/Apps/ensu/ensu/Chat/ChatView.swift
@@ -211,10 +211,6 @@ struct ChatView: View {
Button("Trim history") {
viewModel.confirmOverflowTrim()
}
- Button("Increase context") {
- viewModel.cancelOverflowDialog()
- viewState.showModelSettings = true
- }
Button("Cancel", role: .cancel) {
viewModel.cancelOverflowDialog()
}