Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/api-migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ inventory check is temporarily deferred until that inventory recognizes
that renderer. The MyGo, Web, Apple, Android and shared ABI regressions remain
covered separately.

## Unreleased: Android accepts wrapping preserved text

Android's retained text-flow validator now accepts `white-space: "pre-wrap"`,
matching the existing shared OCaml and Apple vocabulary for this mode. Previously
a valid batch such as `{"op":"set-prop","id":2,"property":"white-space","value":"pre-wrap"}`
was rejected atomically, including authoritative snapshots, even though Compose
`Text` already preserves the supplied text and wraps by default.

No application wire rewrite is required: keep sending `pre-wrap` for canonical
text whose whitespace must be retained. This only corrects validation; it does
not add CSS whitespace processing or change rendering of `normal`/`nowrap`.
Android still rejects `pre-line`, `pre`, unknown strings and non-string values.

## Unreleased: Linux native clipboard ownership result

`Lui_shell_linux.clipboard_write : string -> bool` keeps its signature but
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ internal object LuiKindRules {
"user-select" ->
value.stringValue in setOf("none", "text") && isTextAppearanceKind(kind)
"white-space" ->
value.stringValue in setOf("normal", "nowrap") && isTextFlowKind(kind)
value.stringValue in setOf("normal", "nowrap", "pre-wrap") && isTextFlowKind(kind)
"text-overflow" ->
value.stringValue in setOf("clip", "ellipsis") && isTextFlowKind(kind)
"overflow" ->
Expand Down
22 changes: 22 additions & 0 deletions platform/android/lui/src/test/kotlin/dev/lui/LuiStoreTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@ class LuiStoreTest {
private fun batch(generation: Int, vararg ops: LuiPatchOp) =
LuiPatchBatch(generation, ops.toList())

@Test
fun `wrapping text retains pre-wrap and rejects unsupported whitespace modes`() {
fun apply(value: LuiWireValue): LuiRetainedTree = tree().also {
it.apply(batch(1,
LuiPatchOp.CreateNode(1L, LuiNodeKind.text),
LuiPatchOp.SetProp(1L, "white-space", value),
))
}
for (mode in listOf("normal", "nowrap", "pre-wrap")) {
val value = LuiWireValue.Str(mode)
assertEquals(value, apply(value).node(1L)!!.properties["white-space"])
}
for (value in listOf(
LuiWireValue.Str("pre"),
LuiWireValue.Str("pre-line"),
LuiWireValue.Str("wrap"),
LuiWireValue.IntValue(1),
)) {
assertThrows(LuiBackendException::class.java) { apply(value) }
}
}

@Test
fun `native menu accepts semantic label alignments and rejects invalid values`() {
fun apply(value: LuiWireValue) {
Expand Down
Loading