@@ -38,7 +38,6 @@ import androidx.compose.foundation.shape.CircleShape
3838import androidx.compose.foundation.shape.RoundedCornerShape
3939import androidx.compose.foundation.text.BasicTextField
4040import androidx.compose.material.icons.Icons
41- import androidx.compose.material.icons.automirrored.filled.ArrowBack
4241import androidx.compose.material.icons.automirrored.filled.Send
4342import androidx.compose.material.icons.filled.AttachFile
4443import androidx.compose.material.icons.filled.Close
@@ -80,10 +79,8 @@ import java.util.Locale
8079@Composable
8180fun ChatScreen (
8281 viewModel : MainViewModel ,
83- onBack : () -> Unit ,
8482 onVoice : () -> Unit ,
85- onOpenSessions : (() -> Unit )? = null,
86- showBackButton : Boolean = true,
83+ onOpenSessions : () -> Unit ,
8784) {
8885 val messages by viewModel.chatMessages.collectAsState()
8986 val historyLoading by viewModel.chatHistoryLoading.collectAsState()
@@ -162,12 +159,10 @@ fun ChatScreen(
162159 thinkingLevel = thinkingLevel,
163160 healthOk = healthOk,
164161 pendingRunCount = pendingRunCount,
165- onBack = onBack,
166162 onMore = {
167163 viewModel.refreshChat()
168164 viewModel.refreshChatSessions(limit = 100 )
169165 },
170- showBackButton = showBackButton,
171166 )
172167
173168 ChatSessionSwitcher (
@@ -236,7 +231,7 @@ private fun ChatSessionSwitcher(
236231 sessions : List <ChatSessionEntry >,
237232 mainSessionKey : String ,
238233 onSelectSession : (String ) -> Unit ,
239- onOpenSessions : (( ) -> Unit ) ? ,
234+ onOpenSessions : () -> Unit ,
240235) {
241236 val choices =
242237 remember(sessionKey, sessions, mainSessionKey) {
@@ -260,7 +255,7 @@ private fun ChatSessionSwitcher(
260255 onClick = { onSelectSession(entry.key) },
261256 )
262257 }
263- if (onOpenSessions != null && sessions.size > choices.size) {
258+ if (sessions.size > choices.size) {
264259 Surface (
265260 onClick = onOpenSessions,
266261 modifier = Modifier .heightIn(min = 36 .dp),
@@ -312,20 +307,14 @@ private fun ChatHeader(
312307 thinkingLevel : String ,
313308 healthOk : Boolean ,
314309 pendingRunCount : Int ,
315- onBack : () -> Unit ,
316310 onMore : () -> Unit ,
317- showBackButton : Boolean ,
318311) {
319312 Row (
320313 modifier = Modifier .fillMaxWidth(),
321314 verticalAlignment = Alignment .CenterVertically ,
322315 horizontalArrangement = Arrangement .spacedBy(6 .dp),
323316 ) {
324- if (showBackButton) {
325- HeaderIcon (icon = Icons .AutoMirrored .Filled .ArrowBack , contentDescription = " Back" , onClick = onBack)
326- } else {
327- Box (modifier = Modifier .size(ClawTheme .spacing.touchTarget))
328- }
317+ Box (modifier = Modifier .size(ClawTheme .spacing.touchTarget))
329318
330319 Column (
331320 modifier = Modifier .weight(1f ),
0 commit comments