fix: sampling panel too large + pills barely visible
Sampling panel: width 260→220dp, padding reduced, spacing 14→6dp between parameters, checkbox 20→16dp, slider height capped at 28dp, removed extra spacer between label row and slider. Panel is now ~40% shorter. Pills visibility: inactive background alpha raised (dark 0.06→0.10, light 0.04→0.07), border alpha doubled (dark 0.08→0.14, light was white-on-light invisible, now uses black 0.10), icon tint 0.60→0.75, text 0.70→0.80. Active state also strengthened. Pills are now clearly visible in both modes.
This commit is contained in:
parent
d289466276
commit
4150936b18
1 changed files with 17 additions and 18 deletions
|
|
@ -224,19 +224,19 @@ fun ModePillsRow(
|
||||||
shadowElevation = 16.dp,
|
shadowElevation = 16.dp,
|
||||||
shape = KaizenShapes.md,
|
shape = KaizenShapes.md,
|
||||||
) {
|
) {
|
||||||
Column(Modifier.padding(horizontal = 16.dp, vertical = 12.dp).width(260.dp)) {
|
Column(Modifier.padding(horizontal = 14.dp, vertical = 10.dp).width(220.dp)) {
|
||||||
SamplingRow(
|
SamplingRow(
|
||||||
label = stringResource(R.string.sampling_temperature),
|
label = stringResource(R.string.sampling_temperature),
|
||||||
param = samplingPrefs.temperature, min = 0f, max = 2f, steps = 200,
|
param = samplingPrefs.temperature, min = 0f, max = 2f, steps = 200,
|
||||||
onUpdate = { onSamplingChange(samplingPrefs.copy(temperature = it)) },
|
onUpdate = { onSamplingChange(samplingPrefs.copy(temperature = it)) },
|
||||||
)
|
)
|
||||||
Spacer(Modifier.height(14.dp))
|
Spacer(Modifier.height(6.dp))
|
||||||
SamplingRow(
|
SamplingRow(
|
||||||
label = stringResource(R.string.sampling_top_p),
|
label = stringResource(R.string.sampling_top_p),
|
||||||
param = samplingPrefs.topP, min = 0f, max = 1f, steps = 100,
|
param = samplingPrefs.topP, min = 0f, max = 1f, steps = 100,
|
||||||
onUpdate = { onSamplingChange(samplingPrefs.copy(topP = it)) },
|
onUpdate = { onSamplingChange(samplingPrefs.copy(topP = it)) },
|
||||||
)
|
)
|
||||||
Spacer(Modifier.height(14.dp))
|
Spacer(Modifier.height(6.dp))
|
||||||
SamplingRow(
|
SamplingRow(
|
||||||
label = stringResource(R.string.sampling_top_k),
|
label = stringResource(R.string.sampling_top_k),
|
||||||
param = samplingPrefs.topK, min = 1f, max = 100f, steps = 99,
|
param = samplingPrefs.topK, min = 1f, max = 100f, steps = 99,
|
||||||
|
|
@ -272,22 +272,22 @@ private fun ModePill(
|
||||||
val accent = LocalKaizenAccent.current
|
val accent = LocalKaizenAccent.current
|
||||||
|
|
||||||
val bg = when {
|
val bg = when {
|
||||||
active -> accent.primary.copy(alpha = if (isDark) 0.15f else 0.10f)
|
active -> accent.primary.copy(alpha = if (isDark) 0.20f else 0.12f)
|
||||||
else -> if (isDark) Color.White.copy(alpha = 0.06f) else Color.Black.copy(alpha = 0.04f)
|
else -> if (isDark) Color.White.copy(alpha = 0.10f) else Color.Black.copy(alpha = 0.07f)
|
||||||
}
|
}
|
||||||
val borderBrush = if (active) {
|
val borderBrush = if (active) {
|
||||||
Brush.verticalGradient(listOf(
|
Brush.verticalGradient(listOf(
|
||||||
accent.primary.copy(alpha = if (isDark) 0.30f else 0.22f),
|
accent.primary.copy(alpha = if (isDark) 0.40f else 0.30f),
|
||||||
accent.primary.copy(alpha = if (isDark) 0.08f else 0.06f),
|
accent.primary.copy(alpha = if (isDark) 0.12f else 0.08f),
|
||||||
))
|
))
|
||||||
} else {
|
} else {
|
||||||
Brush.verticalGradient(listOf(
|
Brush.verticalGradient(listOf(
|
||||||
if (isDark) Color.White.copy(alpha = 0.08f) else Color.White.copy(alpha = 0.40f),
|
if (isDark) Color.White.copy(alpha = 0.14f) else Color.Black.copy(alpha = 0.10f),
|
||||||
if (isDark) Color.White.copy(alpha = 0.02f) else Color.Black.copy(alpha = 0.03f),
|
if (isDark) Color.White.copy(alpha = 0.05f) else Color.Black.copy(alpha = 0.04f),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
val iconTint = if (active) accent.primary else cs.onSurfaceVariant.copy(alpha = 0.60f)
|
val iconTint = if (active) accent.primary else cs.onSurfaceVariant.copy(alpha = 0.75f)
|
||||||
val textColor = if (active) cs.onBackground else cs.onSurfaceVariant.copy(alpha = 0.70f)
|
val textColor = if (active) cs.onBackground else cs.onSurfaceVariant.copy(alpha = 0.80f)
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier
|
||||||
|
|
@ -317,7 +317,7 @@ private fun SamplingRow(label: String, param: SamplingParam, min: Float, max: Fl
|
||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
Box(
|
Box(
|
||||||
Modifier
|
Modifier
|
||||||
.size(20.dp)
|
.size(16.dp)
|
||||||
.clip(KaizenShapes.xs)
|
.clip(KaizenShapes.xs)
|
||||||
.border(
|
.border(
|
||||||
1.dp,
|
1.dp,
|
||||||
|
|
@ -329,18 +329,17 @@ private fun SamplingRow(label: String, param: SamplingParam, min: Float, max: Fl
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
if (param.enabled) {
|
if (param.enabled) {
|
||||||
Icon(KaizenIcons.Check, null, tint = accent.primary, modifier = Modifier.size(13.dp))
|
Icon(KaizenIcons.Check, null, tint = accent.primary, modifier = Modifier.size(11.dp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Spacer(Modifier.width(10.dp))
|
Spacer(Modifier.width(8.dp))
|
||||||
Text(label, color = cs.onBackground.copy(alpha = if (param.enabled) 0.90f else 0.50f), fontSize = 13.sp, modifier = Modifier.weight(1f))
|
Text(label, color = cs.onBackground.copy(alpha = if (param.enabled) 0.90f else 0.50f), fontSize = 12.sp, modifier = Modifier.weight(1f))
|
||||||
Text(
|
Text(
|
||||||
if (max > 2f) param.value.toInt().toString() else "%.2f".format(param.value),
|
if (max > 2f) param.value.toInt().toString() else "%.2f".format(param.value),
|
||||||
color = if (param.enabled) accent.primary else cs.onSurfaceVariant.copy(alpha = 0.40f),
|
color = if (param.enabled) accent.primary else cs.onSurfaceVariant.copy(alpha = 0.40f),
|
||||||
fontSize = 12.sp, fontWeight = FontWeight.Medium,
|
fontSize = 11.sp, fontWeight = FontWeight.Medium,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(Modifier.height(4.dp))
|
|
||||||
Slider(
|
Slider(
|
||||||
value = param.value, onValueChange = { onUpdate(param.copy(value = it)) },
|
value = param.value, onValueChange = { onUpdate(param.copy(value = it)) },
|
||||||
valueRange = min..max, steps = steps,
|
valueRange = min..max, steps = steps,
|
||||||
|
|
@ -353,7 +352,7 @@ private fun SamplingRow(label: String, param: SamplingParam, min: Float, max: Fl
|
||||||
disabledActiveTrackColor = cs.onSurfaceVariant.copy(alpha = 0.15f),
|
disabledActiveTrackColor = cs.onSurfaceVariant.copy(alpha = 0.15f),
|
||||||
disabledInactiveTrackColor = if (isDark) Color.White.copy(alpha = 0.05f) else Color.Black.copy(alpha = 0.04f),
|
disabledInactiveTrackColor = if (isDark) Color.White.copy(alpha = 0.05f) else Color.Black.copy(alpha = 0.04f),
|
||||||
),
|
),
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth().height(28.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue