fix(folio): embed accountId in LedgerScreen desc, expose values via text semantics

This commit is contained in:
pj committed 2026-04-25 23:33:51 +07:00
1 parent 5f197917d8
commit 1089f1a166
1 file changed
+9 -5
@@ -75,7 +75,7 @@ fun LedgerScreen(accountId: String) {
val balance = balanceOf(txns)
Screen(
modifier = Modifier.testTag("LedgerScreen").semantics { contentDescription = "LedgerScreen" },
modifier = Modifier.testTag("LedgerScreen").semantics { contentDescription = "LedgerScreen:$accountId" },
header = {
Header(
title = account.name,
@@ -92,11 +92,14 @@ fun LedgerScreen(accountId: String) {
)
},
) {
Box(Modifier.size(1.dp).semantics { contentDescription = "active_account:$accountId" })
Box(Modifier.size(1.dp).semantics { contentDescription = "ledger_balance:$balance" })
Card {
Text("BALANCE", style = Type.label, color = t.textMuted)
Text(formatCents(balance), style = Type.balance, color = t.text)
Text(
formatCents(balance),
style = Type.balance,
color = t.text,
modifier = Modifier.semantics { contentDescription = "ledger_balance_display" },
)
}
Text(
"ACTIVITY",
@@ -138,7 +141,7 @@ private fun TxnRow(id: String, type: TxnType, amount: Long, note: String, date:
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 14.dp)
.semantics(mergeDescendants = true) { contentDescription = "ledger_row:$id:$signed" },
.semantics { contentDescription = "ledger_row:$id" },
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(12.dp),
) {
@@ -166,6 +169,7 @@ private fun TxnRow(id: String, type: TxnType, amount: Long, note: String, date:
formatCents(signed, signed = true),
style = Type.bodyStrong,
color = t.text,
modifier = Modifier.semantics { contentDescription = "txn_amount" },
)
}
}