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:
parent
3e57ca5d72
commit
bf4bd9604c
@ -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,29 +193,54 @@ 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 = {
|
||||||
|
showMenu = false
|
||||||
|
onShareScreen()
|
||||||
|
},
|
||||||
|
leadingIcon = { Icon(Icons.AutoMirrored.Filled.ScreenShare, contentDescription = null, tint = Color.White.copy(alpha = 0.8f)) },
|
||||||
|
)
|
||||||
|
|
||||||
|
// Settings (Session & Thinking)
|
||||||
|
var showSettingsSubmenu by remember { mutableStateOf(false) }
|
||||||
|
DropdownMenuItem(
|
||||||
|
text = { Text("Settings", color = Color.White) },
|
||||||
|
onClick = {
|
||||||
|
showSettingsSubmenu = !showSettingsSubmenu
|
||||||
|
},
|
||||||
|
leadingIcon = { Icon(Icons.Default.Tune, contentDescription = null, tint = Color.White.copy(alpha = 0.8f)) },
|
||||||
|
trailingIcon = {
|
||||||
|
Text(
|
||||||
|
if (showSettingsSubmenu) "▲" else "▼",
|
||||||
|
color = Color.White.copy(alpha = 0.5f),
|
||||||
|
style = MaterialTheme.typography.bodySmall
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
if (showSettingsSubmenu) {
|
||||||
|
// Session selector (indented)
|
||||||
|
DropdownMenuItem(
|
||||||
|
text = { Text(" Session", color = Color.White.copy(alpha = 0.9f)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
showMenu = false
|
showMenu = false
|
||||||
showSessionMenu = true
|
showSessionMenu = true
|
||||||
},
|
},
|
||||||
leadingIcon = { Icon(Icons.Default.Settings, contentDescription = null, tint = Color.White.copy(alpha = 0.8f)) },
|
trailingIcon = { Text(currentSessionLabel, color = Color.White.copy(alpha = 0.5f), style = MaterialTheme.typography.labelSmall) },
|
||||||
trailingIcon = { Text(currentSessionLabel, color = Color.White.copy(alpha = 0.6f), style = MaterialTheme.typography.bodySmall) },
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Thinking level
|
// Thinking level (indented)
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text("Thinking", color = Color.White) },
|
text = { Text(" Thinking", color = Color.White.copy(alpha = 0.9f)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
showMenu = false
|
showMenu = false
|
||||||
showThinkingMenu = true
|
showThinkingMenu = true
|
||||||
},
|
},
|
||||||
leadingIcon = {
|
trailingIcon = { Text(thinkingLabel(thinkingLevel), color = Color.White.copy(alpha = 0.5f), style = MaterialTheme.typography.labelSmall) },
|
||||||
Text("🧠", style = MaterialTheme.typography.bodyLarge)
|
|
||||||
},
|
|
||||||
trailingIcon = { Text(thinkingLabel(thinkingLevel), color = Color.White.copy(alpha = 0.6f), style = MaterialTheme.typography.bodySmall) },
|
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
HorizontalDivider(
|
HorizontalDivider(
|
||||||
modifier = Modifier.padding(vertical = 8.dp),
|
modifier = Modifier.padding(vertical = 8.dp),
|
||||||
|
|||||||
@ -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) },
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user