1package com.peachpasswords.ui.settings23import android.content.Intent4import android.net.Uri5import androidx.compose.animation.AnimatedVisibility6import androidx.compose.animation.core.animateDpAsState7import androidx.compose.foundation.background8import androidx.compose.foundation.border9import androidx.compose.foundation.clickable10import androidx.compose.foundation.layout.Arrangement11import androidx.compose.foundation.layout.Box12import androidx.compose.foundation.layout.Column13import androidx.compose.foundation.layout.FlowRow14import androidx.compose.foundation.layout.ExperimentalLayoutApi15import androidx.compose.foundation.layout.Row16import androidx.compose.foundation.layout.RowScope17import androidx.compose.foundation.layout.Spacer18import androidx.compose.foundation.layout.fillMaxWidth19import androidx.compose.foundation.layout.height20import androidx.compose.foundation.layout.padding21import androidx.compose.foundation.layout.size22import androidx.compose.foundation.layout.width23import androidx.compose.foundation.shape.CircleShape24import androidx.compose.foundation.shape.RoundedCornerShape25import androidx.compose.foundation.text.BasicTextField26import androidx.compose.runtime.Composable27import androidx.compose.runtime.collectAsState28import androidx.compose.runtime.getValue29import androidx.compose.runtime.mutableStateOf30import androidx.compose.runtime.remember31import androidx.compose.runtime.rememberCoroutineScope32import androidx.compose.runtime.setValue33import androidx.compose.ui.Alignment34import androidx.compose.ui.Modifier35import androidx.compose.ui.draw.clip36import androidx.compose.ui.graphics.Color37import androidx.compose.ui.graphics.SolidColor38import androidx.compose.ui.platform.LocalContext39import androidx.compose.ui.text.TextStyle40import androidx.compose.ui.text.font.FontStyle41import androidx.compose.ui.text.input.PasswordVisualTransformation42import androidx.compose.ui.unit.Dp43import androidx.compose.ui.unit.dp44import androidx.compose.ui.unit.em45import androidx.compose.ui.unit.sp46import androidx.compose.material3.Text47import com.peachpasswords.ui.PeachNav48import com.peachpasswords.ui.theme.ACCENT_COLORS49import com.peachpasswords.ui.theme.PeachType50import com.peachpasswords.vault.VaultSettings51import kotlinx.coroutines.launch5253private const val PRO_URL = "https://buy.polar.sh/polar_cl_IXSFIPojx67rcOTksn8LkH5mnU3osPHtYqBIl1eyuIz"545556575859606162@Composable63fun CardBody(64 id: CardId,65 fg: Color,66 vm: SettingsViewModel,67 settings: VaultSettings,68 entriesCount: Int,69 onNavigate: (PeachNav) -> Unit,70) {71 when (id) {72 CardId.Appearance -> AppearanceBody(fg, vm, settings)73 CardId.Protection -> ProtectionBody(fg, vm, settings, onNavigate)74 CardId.Vault -> VaultBody(fg, vm, settings, entriesCount, onNavigate)75 CardId.Sync -> SyncBody(fg, onNavigate)76 CardId.Shortcuts -> ShortcutsBody(fg)77 CardId.Pro -> ProBody(fg, vm)78 CardId.Feedback -> FeedbackBody(fg)79 }80}81828384@Composable85private fun SubLabel(text: String, fg: Color, top: Dp = 14.dp) {86 Text(87 text,88 modifier = Modifier.padding(top = top, bottom = 4.dp),89 color = fg.copy(alpha = 0.58f),90 fontFamily = PeachType.Mono,91 fontSize = 8.sp,92 letterSpacing = 0.22.em,93 )94}9596@Composable97private fun RowLine(fg: Color, content: @Composable RowScope.() -> Unit) {98 Row(99 Modifier.fillMaxWidth().padding(vertical = 9.dp),100 verticalAlignment = Alignment.CenterVertically,101 horizontalArrangement = Arrangement.SpaceBetween,102 content = content,103 )104 Box(Modifier.fillMaxWidth().height(1.dp).background(fg.copy(alpha = 0.12f)))105}106107@Composable108private fun RowScope.Name(text: String, fg: Color) {109 Text(text, color = fg, fontFamily = PeachType.Body, fontSize = 13.sp, modifier = Modifier.weight(1f))110}111112@Composable113private fun ValueText(text: String, fg: Color) {114 Text(text, color = fg.copy(alpha = 0.7f), fontFamily = PeachType.Mono, fontSize = 11.sp)115}116117@Composable118private fun SubtleButton(label: String, fg: Color, onClick: () -> Unit) {119 Box(120 Modifier.clip(RoundedCornerShape(8.dp))121 .border(1.dp, fg.copy(alpha = 0.28f), RoundedCornerShape(8.dp))122 .background(fg.copy(alpha = 0.08f))123 .clickable(onClick = onClick)124 .padding(horizontal = 12.dp, vertical = 6.dp),125 ) {126 Text(label, color = fg, fontFamily = PeachType.Mono, fontSize = 11.sp)127 }128}129130@Composable131private fun Toggle(on: Boolean, fg: Color, onToggle: (Boolean) -> Unit) {132 val knob by animateDpAsState(if (on) 16.dp else 2.dp, label = "knob")133 Box(134 Modifier.size(width = 34.dp, height = 20.dp).clip(RoundedCornerShape(999.dp))135 .background(if (on) fg.copy(alpha = 0.28f) else fg.copy(alpha = 0.08f))136 .border(1.dp, fg.copy(alpha = if (on) 0.5f else 0.32f), RoundedCornerShape(999.dp))137 .clickable { onToggle(!on) },138 ) {139 Box(140 Modifier.padding(top = 2.dp).width(16.dp).fillMaxWidth().height(16.dp)141 .padding(start = knob - 2.dp)142 .size(14.dp).clip(CircleShape)143 .background(if (on) fg else fg.copy(alpha = 0.58f)),144 )145 }146}147148@Composable149private fun Pill(label: String, active: Boolean, fg: Color, onClick: () -> Unit) {150 Box(151 Modifier.clip(RoundedCornerShape(999.dp))152 .border(1.dp, fg.copy(alpha = if (active) 0.55f else 0.32f), RoundedCornerShape(999.dp))153 .background(if (active) fg.copy(alpha = 0.18f) else Color.Transparent)154 .clickable(onClick = onClick)155 .padding(horizontal = 12.dp, vertical = 5.dp),156 ) {157 Text(label, color = fg, fontFamily = PeachType.Mono, fontSize = 10.sp)158 }159}160161@Composable162private fun ProBadge(fg: Color) {163 Box(164 Modifier.padding(start = 6.dp).clip(RoundedCornerShape(4.dp))165 .background(fg.copy(alpha = 0.16f)).padding(horizontal = 5.dp, vertical = 1.dp),166 ) {167 Text("Pro", color = fg.copy(alpha = 0.85f), fontFamily = PeachType.Mono, fontSize = 8.sp)168 }169}170171@Composable172private fun Hint(text: String, fg: Color) {173 Text(174 text,175 modifier = Modifier.padding(top = 6.dp),176 color = fg.copy(alpha = 0.6f),177 fontFamily = PeachType.Display,178 fontStyle = FontStyle.Italic,179 fontSize = 11.5.sp,180 lineHeight = 16.sp,181 )182}183184185186@OptIn(ExperimentalLayoutApi::class)187@Composable188private fun AppearanceBody(fg: Color, vm: SettingsViewModel, s: VaultSettings) {189 SubLabel("THEME", fg, top = 0.dp)190 RowLine(fg) {191 Name("Theme", fg)192 SubtleButton(if (s.theme == "dark") "Switch to light" else "Switch to dark", fg) {193 vm.setTheme(if (s.theme == "dark") "light" else "dark")194 }195 }196 SubLabel("ACCENT", fg)197 FlowRow(horizontalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) {198 ACCENT_COLORS.forEach { (name, color) ->199 Box(200 Modifier.size(22.dp).clip(CircleShape).background(color)201 .border(202 if (s.accentColor == name) 2.dp else 1.dp,203 if (s.accentColor == name) fg else fg.copy(alpha = 0.2f),204 CircleShape,205 )206 .clickable { vm.setAccent(name) },207 )208 }209 }210 SubLabel("TEXT SIZE", fg)211 RowLine(fg) {212 Name("Size", fg)213 Row(horizontalArrangement = Arrangement.spacedBy(6.dp)) {214 Pill("Default", s.textSize == "medium", fg) { vm.setTextSize("medium") }215 Pill("Large", s.textSize == "large", fg) { vm.setTextSize("large") }216 }217 }218 SubLabel("MOTION", fg)219 RowLine(fg) {220 Name("Reduce motion", fg)221 SubtleButton(if (s.reduceMotion) "On" else "Off", fg) { vm.setReduceMotion(!s.reduceMotion) }222 }223}224225226227@Composable228private fun ProtectionBody(fg: Color, vm: SettingsViewModel, s: VaultSettings, onNavigate: (PeachNav) -> Unit) {229 val lockOptions = listOf(1 to "1 minute", 5 to "5 minutes", 15 to "15 minutes", 30 to "30 minutes", 0 to "Never")230 val current = s.autoLockMinutes ?: 0231232 SubLabel("LOCKING", fg, top = 0.dp)233 RowLine(fg) {234 Name("Auto-lock after", fg)235 val idx = lockOptions.indexOfFirst { it.first == current }.coerceAtLeast(0)236 SubtleButton(lockOptions[idx].second, fg) {237 val next = lockOptions[(idx + 1) % lockOptions.size].first238 vm.setAutoLockMinutes(if (next == 0) 0 else next)239 }240 }241 SubLabel("BIOMETRICS", fg)242 RowLine(fg) {243 Name("Unlock with biometrics", fg)244 Toggle(s.biometricsEnabled, fg) { vm.setBiometrics(it) }245 }246 val bioError = com.peachpasswords.ui.lock.Biometrics.statusMessage(LocalContext.current)247 if (bioError != null) {248 Text(249 bioError,250 color = com.peachpasswords.ui.theme.PeachColors.Breach,251 fontFamily = PeachType.Mono, fontSize = 10.sp,252 modifier = Modifier.padding(start = 2.dp, top = 2.dp, bottom = 4.dp),253 )254 }255 SubLabel("RECOVERY", fg)256 RowLine(fg) {257 Name("View recovery words", fg)258 SubtleButton("view", fg) { onNavigate(PeachNav.RecoveryView) }259 }260 SubLabel("BREACH PROTECTION", fg)261 RowLine(fg) {262 Name("Breach monitoring", fg)263 Toggle(s.breachMonitoring, fg) { vm.setBreachMonitoring(it) }264 }265266 SubLabel("MASTER PASSWORD", fg)267 ChangePasswordRow(fg, vm)268269 SubLabel("DURESS PASSWORD", fg)270 RowLine(fg) {271 Row(Modifier.weight(1f), verticalAlignment = Alignment.CenterVertically) {272 Name("Duress password", fg); ProBadge(fg)273 }274 ValueText("off", fg)275 }276 Hint("If entered under coercion, a decoy empty vault opens; your real vault stays hidden. Arrives with Pro sync.", fg)277}278279@Composable280private fun ChangePasswordRow(fg: Color, vm: SettingsViewModel) {281 var open by remember { mutableStateOf(false) }282 var current by remember { mutableStateOf("") }283 var next by remember { mutableStateOf("") }284 var confirm by remember { mutableStateOf("") }285 var error by remember { mutableStateOf<String?>(null) }286 var done by remember { mutableStateOf(false) }287 val scope = rememberCoroutineScope()288289 RowLine(fg) {290 Name("Master password", fg)291 SubtleButton(if (open) "cancel" else "change", fg) { open = !open; error = null; done = false }292 }293 AnimatedVisibility(open) {294 Column(Modifier.fillMaxWidth().padding(top = 8.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) {295 PwField("current password", current, fg) { current = it }296 PwField("new password (min 12 chars)", next, fg) { next = it }297 PwField("confirm new password", confirm, fg) { confirm = it }298 error?.let { Text(it, color = Color(0xFFE5805C), fontFamily = PeachType.Mono, fontSize = 10.sp) }299 if (done) Text("password changed ✓", color = fg, fontFamily = PeachType.Mono, fontSize = 10.sp)300 SubtleButton("save new password", fg) {301 error = when {302 current.isBlank() -> "enter your current password"303 next.length < 12 -> "new password must be at least 12 characters"304 next != confirm -> "new passwords do not match"305 next == current -> "new password must differ from current"306 else -> null307 }308 if (error == null) scope.launch {309 if (vm.changePassword(current, next)) {310 current = ""; next = ""; confirm = ""; open = false; done = true311 } else error = "incorrect current password"312 }313 }314 }315 }316}317318@Composable319private fun PwField(placeholder: String, value: String, fg: Color, onChange: (String) -> Unit) {320 Box(321 Modifier.fillMaxWidth().clip(RoundedCornerShape(8.dp))322 .background(Color(0x2E000000))323 .border(1.dp, fg.copy(alpha = 0.22f), RoundedCornerShape(8.dp))324 .padding(horizontal = 10.dp, vertical = 10.dp),325 ) {326 if (value.isEmpty()) {327 Text(placeholder, color = fg.copy(alpha = 0.42f), fontFamily = PeachType.Mono, fontSize = 12.sp)328 }329 BasicTextField(330 value = value,331 onValueChange = onChange,332 singleLine = true,333 textStyle = TextStyle(color = fg, fontFamily = PeachType.Mono, fontSize = 12.sp),334 cursorBrush = SolidColor(fg),335 visualTransformation = PasswordVisualTransformation(),336 modifier = Modifier.fillMaxWidth(),337 )338 }339}340341342343@Composable344private fun VaultBody(345 fg: Color,346 vm: SettingsViewModel,347 s: VaultSettings,348 entriesCount: Int,349 onNavigate: (PeachNav) -> Unit,350) {351 val trashOptions = listOf(7 to "7 days", 30 to "30 days", 90 to "90 days", 0 to "Never")352 val current = s.trashRetentionDays ?: 0353354 SubLabel("ENTRIES", fg, top = 0.dp)355 RowLine(fg) { Name("Entries", fg); ValueText("$entriesCount", fg) }356357 SubLabel("MAINTENANCE", fg)358 RowLine(fg) {359 Name("Trash auto-delete", fg)360 val idx = trashOptions.indexOfFirst { it.first == current }.coerceAtLeast(0)361 SubtleButton(trashOptions[idx].second, fg) {362 vm.setTrashRetentionDays(trashOptions[(idx + 1) % trashOptions.size].first)363 }364 }365 RowLine(fg) { Name("Advanced Vault Health", fg); SubtleButton("open", fg) { onNavigate(PeachNav.Health) } }366 RowLine(fg) { Name("Trash", fg); SubtleButton("open", fg) { onNavigate(PeachNav.Trash) } }367368 SubLabel("DATA", fg)369 RowLine(fg) { Name("Import passwords", fg); SubtleButton("open", fg) { onNavigate(PeachNav.Import) } }370 RowLine(fg) { Name("Export backup", fg); SubtleButton("open", fg) { onNavigate(PeachNav.Export) } }371 RowLine(fg) {372 Row(Modifier.weight(1f), verticalAlignment = Alignment.CenterVertically) { Name("Peach Codex", fg); ProBadge(fg) }373 SubtleButton("open", fg) { onNavigate(PeachNav.CodexGenerate) }374 }375 RowLine(fg) { Name("Restore from Codex", fg); SubtleButton("open", fg) { onNavigate(PeachNav.CodexRestore) } }376377 var advancedOpen by remember { mutableStateOf(false) }378 SubLabel("ADVANCED", fg)379 RowLine(fg) {380 Name("Advanced", fg)381 SubtleButton(if (advancedOpen) "hide" else "show", fg) { advancedOpen = !advancedOpen }382 }383 if (advancedOpen) {384 RowLine(fg) {385 Name("Replace vault from backup", com.peachpasswords.ui.theme.PeachColors.SyncBusy)386 SubtleButton("open", com.peachpasswords.ui.theme.PeachColors.SyncBusy) { onNavigate(PeachNav.Import) }387 }388 RowLine(fg) {389 Name("Destroy vault", com.peachpasswords.ui.theme.PeachColors.Breach)390 SubtleButton("destroy", com.peachpasswords.ui.theme.PeachColors.Breach) { onNavigate(PeachNav.Panic) }391 }392 }393}394395396397@Composable398private fun SyncBody(fg: Color, onNavigate: (PeachNav) -> Unit) {399 SubLabel("PAIRING", fg, top = 0.dp)400 RowLine(fg) {401 Column(Modifier.weight(1f)) {402 Row(verticalAlignment = Alignment.CenterVertically) {403 Text("Peach Sync", color = fg, fontFamily = PeachType.Body, fontSize = 13.sp); ProBadge(fg)404 }405 Text(406 "Pair nearby devices by chirp and keep encrypted vault blobs in step without a central account.",407 color = fg.copy(alpha = 0.7f), fontFamily = PeachType.Body, fontSize = 11.sp, lineHeight = 16.sp,408 modifier = Modifier.padding(top = 2.dp),409 )410 }411 }412 RowLine(fg) { Name("Status", fg); ValueText("Requires Pro", fg) }413 RowLine(fg) { Name("Sync hub", fg); SubtleButton("open", fg) { onNavigate(PeachNav.ChirpPair) } }414415 SubLabel("DEVICE FLOW", fg)416 RowLine(fg) { Name("Pair new device", fg); SubtleButton("pair", fg) { onNavigate(PeachNav.ChirpPair) } }417 Hint("Sync uses the same zero-knowledge vault format as backup and restore; pairing authorizes a device, not a cloud account.", fg)418}419420421422@Composable423private fun ShortcutsBody(fg: Color) {424 val bindings = listOf(425 "Copy password" to "⌘C", "Copy username" to "⌘⇧C", "Open entry" to "↵",426 "Edit entry" to "E", "New entry" to "⌘N", "Search" to "/",427 )428 SubLabel("KEYBINDINGS", fg, top = 0.dp)429 Hint("Shortcuts apply when a hardware keyboard is attached. Defaults shown below.", fg)430 Spacer(Modifier.height(8.dp))431 bindings.forEach { (label, key) ->432 RowLine(fg) {433 Name(label, fg)434 Box(435 Modifier.clip(RoundedCornerShape(4.dp)).background(fg.copy(alpha = 0.06f))436 .border(1.dp, fg.copy(alpha = 0.32f), RoundedCornerShape(4.dp))437 .padding(horizontal = 7.dp, vertical = 2.dp),438 ) { Text(key, color = fg, fontFamily = PeachType.Mono, fontSize = 10.sp) }439 }440 }441}442443444445@Composable446private fun ProBody(fg: Color, vm: SettingsViewModel) {447 val ctx = LocalContext.current448 val isPro by vm.isPro.collectAsState()449 if (isPro) {450 ProActiveBody(fg, vm)451 return452 }453 val features = listOf(454 "Peach Sync" to "Encrypted · peer-to-peer",455 "Peach Codex" to "Restore from paper",456 "Passkeys" to "Zero-knowledge WebAuthn",457 "Advanced Vault Health" to "Reuse · age · exposure",458 "Canary entries" to "Detects vault compromise",459 "Duress vault" to "Decoy under coercion",460 )461 Text("PEACH PRO · ONE-TIME", color = fg.copy(alpha = 0.6f), fontFamily = PeachType.Mono, fontSize = 8.sp, letterSpacing = 0.22.em)462 Text(463 "Everything, everywhere.",464 modifier = Modifier.padding(top = 8.dp),465 color = fg, fontFamily = PeachType.Display, fontStyle = FontStyle.Italic, fontSize = 24.sp,466 )467 Text(468 "One key unlocks every Pro feature — for the lifetime of the app.",469 modifier = Modifier.padding(top = 6.dp),470 color = fg.copy(alpha = 0.72f), fontFamily = PeachType.Body, fontSize = 12.sp, lineHeight = 17.sp,471 )472 Spacer(Modifier.height(12.dp))473 features.forEachIndexed { i, (name, desc) ->474 RowLine(fg) {475 Row(Modifier.weight(1f), verticalAlignment = Alignment.CenterVertically) {476 Text("%02d".format(i + 1), color = fg.copy(alpha = 0.5f), fontFamily = PeachType.Mono, fontSize = 10.sp, modifier = Modifier.padding(end = 10.dp))477 Text(name, color = fg, fontFamily = PeachType.Body, fontSize = 13.sp)478 }479 Text(desc, color = fg.copy(alpha = 0.6f), fontFamily = PeachType.Display, fontStyle = FontStyle.Italic, fontSize = 11.sp)480 }481 }482 Spacer(Modifier.height(14.dp))483 Text(484 "$39",485 color = fg, fontFamily = PeachType.Display, fontStyle = FontStyle.Italic, fontSize = 28.sp,486 )487 Text("once · yours forever", color = fg.copy(alpha = 0.6f), fontFamily = PeachType.Mono, fontSize = 9.sp, letterSpacing = 0.18.em)488 Spacer(Modifier.height(10.dp))489 Box(490 Modifier.fillMaxWidth().clip(RoundedCornerShape(10.dp))491 .background(fg.copy(alpha = 0.16f))492 .border(1.dp, fg.copy(alpha = 0.4f), RoundedCornerShape(10.dp))493 .clickable {494 runCatching { ctx.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(PRO_URL))) }495 }496 .padding(vertical = 12.dp),497 contentAlignment = Alignment.Center,498 ) { Text("Get Peach Pro", color = fg, fontFamily = PeachType.Mono, fontSize = 12.sp) }499500 Spacer(Modifier.height(16.dp))501 Text("LICENSE KEY", color = fg.copy(alpha = 0.6f), fontFamily = PeachType.Mono, fontSize = 8.sp, letterSpacing = 0.22.em)502 var key by remember { mutableStateOf("") }503 val activating by vm.activating.collectAsState()504 val activationError by vm.activationError.collectAsState()505 Box(506 Modifier.fillMaxWidth().padding(top = 6.dp)507 .border(1.dp, fg.copy(alpha = 0.3f), RoundedCornerShape(8.dp))508 .padding(horizontal = 12.dp, vertical = 10.dp),509 ) {510 BasicTextField(511 value = key,512 onValueChange = { key = it.uppercase(); vm.clearActivationError() },513 singleLine = true,514 textStyle = TextStyle(fontFamily = PeachType.Mono, fontSize = 13.sp, letterSpacing = 0.12.em, color = fg),515 cursorBrush = SolidColor(fg),516 modifier = Modifier.fillMaxWidth(),517 decorationBox = { inner ->518 if (key.isEmpty()) Text("PPK-XXXX-XXXX-XXXX", color = fg.copy(alpha = 0.3f), fontFamily = PeachType.Mono, fontSize = 13.sp, letterSpacing = 0.12.em)519 inner()520 },521 )522 }523 if (activationError != null) {524 Text(activationError!!, color = com.peachpasswords.ui.theme.PeachColors.Breach, fontFamily = PeachType.Mono, fontSize = 10.sp, modifier = Modifier.padding(top = 6.dp))525 }526 Spacer(Modifier.height(8.dp))527 Box(528 Modifier.fillMaxWidth().clip(RoundedCornerShape(10.dp))529 .background(fg.copy(alpha = if (activating || key.isBlank()) 0.08f else 0.16f))530 .border(1.dp, fg.copy(alpha = 0.4f), RoundedCornerShape(10.dp))531 .clickable(enabled = !activating && key.isNotBlank()) { vm.activateLicense(key) }532 .padding(vertical = 12.dp),533 contentAlignment = Alignment.Center,534 ) { Text(if (activating) "Activating…" else "Activate", color = fg, fontFamily = PeachType.Mono, fontSize = 12.sp) }535}536537@Composable538private fun ProActiveBody(fg: Color, vm: SettingsViewModel) {539 val features = listOf("Peach Sync", "Peach Codex", "Passkeys", "Advanced Vault Health", "Canary entries", "Duress vault")540 Box(Modifier.fillMaxWidth().padding(vertical = 8.dp), contentAlignment = Alignment.Center) {541 com.peachpasswords.ui.components.PeachMark(size = 60.dp)542 }543 Text(544 "Peach Pro",545 modifier = Modifier.fillMaxWidth(),546 color = fg, fontFamily = PeachType.Display, fontStyle = FontStyle.Italic, fontSize = 26.sp,547 textAlign = androidx.compose.ui.text.style.TextAlign.Center,548 )549 Text(550 "active · yours forever",551 modifier = Modifier.fillMaxWidth().padding(top = 4.dp),552 color = fg.copy(alpha = 0.6f), fontFamily = PeachType.Mono, fontSize = 9.sp, letterSpacing = 0.18.em,553 textAlign = androidx.compose.ui.text.style.TextAlign.Center,554 )555 Spacer(Modifier.height(12.dp))556 features.forEachIndexed { i, name ->557 RowLine(fg) {558 Row(Modifier.weight(1f), verticalAlignment = Alignment.CenterVertically) {559 Text("%02d".format(i + 1), color = fg.copy(alpha = 0.5f), fontFamily = PeachType.Mono, fontSize = 10.sp, modifier = Modifier.padding(end = 10.dp))560 Text(name, color = fg, fontFamily = PeachType.Body, fontSize = 13.sp)561 }562 Text("unlocked", color = com.peachpasswords.ui.theme.PeachColors.HealthOk, fontFamily = PeachType.Display, fontStyle = FontStyle.Italic, fontSize = 11.sp)563 }564 }565 Spacer(Modifier.height(12.dp))566 Box(567 Modifier.fillMaxWidth().clip(RoundedCornerShape(10.dp))568 .border(1.dp, com.peachpasswords.ui.theme.PeachColors.Breach.copy(alpha = 0.4f), RoundedCornerShape(10.dp))569 .clickable { vm.deactivate() }570 .padding(vertical = 12.dp),571 contentAlignment = Alignment.Center,572 ) { Text("Deactivate", color = com.peachpasswords.ui.theme.PeachColors.Breach, fontFamily = PeachType.Mono, fontSize = 12.sp) }573}574575576577@OptIn(ExperimentalLayoutApi::class)578@Composable579private fun FeedbackBody(fg: Color) {580 val categories = listOf("Bug report", "Feature request", "Question", "Other")581 var category by remember { mutableStateOf(categories[0]) }582 var message by remember { mutableStateOf("") }583 var sent by remember { mutableStateOf(false) }584585 if (sent) {586 Box(587 Modifier.fillMaxWidth().clip(RoundedCornerShape(10.dp)).background(fg.copy(alpha = 0.08f))588 .border(1.dp, fg.copy(alpha = 0.32f), RoundedCornerShape(10.dp)).padding(16.dp),589 ) {590 Column {591 Text("Thank you", color = fg, fontFamily = PeachType.Display, fontStyle = FontStyle.Italic, fontSize = 18.sp)592 Text("Your note is in the queue. Someone will process it soon.", color = fg.copy(alpha = 0.7f), fontFamily = PeachType.Body, fontSize = 12.sp, modifier = Modifier.padding(top = 4.dp))593 }594 }595 return596 }597598 Text("Help us improve Peach. Every report goes directly to our inbox.", color = fg.copy(alpha = 0.7f), fontFamily = PeachType.Body, fontSize = 12.sp, lineHeight = 17.sp)599 SubLabel("TYPE", fg)600 FlowRow(horizontalArrangement = Arrangement.spacedBy(6.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) {601 categories.forEach { cat -> Pill(cat, category == cat, fg) { category = cat } }602 }603 SubLabel("MESSAGE", fg)604 Box(605 Modifier.fillMaxWidth().height(110.dp).clip(RoundedCornerShape(8.dp))606 .background(Color(0x2E000000)).border(1.dp, fg.copy(alpha = 0.22f), RoundedCornerShape(8.dp))607 .padding(10.dp),608 ) {609 if (message.isEmpty()) Text("Describe the issue or idea...", color = fg.copy(alpha = 0.42f), fontFamily = PeachType.Body, fontSize = 12.sp)610 BasicTextField(611 value = message, onValueChange = { message = it },612 textStyle = TextStyle(color = fg, fontFamily = PeachType.Body, fontSize = 12.sp),613 cursorBrush = SolidColor(fg), modifier = Modifier.fillMaxWidth(),614 )615 }616 Spacer(Modifier.height(8.dp))617 SubtleButton("Send", fg) { if (message.isNotBlank()) sent = true }618 Hint("Sent anonymously · no account required", fg)619}