fa74278e1134
polish: LockScreen visual parity — centered 80dp PeachMark, eyebrow + Cormorant headline (unlock/create), glass panel, underline Cormorant-22 unlock input + mono create inputs, filled accent button, 400ms shake (spec §5.1/§5.2) (v2.1.16)
- time
- 2026-06-08 20:02 UTC · 5 months ago
- machine
- koh2
- agent
- claude-opus-4-8
- session
- vault visual parity v2
- parent
- cbd9e393db86
↓ peach-android-fa74278e.tar.gzatlas at this save
files changed2 files
app/build.gradle+2 −2app/src/main/java/com/peachpasswords/ui/lock/LockScreen.kt+125 −84app/build.gradle+2 −2
@@ -16,8 +16,8 @@1616 applicationId "com.peachpasswords"1717 minSdk 261818 targetSdk 3519- versionCode 20101520- versionName "2.1.15"19+ versionCode 20101620+ versionName "2.1.16"2121 2222 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"2323 vectorDrawables {app/src/main/java/com/peachpasswords/ui/lock/LockScreen.kt+125 −84
@@ -5,6 +5,8 @@55 import androidx.compose.foundation.background66 import androidx.compose.foundation.border77 import androidx.compose.foundation.clickable8+import androidx.compose.foundation.interaction.MutableInteractionSource9+import androidx.compose.foundation.interaction.collectIsFocusedAsState810 import androidx.compose.foundation.layout.Arrangement911 import androidx.compose.foundation.layout.Box1012 import androidx.compose.foundation.layout.Column@@ -17,9 +19,9 @@1719 import androidx.compose.foundation.layout.padding1820 import androidx.compose.foundation.layout.systemBarsPadding1921 import androidx.compose.foundation.shape.RoundedCornerShape22+import androidx.compose.foundation.text.BasicTextField2023 import androidx.compose.foundation.text.KeyboardActions2124 import androidx.compose.foundation.text.KeyboardOptions22-import androidx.compose.material3.LocalTextStyle2325 import androidx.compose.material3.Text2426 import androidx.compose.runtime.Composable2527 import androidx.compose.runtime.LaunchedEffect@@ -30,15 +32,20 @@3032 import androidx.compose.ui.Alignment3133 import androidx.compose.ui.Modifier3234 import androidx.compose.ui.draw.alpha35+import androidx.compose.ui.draw.clip36+import androidx.compose.ui.draw.drawBehind37+import androidx.compose.ui.geometry.Offset38+import androidx.compose.ui.geometry.Size3339 import androidx.compose.ui.graphics.Color40+import androidx.compose.ui.graphics.SolidColor41+import androidx.compose.ui.text.TextStyle3442 import androidx.compose.ui.text.input.ImeAction3543 import androidx.compose.ui.text.input.KeyboardType3644 import androidx.compose.ui.text.input.PasswordVisualTransformation37-import androidx.compose.ui.text.font.FontStyle38-import androidx.compose.ui.text.font.FontWeight3945 import androidx.compose.ui.text.style.TextAlign4046 import androidx.compose.ui.unit.IntOffset4147 import androidx.compose.ui.unit.dp48+import androidx.compose.ui.unit.em4249 import androidx.compose.ui.unit.sp4350 import androidx.hilt.navigation.compose.hiltViewModel4451 import androidx.compose.runtime.collectAsState@@ -64,100 +71,103 @@6471 6572 LaunchedEffect(state.unlocked) { if (state.unlocked) onUnlocked() }6673 67- // Shake the password field on each failed unlock (matches the 300ms browser shake).74+ // Shake the panel on each failed unlock (brief Phase 4: 0→−12→10→−8→6→0 over ~400ms).6875 val shake = remember { Animatable(0f) }6976 LaunchedEffect(state.shakeNonce) {7077 if (state.shakeNonce > 0) {7178 shake.animateTo(7279 targetValue = 0f,7380 animationSpec = keyframes {74- durationMillis = 30075- 8f at 50; -8f at 100; 8f at 150; -8f at 200; 4f at 250; 0f at 30081+ durationMillis = 40082+ -12f at 60; 10f at 140; -8f at 230; 6f at 320; 0f at 4007683 },7784 )7885 }7986 }8087 81- // 400ms biometric trigger — dormant until enrollment lands (canTryBiometric == false).82- LaunchedEffect(Unit) {83- if (state.hasVault && vm.canTryBiometric()) {84- kotlinx.coroutines.delay(400)85- // biometric prompt wired with Protection settings86- }87- }88-8988 ShellBackground {90- // Faint PeachMark art, top-right, 120dp at 12% opacity.91- PeachMark(92- modifier = Modifier93- .align(Alignment.TopEnd)94- .systemBarsPadding()95- .padding(end = 20.dp, top = 8.dp),96- size = 120.dp,97- alpha = 0.12f,89+ // Wordmark, top-left.90+ Text(91+ text = "peach",92+ color = accent,93+ style = PeachType.wordmark,94+ modifier = Modifier.align(Alignment.TopStart).systemBarsPadding().padding(start = 20.dp, top = 8.dp),9895 )9996 10097 Column(10198 modifier = Modifier10299 .fillMaxSize()103100 .systemBarsPadding()104- .padding(horizontal = 32.dp),101+ .padding(horizontal = 28.dp),105102 verticalArrangement = Arrangement.Center,106103 horizontalAlignment = Alignment.CenterHorizontally,107104 ) {105+ // Hero: centered PeachMark · eyebrow · headline.106+ PeachMark(size = 80.dp)107+ Spacer(Modifier.height(18.dp))108108 Text(109- text = "peach",110- color = accent,111- fontFamily = PeachType.Display,112- fontStyle = FontStyle.Italic,113- fontWeight = FontWeight.Light,114- fontSize = 44.sp,109+ text = if (state.hasVault) "VAULT LOCKED" else "NEW VAULT",110+ color = PeachColors.T2,111+ style = PeachType.lockEyebrow,115112 )116113 Spacer(Modifier.height(10.dp))114+ Text(115+ text = if (state.hasVault) "unlock\nyour vault." else "keep your\nsecrets.",116+ color = PeachColors.T0,117+ style = if (state.hasVault) PeachType.lockHeadline else PeachType.createHeadline,118+ textAlign = TextAlign.Center,119+ )120+ Spacer(Modifier.height(14.dp))117121 LockRuneString()118- Spacer(Modifier.height(36.dp))122+ Spacer(Modifier.height(24.dp))119123 120- Box(modifier = Modifier.offset { IntOffset(shake.value.dp.roundToPx(), 0) }) {121- Column(horizontalAlignment = Alignment.CenterHorizontally) {122- PasswordField(123- value = password,124- onChange = { password = it; vm.clearError() },125- placeholder = if (state.hasVault) "master password" else "create a master password",126- imeAction = if (state.hasVault) ImeAction.Go else ImeAction.Next,127- onImeAction = { if (state.hasVault) vm.unlock(password) },124+ // Glass panel holding the credential inputs.125+ GlassPanel(126+ modifier = Modifier.offset { IntOffset(shake.value.dp.roundToPx(), 0) },127+ ) {128+ FieldLabel(if (state.hasVault) "master password" else "create a master password")129+ Spacer(Modifier.height(4.dp))130+ UnderlineField(131+ value = password,132+ onChange = { password = it; vm.clearError() },133+ placeholder = "••••••••••",134+ textStyle = if (state.hasVault) PeachType.unlockInput else mono18Spaced(),135+ imeAction = if (state.hasVault) ImeAction.Go else ImeAction.Next,136+ onImeAction = { if (state.hasVault) vm.unlock(password) },137+ )138+139+ if (!state.hasVault) {140+ Spacer(Modifier.height(16.dp))141+ FieldLabel("confirm password")142+ Spacer(Modifier.height(4.dp))143+ UnderlineField(144+ value = confirm,145+ onChange = { confirm = it; vm.clearError() },146+ placeholder = "••••••••••",147+ textStyle = mono18Spaced(),148+ imeAction = ImeAction.Go,149+ onImeAction = { vm.create(password, confirm) },128150 )129- if (!state.hasVault) {130- Spacer(Modifier.height(12.dp))131- PasswordField(132- value = confirm,133- onChange = { confirm = it; vm.clearError() },134- placeholder = "confirm password",135- imeAction = ImeAction.Go,136- onImeAction = { vm.create(password, confirm) },137- )138- }139151 }140- }141152 142- Spacer(Modifier.height(8.dp))143- Text(144- text = state.error ?: " ",145- color = PeachColors.Breach,146- fontFamily = PeachType.Mono,147- fontSize = 11.sp,148- textAlign = TextAlign.Center,149- modifier = Modifier.height(20.dp),150- )153+ Text(154+ text = state.error ?: " ",155+ color = PeachColors.Breach,156+ style = PeachType.labelMono.copy(fontSize = 11.sp),157+ textAlign = TextAlign.Center,158+ modifier = Modifier.fillMaxWidth().padding(top = 12.dp).height(18.dp),159+ )151160 152- Spacer(Modifier.height(8.dp))153- PrimaryButton(154- label = if (state.hasVault) "unlock" else "create vault",155- enabled = !state.loading,156- onClick = { if (state.hasVault) vm.unlock(password) else vm.create(password, confirm) },157- )161+ Spacer(Modifier.height(4.dp))162+ AccentButton(163+ label = if (state.hasVault) "unlock" else "create vault",164+ enabled = !state.loading,165+ onClick = { if (state.hasVault) vm.unlock(password) else vm.create(password, confirm) },166+ )167+ }158168 159169 if (!state.hasVault) {160- Spacer(Modifier.height(28.dp))170+ Spacer(Modifier.height(24.dp))161171 RestoreTabs(onNavigate = onNavigate)162172 }163173 }@@ -165,35 +175,62 @@165175 }166176 167177 @Composable168-private fun PasswordField(178+private fun FieldLabel(text: String) {179+ Text(text.uppercase(), color = PeachColors.T2, style = PeachType.labelMono.copy(letterSpacing = 0.08.em))180+}181+182+/** IBM Plex Mono 18sp, wide tracking — the create-vault input style (spec §5.2). */183+private fun mono18Spaced() = TextStyle(fontFamily = PeachType.Mono, fontSize = 18.sp, letterSpacing = 0.18.em)184+185+@Composable186+private fun GlassPanel(modifier: Modifier = Modifier, content: @Composable androidx.compose.foundation.layout.ColumnScope.() -> Unit) {187+ Column(188+ modifier189+ .fillMaxWidth()190+ .clip(RoundedCornerShape(18.dp))191+ .background(Color(0xE0131109))192+ .border(1.dp, PeachColors.T3, RoundedCornerShape(18.dp))193+ .padding(20.dp),194+ content = content,195+ )196+}197+198+@Composable199+private fun UnderlineField(169200 value: String,170201 onChange: (String) -> Unit,171202 placeholder: String,203+ textStyle: TextStyle,172204 imeAction: ImeAction,173205 onImeAction: () -> Unit,174206 ) {175- androidx.compose.foundation.text.BasicTextField(207+ val accent = LocalPeachAccent.current208+ val interaction = remember { MutableInteractionSource() }209+ val focused by interaction.collectIsFocusedAsState()210+ BasicTextField(176211 value = value,177212 onValueChange = onChange,178213 singleLine = true,179- textStyle = LocalTextStyle.current.copy(180- color = PeachColors.T0,181- fontFamily = PeachType.Mono,182- fontSize = 15.sp,183- textAlign = TextAlign.Center,184- ),185- cursorBrush = androidx.compose.ui.graphics.SolidColor(LocalPeachAccent.current),214+ textStyle = textStyle.copy(color = PeachColors.T0, textAlign = TextAlign.Center),215+ cursorBrush = SolidColor(accent),186216 visualTransformation = PasswordVisualTransformation(),187217 keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password, imeAction = imeAction),188218 keyboardActions = KeyboardActions(onGo = { onImeAction() }, onNext = { onImeAction() }),219+ interactionSource = interaction,189220 modifier = Modifier190221 .fillMaxWidth()191- .border(1.dp, PeachColors.T3, RoundedCornerShape(12.dp))192- .padding(vertical = 16.dp, horizontal = 16.dp),222+ .drawBehind {223+ drawRect(224+ color = if (focused) accent else PeachColors.T3,225+ topLeft = Offset(0f, size.height - 1.dp.toPx()),226+ size = Size(size.width, 1.dp.toPx()),227+ )228+ }229+ .padding(vertical = 8.dp),193230 decorationBox = { inner ->194231 Box(contentAlignment = Alignment.Center) {195232 if (value.isEmpty()) {196- Text(placeholder, color = PeachColors.T2, fontFamily = PeachType.Mono, fontSize = 14.sp)233+ Text(placeholder, style = textStyle.copy(color = PeachColors.T2, textAlign = TextAlign.Center))197234 }198235 inner()199236 }@@ -202,19 +239,23 @@202239 }203240 204241 @Composable205-private fun PrimaryButton(label: String, enabled: Boolean, onClick: () -> Unit) {242+private fun AccentButton(label: String, enabled: Boolean, onClick: () -> Unit) {206243 val accent = LocalPeachAccent.current207244 Box(208245 modifier = Modifier209246 .fillMaxWidth()210247 .alpha(if (enabled) 1f else 0.5f)211- .border(1.dp, accent.copy(alpha = 0.5f), RoundedCornerShape(12.dp))212- .background(accent.copy(alpha = 0.10f), RoundedCornerShape(12.dp))248+ .clip(RoundedCornerShape(10.dp))249+ .background(accent)213250 .clickable(enabled = enabled, onClick = onClick)214- .padding(vertical = 16.dp),251+ .padding(vertical = 13.dp),215252 contentAlignment = Alignment.Center,216253 ) {217- Text(label, color = accent, fontFamily = PeachType.Mono, fontSize = 14.sp)254+ Text(255+ label,256+ color = Color.White,257+ style = TextStyle(fontFamily = PeachType.Body, fontSize = 13.sp, letterSpacing = 0.06.em),258+ )218259 }219260 }220261 @@ -227,7 +268,7 @@227268 "Codex" to PeachNav.CodexRestore,228269 )229270 Column(horizontalAlignment = Alignment.CenterHorizontally) {230- Text("restore instead", color = PeachColors.T1, fontFamily = PeachType.Mono, fontSize = 10.sp)271+ Text("restore instead", color = PeachColors.T1, style = PeachType.labelMono)231272 Spacer(Modifier.height(10.dp))232273 Row(horizontalArrangement = Arrangement.spacedBy(6.dp)) {233274 tabs.forEach { (label, dest) ->@@ -237,7 +278,7 @@237278 .clickable { onNavigate(dest) }238279 .padding(horizontal = 10.dp, vertical = 8.dp),239280 ) {240- Text(label, color = PeachColors.T1, fontFamily = PeachType.Mono, fontSize = 9.sp)281+ Text(label, color = PeachColors.T1, style = PeachType.sortPill)241282 }242283 }243284 }