From da619676261b0491b23b53fe5cf6ef78046b89b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Bene=C5=A1?= Date: Mon, 9 Nov 2026 13:17:34 +0000 Subject: [PATCH] Design pass from the first screenshots Material's own purple showed through (selected chips, the tonal button, the slider's track): every container slot of the scheme is a token now. The team sliders are continuous (31 tick marks were noise); the Options button names the team only once its size was chosen; a chat opens at its end; raised surfaces say their ink; the fake schedules run on weekdays at the time their rule says. Co-Authored-By: Claude Opus 5.5 --- .../eu/llembas/android/ui/chat/ActivityPanel.kt | 1 + .../eu/llembas/android/ui/chat/ChatScreen.kt | 11 +++++++++-- .../java/eu/llembas/android/ui/chat/Composer.kt | 7 +++++-- .../android/ui/scheduled/ScheduledScreens.kt | 16 +++++++++++----- .../android/ui/settings/SettingsScreen.kt | 2 +- .../java/eu/llembas/android/ui/theme/Theme.kt | 14 ++++++++++++++ .../test/java/eu/llembas/android/shots/Fakes.kt | 12 ++++++------ 7 files changed, 47 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/eu/llembas/android/ui/chat/ActivityPanel.kt b/app/src/main/java/eu/llembas/android/ui/chat/ActivityPanel.kt index 3a8c885..b781cb1 100644 --- a/app/src/main/java/eu/llembas/android/ui/chat/ActivityPanel.kt +++ b/app/src/main/java/eu/llembas/android/ui/chat/ActivityPanel.kt @@ -96,6 +96,7 @@ fun ActivityStrip(summary: ActivitySummary, onOpen: () -> Unit) { Surface( onClick = onOpen, color = palette.surfaceRaised, + contentColor = palette.ink, shape = RoundedCornerShape(8.dp), modifier = Modifier.fillMaxWidth().padding(horizontal = 12.dp, vertical = 4.dp).heightIn(min = 48.dp), ) { diff --git a/app/src/main/java/eu/llembas/android/ui/chat/ChatScreen.kt b/app/src/main/java/eu/llembas/android/ui/chat/ChatScreen.kt index 93f5f6d..7122468 100644 --- a/app/src/main/java/eu/llembas/android/ui/chat/ChatScreen.kt +++ b/app/src/main/java/eu/llembas/android/ui/chat/ChatScreen.kt @@ -171,7 +171,8 @@ fun ChatContent( val palette = LocalPalette.current val context = LocalContext.current val scope = rememberCoroutineScope() - val list = rememberLazyListState() + // A chat opens at its end, where the conversation is, not at its first message. + val list = rememberLazyListState(initialFirstVisibleItemIndex = maxOf(0, state.messages.size - 1 + if (state.more) 1 else 0)) var menu by remember { mutableStateOf(false) } var picking by remember { mutableStateOf(false) } var tuning by remember { mutableStateOf(false) } @@ -260,7 +261,12 @@ fun ChatContent( } } live?.plan?.let { plan -> - Surface(color = palette.surfaceRaised, shape = RoundedCornerShape(16.dp), modifier = Modifier.fillMaxWidth().padding(bottom = 8.dp)) { + Surface( + color = palette.surfaceRaised, + contentColor = palette.ink, + shape = RoundedCornerShape(16.dp), + modifier = Modifier.fillMaxWidth().padding(bottom = 8.dp), + ) { Column(Modifier.heightIn(max = 180.dp).padding(horizontal = 16.dp, vertical = 8.dp)) { PlanBody(plan) } } } @@ -460,6 +466,7 @@ private fun Suggestions(onPick: (String) -> Unit) { onClick = { onPick("$t $l") }, shape = RoundedCornerShape(16.dp), color = palette.surfaceRaised, + contentColor = palette.ink, border = androidx.compose.foundation.BorderStroke(1.dp, palette.border), modifier = Modifier.width(184.dp).fillMaxHeight(), ) { diff --git a/app/src/main/java/eu/llembas/android/ui/chat/Composer.kt b/app/src/main/java/eu/llembas/android/ui/chat/Composer.kt index 70b7929..fe0cee0 100644 --- a/app/src/main/java/eu/llembas/android/ui/chat/Composer.kt +++ b/app/src/main/java/eu/llembas/android/ui/chat/Composer.kt @@ -123,7 +123,9 @@ fun tuneSummary(state: ChatState, agent: Boolean): String { agent || chat?.isAgent == true -> parts += modeName(chat?.mode?.ifBlank { null } ?: state.draft.agentMode) (chat == null && state.draft.plan) || chat?.mode == "plan" -> parts += stringResource(R.string.mode_plan) } - if (state.offersTeam(agent) && state.agents.max > 1) { + // The team only once someone chose its size: the default says nothing worth repeating. + val chosenTeam = state.chat?.agents ?: state.draft.agents + if (state.offersTeam(agent) && chosenTeam != null && chosenTeam.max > 1) { parts += stringResource(R.string.team_chip, state.agents.min.toString(), state.agents.max.toString()) } return parts.joinToString(" ยท ") @@ -174,6 +176,7 @@ fun Composer(state: ChatState, actions: ChatActions, agent: Boolean, onTune: () Surface( shape = Field, color = palette.surfaceRaised, + contentColor = palette.ink, border = BorderStroke(1.dp, palette.border), modifier = modifier.fillMaxWidth(), ) { @@ -573,7 +576,7 @@ fun AgentsSlider(label: String, value: Int, onChange: (Int) -> Unit) { onValueChange = { shown = it }, onValueChangeFinished = { onChange(Math.round(shown).coerceIn(1, AgentsSetting.CAP)) }, valueRange = 1f..AgentsSetting.CAP.toFloat(), - steps = AgentsSetting.CAP - 2, + // Continuous: 31 tick marks would be noise, and the value is rounded anyway. ) } } diff --git a/app/src/main/java/eu/llembas/android/ui/scheduled/ScheduledScreens.kt b/app/src/main/java/eu/llembas/android/ui/scheduled/ScheduledScreens.kt index 4490a1f..949bafb 100644 --- a/app/src/main/java/eu/llembas/android/ui/scheduled/ScheduledScreens.kt +++ b/app/src/main/java/eu/llembas/android/ui/scheduled/ScheduledScreens.kt @@ -205,7 +205,13 @@ fun ScheduledContent( @Composable private fun ScheduleCard(schedule: Schedule, onOpen: () -> Unit, onPause: (Boolean) -> Unit) { val palette = LocalPalette.current - Surface(onClick = onOpen, shape = RoundedCornerShape(20.dp), color = palette.surfaceRaised, modifier = Modifier.fillMaxWidth()) { + Surface( + onClick = onOpen, + shape = RoundedCornerShape(20.dp), + color = palette.surfaceRaised, + contentColor = palette.ink, + modifier = Modifier.fillMaxWidth(), + ) { Row(Modifier.padding(start = 16.dp, end = 12.dp, top = 14.dp, bottom = 14.dp), verticalAlignment = Alignment.CenterVertically) { Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(4.dp)) { Text( @@ -466,7 +472,7 @@ private fun ScheduleBody( verticalArrangement = Arrangement.spacedBy(8.dp), ) { item { - Surface(shape = RoundedCornerShape(20.dp), color = palette.surfaceRaised, modifier = Modifier.fillMaxWidth()) { + Surface(shape = RoundedCornerShape(20.dp), color = palette.surfaceRaised, contentColor = palette.ink, modifier = Modifier.fillMaxWidth()) { Column(Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) { Row(verticalAlignment = Alignment.CenterVertically) { Icon(Icons.Filled.Schedule, contentDescription = null, tint = palette.accent, modifier = Modifier.size(20.dp)) @@ -506,7 +512,7 @@ private fun ScheduleBody( if (next.isNotEmpty() && !schedule.paused) { item { Header(stringResource(R.string.schedule_next_runs)) } item { - Surface(shape = RoundedCornerShape(16.dp), color = palette.surfaceRaised, modifier = Modifier.fillMaxWidth()) { + Surface(shape = RoundedCornerShape(16.dp), color = palette.surfaceRaised, contentColor = palette.ink, modifier = Modifier.fillMaxWidth()) { Column(Modifier.padding(vertical = 8.dp)) { next.forEach { Text(it, style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(horizontal = 16.dp, vertical = 6.dp)) @@ -553,7 +559,7 @@ private fun Header(text: String) { @Composable private fun RunRow(run: ScheduleRun, onOpen: () -> Unit) { val palette = LocalPalette.current - Surface(shape = RoundedCornerShape(16.dp), color = palette.surfaceRaised, modifier = Modifier.fillMaxWidth()) { + Surface(shape = RoundedCornerShape(16.dp), color = palette.surfaceRaised, contentColor = palette.ink, modifier = Modifier.fillMaxWidth()) { Row(Modifier.heightIn(min = 64.dp).padding(start = 12.dp, end = 4.dp, top = 8.dp, bottom = 8.dp), verticalAlignment = Alignment.CenterVertically) { Box(Modifier.width(112.dp)) { StatusChip(run.status, run.missed) } Column(Modifier.weight(1f)) { @@ -703,7 +709,7 @@ fun ScheduleEditContent( if (state.unsupported) Text(stringResource(R.string.scheduled_unsupported), color = palette.inkMuted) state.error?.let { Text(it, color = palette.danger, style = MaterialTheme.typography.bodyMedium) } state.preview?.let { p -> - Surface(shape = RoundedCornerShape(20.dp), color = palette.surfaceRaised, modifier = Modifier.fillMaxWidth()) { + Surface(shape = RoundedCornerShape(20.dp), color = palette.surfaceRaised, contentColor = palette.ink, modifier = Modifier.fillMaxWidth()) { Column(Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) { Text(stringResource(R.string.schedule_understood), style = MaterialTheme.typography.labelLarge, color = palette.accent) if (p.title.isNotBlank()) Text(p.title, style = MaterialTheme.typography.titleMedium) diff --git a/app/src/main/java/eu/llembas/android/ui/settings/SettingsScreen.kt b/app/src/main/java/eu/llembas/android/ui/settings/SettingsScreen.kt index 59e31aa..8bd5d85 100644 --- a/app/src/main/java/eu/llembas/android/ui/settings/SettingsScreen.kt +++ b/app/src/main/java/eu/llembas/android/ui/settings/SettingsScreen.kt @@ -338,7 +338,7 @@ private fun Group(title: String, content: @Composable () -> Unit) { color = palette.accent, modifier = Modifier.padding(start = 16.dp, top = 24.dp, bottom = 8.dp), ) - Surface(shape = RoundedCornerShape(20.dp), color = palette.surfaceRaised, modifier = Modifier.fillMaxWidth()) { + Surface(shape = RoundedCornerShape(20.dp), color = palette.surfaceRaised, contentColor = palette.ink, modifier = Modifier.fillMaxWidth()) { Column { content() } } } diff --git a/app/src/main/java/eu/llembas/android/ui/theme/Theme.kt b/app/src/main/java/eu/llembas/android/ui/theme/Theme.kt index afbacb5..69286a4 100644 --- a/app/src/main/java/eu/llembas/android/ui/theme/Theme.kt +++ b/app/src/main/java/eu/llembas/android/ui/theme/Theme.kt @@ -23,6 +23,20 @@ private fun scheme(p: Palette, dark: Boolean): ColorScheme { onPrimaryContainer = p.ink, secondary = p.leaf, onSecondary = p.inkInverse, + // Every slot Material reads for a tonal fill, a selected chip, a slider's track or a + // snackbar is a token too: otherwise Material's own purple shows through. + secondaryContainer = p.accentSoft, + onSecondaryContainer = p.ink, + tertiary = p.leaf, + onTertiary = p.inkInverse, + tertiaryContainer = p.successSoft, + onTertiaryContainer = p.ink, + surfaceTint = p.accent, + inverseSurface = p.ink, + inverseOnSurface = p.bg, + inversePrimary = p.accentHover, + surfaceBright = p.surfaceRaised, + surfaceDim = p.bgSunken, background = p.bg, onBackground = p.ink, surface = p.surface, diff --git a/app/src/test/java/eu/llembas/android/shots/Fakes.kt b/app/src/test/java/eu/llembas/android/shots/Fakes.kt index c301c3d..cbb2c45 100644 --- a/app/src/test/java/eu/llembas/android/shots/Fakes.kt +++ b/app/src/test/java/eu/llembas/android/shots/Fakes.kt @@ -142,8 +142,8 @@ object Fakes { ) private val ok = - ScheduleRun(id = "r1", dueAt = "2026-03-10T06:30:00+00:00", startedAt = "2026-03-10T06:30:02+00:00", status = "ok", model = "qwen", chatId = "c9") - private val nextRuns = (11..17).map { "2026-03-${it}T06:30:00+00:00" } + ScheduleRun(id = "r1", dueAt = "2026-03-10T07:30:00+00:00", startedAt = "2026-03-10T07:30:02+00:00", status = "ok", model = "qwen", chatId = "c9") + private val nextRuns = listOf(11, 12, 13, 16, 17).map { "2026-03-${it}T07:30:00+00:00" } val schedules = listOf( Schedule( @@ -190,17 +190,17 @@ object Fakes { ok, ScheduleRun( id = "r0", - startedAt = "2026-03-09T06:41:00+00:00", + startedAt = "2026-03-09T07:41:00+00:00", status = "ok", model = "gpt-oss", modelReason = "switched: qwen busy", chatId = "c8", ), - ScheduleRun(id = "r-1", dueAt = "2026-03-06T06:30:00+00:00", status = "silent", model = "qwen"), - ScheduleRun(id = "r-2", dueAt = "2026-03-05T06:30:00+00:00", status = "missed", missed = 2), + ScheduleRun(id = "r-1", dueAt = "2026-03-06T07:30:00+00:00", status = "silent", model = "qwen"), + ScheduleRun(id = "r-2", dueAt = "2026-03-05T07:30:00+00:00", status = "missed", missed = 2), ScheduleRun( id = "r-3", - startedAt = "2026-03-04T06:30:00+00:00", + startedAt = "2026-03-04T07:30:00+00:00", status = "failed", model = "qwen", error = "The model stopped answering after 10 minutes.",