fix(ui): journal rail rows wrap long text instead of clipping — intrinsic-height row with defaultMinSize keeps the short-row rhythm
This commit is contained in:
parent
4f6185a6d8
commit
3373cd72d4
1 changed files with 14 additions and 4 deletions
|
|
@ -17,6 +17,8 @@ import androidx.compose.foundation.layout.Box
|
|||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.IntrinsicSize
|
||||
import androidx.compose.foundation.layout.defaultMinSize
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
|
|
@ -724,7 +726,10 @@ private fun RailRow(
|
|||
drawBottom: Boolean,
|
||||
pulse: Boolean,
|
||||
) {
|
||||
Row(Modifier.fillMaxWidth().height(if (sub.isNullOrBlank()) 42.dp else 50.dp)) {
|
||||
// Height follows the content so a long label/detail WRAPS instead of being clipped.
|
||||
// IntrinsicSize.Min lets the rail line (fillMaxHeight) stretch to whatever the wrapped
|
||||
// text needs; the text column's defaultMinSize keeps the old rhythm for short rows.
|
||||
Row(Modifier.fillMaxWidth().height(IntrinsicSize.Min)) {
|
||||
Text(
|
||||
time,
|
||||
Modifier.width(50.dp).padding(end = 12.dp, top = 3.dp),
|
||||
|
|
@ -746,14 +751,19 @@ private fun RailRow(
|
|||
RailDot(color, pulse, Modifier.align(Alignment.TopCenter).padding(top = 2.dp))
|
||||
}
|
||||
Spacer(Modifier.width(14.dp))
|
||||
Column {
|
||||
Column(
|
||||
Modifier
|
||||
.weight(1f)
|
||||
.defaultMinSize(minHeight = if (sub.isNullOrBlank()) 42.dp else 50.dp)
|
||||
.padding(bottom = 6.dp),
|
||||
) {
|
||||
Text(
|
||||
label,
|
||||
color = if (error) Vojo.danger else Vojo.text,
|
||||
fontSize = 14.5.sp, fontWeight = FontWeight.Medium, maxLines = 1, overflow = TextOverflow.Ellipsis,
|
||||
fontSize = 14.5.sp, fontWeight = FontWeight.Medium,
|
||||
)
|
||||
if (!sub.isNullOrBlank()) {
|
||||
Text(sub, color = Vojo.muted, fontFamily = Vojo.mono, fontSize = 12.sp, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
Text(sub, color = Vojo.muted, fontFamily = Vojo.mono, fontSize = 12.sp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue