mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 20:45:43 +00:00
Match the agent model picker to the usage panel
This commit is contained in:
1 parent
caae385924
commit
e46efcb885
1 file changed
+7
-6
@@ -67,13 +67,18 @@ import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
@Composable
|
||||
private fun agentPanelFrame(): Modifier =
|
||||
Modifier.fillMaxWidth().clip(Shape14).background(MaterialTheme.colorScheme.surface)
|
||||
.border(1.dp, LocalPalette.current.line, Shape14).padding(horizontal = 14.dp, vertical = 10.dp)
|
||||
|
||||
/** The model, reasoning effort, permissions and plan mode for the next turns; a conversation keeps going with whatever is chosen. */
|
||||
@Composable
|
||||
internal fun AgentModelPicker() {
|
||||
val context = LocalContext.current
|
||||
val pal = LocalPalette.current
|
||||
val models = remember(AgentHost.harness) { AgentHost.models(context) }
|
||||
Column(Modifier.fillMaxWidth().padding(bottom = 10.dp), verticalArrangement = Arrangement.spacedBy(10.dp)) {
|
||||
Column(agentPanelFrame(), verticalArrangement = Arrangement.spacedBy(10.dp)) {
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.horizontalScroll(rememberScrollState())) {
|
||||
val choices = listOf(AgentHarness.Model("", stringResource(R.string.agent_model_default))) + models
|
||||
for (choice in choices) {
|
||||
@@ -269,12 +274,8 @@ internal fun AgentProcessList(modifier: Modifier) {
|
||||
@Composable
|
||||
internal fun AgentUsage() {
|
||||
val context = LocalContext.current
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
Column(
|
||||
Modifier.fillMaxWidth().clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14).padding(horizontal = 14.dp, vertical = 10.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
) {
|
||||
Column(agentPanelFrame(), verticalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
if (AgentHost.window > 0) UsageRow(
|
||||
stringResource(R.string.agent_usage_context),
|
||||
stringResource(R.string.agent_usage_of, tokens(AgentHost.context), tokens(AgentHost.window)),
|
||||
|
||||
Reference in new issue
Block a user