feat: M3 weighted shuffle v1 — real /api/radio with scoring #21

Merged
bvandeusen merged 262 commits from dev into main 2026-04-27 11:00:29 -04:00
Showing only changes of commit b1bcfe7fa3 - Show all commits
@@ -39,13 +39,16 @@ class PasswordViewModel @Inject constructor(
fun change() {
val s = internal.value
if (s.isChanging) return
if (s.current.isEmpty() || s.next.isEmpty()) {
internal.update { it.copy(message = "All fields required.") }
return
val validationError: String? = when {
s.isChanging -> "" // sentinel: silent no-op
s.current.isEmpty() || s.next.isEmpty() -> "All fields required."
s.next != s.confirm -> "New passwords do not match."
else -> null
}
if (s.next != s.confirm) {
internal.update { it.copy(message = "New passwords do not match.") }
if (validationError != null) {
if (validationError.isNotEmpty()) {
internal.update { it.copy(message = validationError) }
}
return
}
viewModelScope.launch {