Fix close icon hidden by long file name in compose file preview (#7077)

A long file name took all the row width and squeezed the cancel (X)
icon to zero, so the file could not be dismissed before sending.
Give the file-name text the layout weight and a single line (Compose),
and lineLimit(1) on iOS, so it truncates and the close icon keeps its
space. Affects Android, Desktop and iOS.
This commit is contained in:
Narasimha-sc
2026-06-17 19:27:55 +01:00
committed by GitHub
parent e60a012d22
commit feebefcdd7
3 changed files with 79 additions and 2 deletions
@@ -33,8 +33,7 @@ fun ComposeFileView(fileName: String, cancelFile: () -> Unit, cancelEnabled: Boo
.size(36.dp),
tint = if (isInDarkTheme()) FileDark else FileLight
)
Text(fileName)
Spacer(Modifier.weight(1f))
Text(fileName, maxLines = 1, modifier = Modifier.weight(1f))
if (cancelEnabled) {
IconButton(onClick = cancelFile, modifier = Modifier.padding(0.dp)) {
Icon(