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 <noreply@anthropic.com>
This commit is contained in:
7 files changed
+47
-16
No files matched your search
@@ -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),
|
||||
) {
|
||||
|
||||
@@ -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(),
|
||||
) {
|
||||
|
||||
@@ -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.
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -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() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user