62049aae849d
feat: site-icons toggle in Appearance, default off (v2.10.13)
- time
- 2026-08-03 16:34 UTC · 2 months ago
- machine
- koh2
- parent
- 869e877f6948
↓ peach-android-62049aae.tar.gzatlas at this save
files changed8 files
VERSION+1 −1app/src/main/java/com/peachpasswords/MainActivity.kt+5 −1app/src/main/java/com/peachpasswords/autofill/AutofillEntryPickerActivity.kt+5 −1app/src/main/java/com/peachpasswords/ui/components/FaviconInitials.kt+4 −1app/src/main/java/com/peachpasswords/ui/settings/SettingsCardBodies.kt+5 −0app/src/main/java/com/peachpasswords/ui/settings/SettingsViewModel.kt+1 −0app/src/main/java/com/peachpasswords/ui/vault/VaultListScreen.kt+6 −2app/src/main/java/com/peachpasswords/vault/VaultSettings.kt+2 −0app/src/main/java/com/peachpasswords/MainActivity.kt+5 −1
@@ -27,6 +27,7 @@2727 import com.peachpasswords.ui.PeachAppNavHost2828 import com.peachpasswords.ui.components.Favicons2929 import com.peachpasswords.ui.components.LocalFavicons30+import com.peachpasswords.ui.components.LocalFaviconsEnabled3031 import com.peachpasswords.ui.components.QaFlags3132 import com.peachpasswords.ui.components.SecureWindowPolicy3233 import com.peachpasswords.ui.onboarding.ONBOARD_KEY@@ -118,7 +119,10 @@118119 SecureWindowPolicy.setUserSecure(window, !settings.allowScreenshots)119120 }120121 }121- CompositionLocalProvider(LocalFavicons provides favicons) {122+ CompositionLocalProvider(123+ LocalFavicons provides favicons,124+ LocalFaviconsEnabled provides settings.faviconsEnabled,125+ ) {122126 PeachTheme(123127 accent = accent,124128 reduceMotion = settings.reduceMotion,app/src/main/java/com/peachpasswords/autofill/AutofillEntryPickerActivity.kt+5 −1
@@ -54,6 +54,7 @@5454 import com.peachpasswords.ui.lock.Biometrics5555 import com.peachpasswords.ui.components.FaviconInitials5656 import com.peachpasswords.ui.components.LocalFavicons57+import com.peachpasswords.ui.components.LocalFaviconsEnabled5758 import com.peachpasswords.ui.components.QaFlags5859 import com.peachpasswords.ui.components.SecureWindowPolicy5960 import com.peachpasswords.ui.theme.ACCENT_COLORS@@ -147,7 +148,10 @@147148 val accent = settings.accentColor.let { ACCENT_COLORS[it] } ?: DEFAULT_ACCENT148149 149150 setContent {150- CompositionLocalProvider(LocalFavicons provides favicons) {151+ CompositionLocalProvider(152+ LocalFavicons provides favicons,153+ LocalFaviconsEnabled provides settings.faviconsEnabled,154+ ) {151155 PeachTheme(accent = accent, textSize = settings.textSize) {152156 val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)153157 val scope = rememberCoroutineScope()app/src/main/java/com/peachpasswords/ui/components/FaviconInitials.kt+4 −1
@@ -32,6 +32,9 @@3232 /** Favicons repository for this window; provided by MainActivity and the picker. */3333 val LocalFavicons = staticCompositionLocalOf<Favicons?> { null }3434 35+/** Site-icons toggle (Settings > Appearance); off (default) keeps the initials-only look. */36+val LocalFaviconsEnabled = staticCompositionLocalOf { false }37+3538 /**3639 * Site favicon with initials fallback (offline-first). Shows the cached real3740 * favicon (U1, [Favicons]) once fetched; until then the initials chip — the@@ -46,7 +49,7 @@4649 size: Dp = 26.dp,4750 cornerRadius: Dp = (size.value * 0.23f).dp,4851 ) {49- val favicons = LocalFavicons.current52+ val favicons = if (LocalFaviconsEnabled.current) LocalFavicons.current else null5053 val domain = remember(source) { extractDomain(source) }5154 var revision by remember { mutableIntStateOf(0) }5255 LaunchedEffect(favicons) {app/src/main/java/com/peachpasswords/ui/settings/SettingsCardBodies.kt+5 −0
@@ -285,6 +285,11 @@285285 Pill("large", s.textSize == "large", fg) { vm.setTextSize("large") }286286 }287287 }288+ SubLabel("ICONS", fg)289+ RowLine(fg) {290+ Name("Site icons", fg)291+ SubtleButton(if (s.faviconsEnabled) "On" else "Off", fg) { vm.setFaviconsEnabled(!s.faviconsEnabled) }292+ }288293 SubLabel("MOTION", fg)289294 RowLine(fg) {290295 Name("Reduce motion", fg)app/src/main/java/com/peachpasswords/ui/settings/SettingsViewModel.kt+1 −0
@@ -279,6 +279,7 @@279279 fun setAccent(name: String) = mutate { it.copy(accentColor = name) }280280 fun setReduceMotion(on: Boolean) = mutate { it.copy(reduceMotion = on) }281281 fun setTextSize(size: String) = mutate { it.copy(textSize = size) }282+ fun setFaviconsEnabled(on: Boolean) = mutate { it.copy(faviconsEnabled = on) }282283 fun setBreachMonitoring(on: Boolean) = mutate { it.copy(breachMonitoring = on) }283284 fun setBiometrics(on: Boolean) = mutate { it.copy(biometricsEnabled = on) }284285 fun setPasskeyProviderEnabled(on: Boolean) = mutate { it.copy(passkeyProviderEnabled = on) }app/src/main/java/com/peachpasswords/ui/vault/VaultListScreen.kt+6 −2
@@ -101,6 +101,7 @@101101 import com.peachpasswords.ui.PeachNav102102 import com.peachpasswords.shared.extractDomain103103 import com.peachpasswords.ui.components.LocalFavicons104+import com.peachpasswords.ui.components.LocalFaviconsEnabled104105 import com.peachpasswords.ui.components.PeachEmptyOrEndState105106 import com.peachpasswords.ui.components.PeachFilterPills106107 import com.peachpasswords.ui.components.PeachSegment@@ -148,8 +149,11 @@148149 // initials until the site's own favicon lands. Bounded concurrency, cached149150 // and negative-cached domains skip instantly.150151 val favicons = LocalFavicons.current151- LaunchedEffect(entries) {152- favicons?.prefetch(entries.mapNotNull { it.url?.let(::extractDomain) })152+ val faviconsEnabled = LocalFaviconsEnabled.current153+ LaunchedEffect(entries, faviconsEnabled) {154+ if (faviconsEnabled) {155+ favicons?.prefetch(entries.mapNotNull { it.url?.let(::extractDomain) })156+ }153157 }154158 val sort by vm.sort.collectAsState()155159 val search by vm.search.collectAsState()app/src/main/java/com/peachpasswords/vault/VaultSettings.kt+2 −0
@@ -10,6 +10,8 @@1010 val reduceMotion: Boolean = false,1111 /** Browser-parity text size: "small" | "medium" | "large". */1212 val textSize: String = "medium",13+ /** U1 site icons in lists; off (default) keeps the cleaner initials-only look. */14+ val faviconsEnabled: Boolean = false,1315 val biometricsEnabled: Boolean = false,1416 val trashRetentionDays: Int? = null,1517 val sortOrder: String = "url-first",