Android: reorganize menu - add Share screen, collapse Session/Thinking into Settings

- Added Share screen option (TODO: implement)
- Session and Thinking now under collapsible 'Settings' submenu
- Cleaner top-level menu: Camera/Photos/Files, Share screen, Settings, Refresh
This commit is contained in:
yishai 2026-01-28 22:29:18 +02:00
parent 3e57ca5d72
commit bf4bd9604c
2 changed files with 41 additions and 12 deletions

View File

@ -35,7 +35,9 @@ import androidx.compose.material.icons.filled.Mic
import androidx.compose.material.icons.filled.Refresh import androidx.compose.material.icons.filled.Refresh
import androidx.compose.material.icons.filled.Send import androidx.compose.material.icons.filled.Send
import androidx.compose.material.icons.filled.Settings import androidx.compose.material.icons.filled.Settings
import androidx.compose.material.icons.automirrored.filled.ScreenShare
import androidx.compose.material.icons.filled.Stop import androidx.compose.material.icons.filled.Stop
import androidx.compose.material.icons.filled.Tune
import androidx.compose.material3.DropdownMenu import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.FilledTonalIconButton import androidx.compose.material3.FilledTonalIconButton
@ -80,6 +82,7 @@ fun ChatComposer(
onOpenCamera: () -> Unit = {}, onOpenCamera: () -> Unit = {},
onPickImages: () -> Unit, onPickImages: () -> Unit,
onPickFiles: () -> Unit = {}, onPickFiles: () -> Unit = {},
onShareScreen: () -> Unit = {},
onRemoveAttachment: (id: String) -> Unit, onRemoveAttachment: (id: String) -> Unit,
onSetThinkingLevel: (level: String) -> Unit, onSetThinkingLevel: (level: String) -> Unit,
onSelectSession: (sessionKey: String) -> Unit, onSelectSession: (sessionKey: String) -> Unit,
@ -190,30 +193,55 @@ fun ChatComposer(
color = Color.White.copy(alpha = 0.15f), color = Color.White.copy(alpha = 0.15f),
) )
// Session selector // Share screen
DropdownMenuItem( DropdownMenuItem(
text = { Text("Session", color = Color.White) }, text = { Text("Share screen", color = Color.White) },
onClick = { onClick = {
showMenu = false showMenu = false
showSessionMenu = true onShareScreen()
}, },
leadingIcon = { Icon(Icons.Default.Settings, contentDescription = null, tint = Color.White.copy(alpha = 0.8f)) }, leadingIcon = { Icon(Icons.AutoMirrored.Filled.ScreenShare, contentDescription = null, tint = Color.White.copy(alpha = 0.8f)) },
trailingIcon = { Text(currentSessionLabel, color = Color.White.copy(alpha = 0.6f), style = MaterialTheme.typography.bodySmall) },
) )
// Thinking level // Settings (Session & Thinking)
var showSettingsSubmenu by remember { mutableStateOf(false) }
DropdownMenuItem( DropdownMenuItem(
text = { Text("Thinking", color = Color.White) }, text = { Text("Settings", color = Color.White) },
onClick = { onClick = {
showMenu = false showSettingsSubmenu = !showSettingsSubmenu
showThinkingMenu = true
}, },
leadingIcon = { leadingIcon = { Icon(Icons.Default.Tune, contentDescription = null, tint = Color.White.copy(alpha = 0.8f)) },
Text("🧠", style = MaterialTheme.typography.bodyLarge) trailingIcon = {
Text(
if (showSettingsSubmenu) "" else "",
color = Color.White.copy(alpha = 0.5f),
style = MaterialTheme.typography.bodySmall
)
}, },
trailingIcon = { Text(thinkingLabel(thinkingLevel), color = Color.White.copy(alpha = 0.6f), style = MaterialTheme.typography.bodySmall) },
) )
if (showSettingsSubmenu) {
// Session selector (indented)
DropdownMenuItem(
text = { Text(" Session", color = Color.White.copy(alpha = 0.9f)) },
onClick = {
showMenu = false
showSessionMenu = true
},
trailingIcon = { Text(currentSessionLabel, color = Color.White.copy(alpha = 0.5f), style = MaterialTheme.typography.labelSmall) },
)
// Thinking level (indented)
DropdownMenuItem(
text = { Text(" Thinking", color = Color.White.copy(alpha = 0.9f)) },
onClick = {
showMenu = false
showThinkingMenu = true
},
trailingIcon = { Text(thinkingLabel(thinkingLevel), color = Color.White.copy(alpha = 0.5f), style = MaterialTheme.typography.labelSmall) },
)
}
HorizontalDivider( HorizontalDivider(
modifier = Modifier.padding(vertical = 8.dp), modifier = Modifier.padding(vertical = 8.dp),
color = Color.White.copy(alpha = 0.15f), color = Color.White.copy(alpha = 0.15f),

View File

@ -155,6 +155,7 @@ fun ChatSheetContent(viewModel: MainViewModel) {
onOpenCamera = { openCamera() }, onOpenCamera = { openCamera() },
onPickImages = { pickImages.launch("image/*") }, onPickImages = { pickImages.launch("image/*") },
onPickFiles = { pickFiles.launch(arrayOf("*/*")) }, onPickFiles = { pickFiles.launch(arrayOf("*/*")) },
onShareScreen = { /* TODO: Trigger screen share - sends request to agent */ },
onRemoveAttachment = { id -> attachments.removeAll { it.id == id } }, onRemoveAttachment = { id -> attachments.removeAll { it.id == id } },
onSetThinkingLevel = { level -> viewModel.setChatThinkingLevel(level) }, onSetThinkingLevel = { level -> viewModel.setChatThinkingLevel(level) },
onSelectSession = { key -> viewModel.switchChatSession(key) }, onSelectSession = { key -> viewModel.switchChatSession(key) },