core:design: remove unused editor chips after D-102/D-107
AccountChip, PayerChip and SplitChip had no callers outside the debug catalogue once S-7 and S-9 moved to option rows. The editor_chips sheet keeps the date chip that S-9 still uses; its four goldens re-recorded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
This commit is contained in:
+1
-10
@@ -30,7 +30,6 @@ import se.hagstedt.kvitt.design.chart.StackedBarChart
|
|||||||
import se.hagstedt.kvitt.design.chart.TotalCard
|
import se.hagstedt.kvitt.design.chart.TotalCard
|
||||||
import se.hagstedt.kvitt.design.component.AccountBalanceHeader
|
import se.hagstedt.kvitt.design.component.AccountBalanceHeader
|
||||||
import se.hagstedt.kvitt.design.component.AccountCard
|
import se.hagstedt.kvitt.design.component.AccountCard
|
||||||
import se.hagstedt.kvitt.design.component.AccountChip
|
|
||||||
import se.hagstedt.kvitt.design.component.AccountChoice
|
import se.hagstedt.kvitt.design.component.AccountChoice
|
||||||
import se.hagstedt.kvitt.design.component.AccountHeaderWords
|
import se.hagstedt.kvitt.design.component.AccountHeaderWords
|
||||||
import se.hagstedt.kvitt.design.component.AccountPicker
|
import se.hagstedt.kvitt.design.component.AccountPicker
|
||||||
@@ -91,7 +90,6 @@ import se.hagstedt.kvitt.design.component.MoneyText
|
|||||||
import se.hagstedt.kvitt.design.component.NeedsConnectionBanner
|
import se.hagstedt.kvitt.design.component.NeedsConnectionBanner
|
||||||
import se.hagstedt.kvitt.design.component.NeedsConnectionHint
|
import se.hagstedt.kvitt.design.component.NeedsConnectionHint
|
||||||
import se.hagstedt.kvitt.design.component.NotesField
|
import se.hagstedt.kvitt.design.component.NotesField
|
||||||
import se.hagstedt.kvitt.design.component.PayerChip
|
|
||||||
import se.hagstedt.kvitt.design.component.PersonAvatar
|
import se.hagstedt.kvitt.design.component.PersonAvatar
|
||||||
import se.hagstedt.kvitt.design.component.ProvideHousehold
|
import se.hagstedt.kvitt.design.component.ProvideHousehold
|
||||||
import se.hagstedt.kvitt.design.component.RatioEditor
|
import se.hagstedt.kvitt.design.component.RatioEditor
|
||||||
@@ -102,7 +100,6 @@ import se.hagstedt.kvitt.design.component.SegmentedGroup
|
|||||||
import se.hagstedt.kvitt.design.component.SettingsRow
|
import se.hagstedt.kvitt.design.component.SettingsRow
|
||||||
import se.hagstedt.kvitt.design.component.Skeleton
|
import se.hagstedt.kvitt.design.component.Skeleton
|
||||||
import se.hagstedt.kvitt.design.component.SplitBar
|
import se.hagstedt.kvitt.design.component.SplitBar
|
||||||
import se.hagstedt.kvitt.design.component.SplitChip
|
|
||||||
import se.hagstedt.kvitt.design.component.SplitPreview
|
import se.hagstedt.kvitt.design.component.SplitPreview
|
||||||
import se.hagstedt.kvitt.design.component.SplitSection
|
import se.hagstedt.kvitt.design.component.SplitSection
|
||||||
import se.hagstedt.kvitt.design.component.SplitSlider
|
import se.hagstedt.kvitt.design.component.SplitSlider
|
||||||
@@ -346,17 +343,11 @@ fun CategoryGridSheetContent() {
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ChipsSheet() {
|
fun ChipsSheet() {
|
||||||
|
// The date chip of S-9 (D-102 replaced the S-7 chips with option rows).
|
||||||
EditorChipRow {
|
EditorChipRow {
|
||||||
AccountChip("Vardag", 0, {})
|
|
||||||
DateChip("2026-10-17", {})
|
DateChip("2026-10-17", {})
|
||||||
PayerChip(Samples.jacob, Samples.anna, {})
|
|
||||||
SplitChip(defaultModeLabel(viewerPercentOf(Samples.vardag.defaultShares, Samples.jacob.id)), open = false, onClick = {})
|
|
||||||
}
|
|
||||||
EditorChipRow {
|
|
||||||
DateChip("2026-10-16", {})
|
DateChip("2026-10-16", {})
|
||||||
DateChip("2026-10-14", {})
|
DateChip("2026-10-14", {})
|
||||||
PayerChip(Samples.anna, Samples.jacob, {})
|
|
||||||
SplitChip(w("Exakta belopp", "Exact amounts"), open = true, onClick = {})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -417,14 +417,6 @@ fun EditorChipRow(modifier: Modifier = Modifier, content: @Composable () -> Unit
|
|||||||
FlowRow(modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(KvittDimens.chipGap)) { content() }
|
FlowRow(modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(KvittDimens.chipGap)) { content() }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The account chip: a 12 dp dot in the account's chart colour, its name, `expand_more`; TalkBack "Konto: Vardag".
|
|
||||||
*/
|
|
||||||
@Composable
|
|
||||||
fun AccountChip(name: String, colorIndex: Int, onClick: () -> Unit, modifier: Modifier = Modifier) {
|
|
||||||
EditorChip(name, stringResource(R.string.editor_account_spoken, name), onClick, modifier, leading = { AccountDot(colorIndex) })
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The date chip: `event`, "Idag" / "Igår" / "14 okt."; TalkBack "Datum: idag". */
|
/** The date chip: `event`, "Idag" / "Igår" / "14 okt."; TalkBack "Datum: idag". */
|
||||||
@Composable
|
@Composable
|
||||||
fun DateChip(isoDate: String, onClick: () -> Unit, modifier: Modifier = Modifier, keyPrefix: String? = null) {
|
fun DateChip(isoDate: String, onClick: () -> Unit, modifier: Modifier = Modifier, keyPrefix: String? = null) {
|
||||||
@@ -439,37 +431,6 @@ fun DateChip(isoDate: String, onClick: () -> Unit, modifier: Modifier = Modifier
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The payer chip: payer avatar 24, "Betalt av Du", `swap_horiz`; one tap toggles (AC-8.3). */
|
|
||||||
@Composable
|
|
||||||
fun PayerChip(payer: User, other: User, onToggle: () -> Unit, modifier: Modifier = Modifier) {
|
|
||||||
val prefix = stringResource(R.string.editor_paid_by) + " "
|
|
||||||
EditorChip(
|
|
||||||
personName(payer),
|
|
||||||
stringResource(R.string.editor_paid_by_toggle, personNameInSentence(payer), personNameInSentence(other)),
|
|
||||||
onToggle,
|
|
||||||
modifier,
|
|
||||||
keyPrefix = prefix,
|
|
||||||
trailing = KvittIcon.SwapHoriz,
|
|
||||||
leading = { PersonAvatar(payer, KvittDimens.avatarChip) },
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The split chip: `call_split`, "Delning <mode>", expand_more / expand_less; selected while the section is open. */
|
|
||||||
@Composable
|
|
||||||
fun SplitChip(modeLabel: String, open: Boolean, onClick: () -> Unit, modifier: Modifier = Modifier) {
|
|
||||||
val prefix = stringResource(R.string.editor_split)
|
|
||||||
EditorChip(
|
|
||||||
modeLabel,
|
|
||||||
"$prefix: ${modeLabel.replaceFirstChar { it.lowercaseChar() }}",
|
|
||||||
onClick,
|
|
||||||
modifier,
|
|
||||||
keyPrefix = "$prefix ",
|
|
||||||
selected = open,
|
|
||||||
trailing = if (open) KvittIcon.ExpandLess else KvittIcon.ExpandMore,
|
|
||||||
leading = { KvittIconImage(KvittIcon.CallSplit, null, size = KvittDimens.iconChip) },
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** "Idag" / "Igår" / "14 okt." (§9.8 list format) for the date chip and the date option row. */
|
/** "Idag" / "Igår" / "14 okt." (§9.8 list format) for the date chip and the date option row. */
|
||||||
@Composable
|
@Composable
|
||||||
private fun relativeDate(isoDate: String): String {
|
private fun relativeDate(isoDate: String): String {
|
||||||
|
|||||||
Reference in New Issue
Block a user