M12f: S-16 lost version read-only, S-22 versions from /health, settle start without a partner (D-109 to D-111)
- Rejection.lost: RejectedVersion (the pushed entity from sync_rejections.rejected_payload as a ledger row, account, payer, split, notes, deleted); S-16 "Öppna" shows it read-only in a dialog with "Visa nuvarande version" (S-8/S-10); without one it opens the current version as before. Ledger rows take a null onClick (read-only). - AboutState.schemaVersion; AboutRepositoryImpl calls E-1 /health once per collection when online; header fallback. S-22 shows "1.1.0 (schema 3)". - SettlementRepository.start/recompute return null without a session or partner; save is Invalid(payer); no checkNotNull/requireNotNull in :data. - :feature:home screenshot harness: one more frame and an idle looper before each capture; the committed sv_dark, 200 % and dialog goldens were one variant stale (light instead of dark, en instead of sv_200). - Tests: lost version (stale, refused deletion, unreadable payload), /health online and offline, settle without a partner, category reorder PATCHes, recurring toWire splits, §9.2 effect cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
This commit is contained in:
@@ -82,9 +82,10 @@ private fun String.lowerFirst(): String = replaceFirstChar { it.lowercaseChar()
|
||||
* An expense as a segmented-group item (design-spec §3.5): category tile 40, description over the effect line, amount
|
||||
* over the date with the pending marker. At ≥ 1.5× font scale the amount column moves under the text. One node:
|
||||
* "ICA Maxi Lindhagen, Mat & hushåll, 1 247,60 kronor, 16 oktober, du lånade 623,80 kronor, väntar på synk".
|
||||
* [onClick] null draws the row read-only, without a ripple or the button role (S-16's lost version, D-109).
|
||||
*/
|
||||
@Composable
|
||||
fun ExpenseRow(item: SegmentedItemScope, row: LedgerRow.ExpenseRow, onClick: () -> Unit, modifier: Modifier = Modifier) {
|
||||
fun ExpenseRow(item: SegmentedItemScope, row: LedgerRow.ExpenseRow, onClick: (() -> Unit)?, modifier: Modifier = Modifier) {
|
||||
val separator = stringResource(R.string.common_separator_comma)
|
||||
val spoken = listOfNotNull(
|
||||
row.description,
|
||||
@@ -110,7 +111,7 @@ fun ExpenseRow(item: SegmentedItemScope, row: LedgerRow.ExpenseRow, onClick: ()
|
||||
* One node "Anna betalade dig 800,00 kronor, 2 konton, 6 oktober".
|
||||
*/
|
||||
@Composable
|
||||
fun SettlementRow(item: SegmentedItemScope, row: LedgerRow.SettlementRow, typeLabel: String, onClick: () -> Unit, modifier: Modifier = Modifier) {
|
||||
fun SettlementRow(item: SegmentedItemScope, row: LedgerRow.SettlementRow, typeLabel: String, onClick: (() -> Unit)?, modifier: Modifier = Modifier) {
|
||||
val household = LocalKvittHousehold.current
|
||||
val accounts = pluralStringResource(R.plurals.ledger_settlement_accounts, row.accountCount, row.accountCount)
|
||||
val title = settlementSentence(row.from, row.to, money(row.amountOre), household.isViewer(row.to.id))
|
||||
@@ -155,7 +156,7 @@ fun SettlementTile(size: Dp, modifier: Modifier = Modifier) {
|
||||
@Composable
|
||||
private fun LedgerItem(
|
||||
item: SegmentedItemScope,
|
||||
onClick: () -> Unit,
|
||||
onClick: (() -> Unit)?,
|
||||
spoken: String,
|
||||
modifier: Modifier,
|
||||
fill: androidx.compose.ui.graphics.Color,
|
||||
@@ -168,8 +169,11 @@ private fun LedgerItem(
|
||||
.fillMaxWidth()
|
||||
.clip(item.shape)
|
||||
.background(fill)
|
||||
.clickable(onClick = onClick)
|
||||
.clearAndSetSemantics { contentDescription = spoken; role = Role.Button }
|
||||
.then(if (onClick != null) Modifier.clickable(onClick = onClick) else Modifier)
|
||||
.clearAndSetSemantics {
|
||||
contentDescription = spoken
|
||||
if (onClick != null) role = Role.Button
|
||||
}
|
||||
.heightIn(min = KvittTheme.spacing.ledgerRowMin)
|
||||
.padding(horizontal = KvittTheme.spacing.rowHorizontal, vertical = KvittTheme.spacing.rowVertical),
|
||||
verticalAlignment = if (large) Alignment.Top else Alignment.CenterVertically,
|
||||
|
||||
Reference in New Issue
Block a user