Make jump-to-latest the same chevron, pointing down
It was a labelled button beside a tool group that collapses with a drawn chevron -- two controls doing the same kind of thing in two visual languages. Now one `Chevron` composable serves both directions, parameterised rather than copied, since a pair that differs by a minus sign drifts and the drift is a bug in exactly one direction. The comment it replaces argued against an arrow here, on the grounds that the list is laid out upside down. That reasoning was about the code: nobody reading the screen knows the list is reversed, and on screen the newest message is at the bottom, which is where this goes. It draws no text, so the name lives in its content description -- the whole of what a screen reader has, and the answer to "what was that arrow for" later. Verified on the emulator: scrolled up, the chevron appears bottom centre matching the group's; tapped, it returns to the newest message and takes itself away. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
011ed0d0e1
commit
73923dbbc3
3 files changed
+78
-26
No files matched your search
@@ -132,25 +132,7 @@ private fun CollapseBar(onToggle: () -> Unit) {
|
||||
.padding(vertical = 10.dp),
|
||||
horizontalArrangement = Arrangement.Center,
|
||||
) {
|
||||
// Drawn rather than set in a font: a chevron from an icon font is one of the glyphs a
|
||||
// system font may simply not have, and the reader who gets the empty box is never me.
|
||||
androidx.compose.foundation.Canvas(Modifier.width(20.dp).height(10.dp)) {
|
||||
val inset = 2.dp.toPx()
|
||||
drawLine(
|
||||
colour,
|
||||
Offset(inset, size.height - inset),
|
||||
Offset(size.width / 2, inset),
|
||||
strokeWidth = 2.dp.toPx(),
|
||||
cap = StrokeCap.Round,
|
||||
)
|
||||
drawLine(
|
||||
colour,
|
||||
Offset(size.width / 2, inset),
|
||||
Offset(size.width - inset, size.height - inset),
|
||||
strokeWidth = 2.dp.toPx(),
|
||||
cap = StrokeCap.Round,
|
||||
)
|
||||
}
|
||||
Chevron(pointingUp = true, colour = colour)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user