findfamily: no hide/delete/menu on people page, cache faces
- Commit
cdf0aea5fe507a042bc632cd7b8fec4cc193d1a4- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-02 03:00 UTC (4 days ago)
- Parents
a9996ce
Remove the hide/delete entry points and the overflow menu icon from the people page, and stop the face icons reloading on scroll. People page: PersonDetailSheet no longer shows the per-person sharing (hide) switch, its paused note, or the auto-toggle row; PersonSheet no longer shows the delete-person button (history remains, full width). MapOverlayBar no longer shows the MoreVert backup menu icon, and the backupPassphrase plumbing through MainPage/MainPageContent is removed. Data-layer functions are kept: ViewModel/repository deleteUser and setUserSharing are still used by tests and by the auto-toggle, tile and heartbeat flows, and BackupMenuButton remains for its existing tests; only the people-page UI entry points are gone. Face icons: UserPicture built a new ByteArray and a String.hashCode memory key on every composition with no disk key and no explicit size, so scrolling re-decoded full-size photos and missed the caches. It now remembers a peopleFaceRequest: base64 decoded once, a stable SHA-256 key used for both the memory and disk caches via :library:image conventions, and an explicit decode size at the icon's pixel size. PeopleFaceCacheTest proves it with a counting fake: a second render of the same face is a memory hit with no refetch, and a fresh loader over the same disk cache serves it from disk with no refetch. Screenshot captures regenerated via :findfamily:metadata (phone 1/2 and large-tablet 1 changed). AGENTS.md updated. Verified: :findfamily:testDevUnitTest green (356 tests). Lint explicit: :findfamily:lint and :findfamily:lintVitalRelease both report the same 13 pre-existing errors as the base (3 DialogAsRoute in MainActivity/PersonDetailSheet/PersonSheet and 10 RouteScreenshotCoverage in Route.kt, all in code this change does not add); no new lint errors in touched files. The parent should re-run release lint before merging, as it will currently fail on those pre-existing errors.
Diff
findfamily/AGENTS.md
diff --git a/findfamily/AGENTS.md b/findfamily/AGENTS.mdindex 9afc1156aa..894fa0ec08 100644--- a/findfamily/AGENTS.md+++ b/findfamily/AGENTS.md@@ -16,7 +16,7 @@ WebSocket relay host: `wss://api.maproj.org/api/ws` (Cloudflare FIRST_PARTY pins ## Overview **Purpose:** End-to-end encrypted location sharing for family and friends — no emails, phone numbers, or personal info required. Requires internet. **Key features:**-- Temporary per-person sharing toggles, `findfamily://add/<base26>` invites with key-fingerprint check, and temporary links+- `findfamily://add/<base26>` invites with key-fingerprint check, and temporary links; the people page offers no per-person hide/sharing toggle, no delete-person action, and no overflow menu icon (pause sharing via the Quick Settings tile) - Saved places (waypoints) with enter/leave notifications plus no-show alerts driven by `domain/NoShowPolicy` - Live battery, speed, and dwell-time per person; UWB precision ranging where hardware supports it - Powered-off finding (BLE beacons) and a Quick Settings tile to stop sharing instantly@@ -101,6 +101,7 @@ WebSocket relay host: `wss://api.maproj.org/api/ws` (Cloudflare FIRST_PARTY pins - com/vayunmathur/findfamily/ui/FamilyListSheet.kt - com/vayunmathur/findfamily/ui/PersonDetailSheet.kt - com/vayunmathur/findfamily/ui/UserCard.kt+- com/vayunmathur/findfamily/ui/UserPicture.kt — face icons via `peopleFaceRequest`: stable SHA-256 memory+disk cache keys and explicit decode size through `:library:image`, so scrolling the people list does not refetch/re-decode faces - com/vayunmathur/findfamily/ui/AutoToggleRow.kt - com/vayunmathur/findfamily/ui/FindFamilyWideLayout.kt - com/vayunmathur/findfamily/ui/UwbRangingScreen.kt
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.ktindex 769c38e089..1737243c1b 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.kt@@ -255,7 +255,6 @@ fun MainPage( state = state, familyActions = familyActions, actions = mainActions,- backupPassphrase = ffViewModel.backupPassphrase, map = { MainMapSlot( ffViewModel = ffViewModel,
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageContent.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageContent.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageContent.ktindex c7c1f66c23..43791f4b34 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageContent.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageContent.kt@@ -42,7 +42,6 @@ fun MainPageContent( familyActions: FamilyListActions, actions: MainPageActions, map: @Composable () -> Unit,- backupPassphrase: String? = null, ) { val scaffoldState = rememberBottomSheetScaffoldState() @@ -144,7 +143,7 @@ fun MainPageContent( // light, whatever the app's theme. Box(Modifier.align(Alignment.TopCenter).fillMaxWidth()) { MaterialTheme(colorScheme = lightScheme) {- MapOverlayBar(state, actions, backupPassphrase)+ MapOverlayBar(state, actions) } }
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageOverlays.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageOverlays.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageOverlays.ktindex b9a909d647..3c4ff7d4d5 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageOverlays.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageOverlays.kt@@ -1,44 +1,25 @@ package com.vayunmathur.findfamily.ui import androidx.compose.foundation.Image-import androidx.compose.foundation.layout.padding-import com.vayunmathur.library.ui.Card-import com.vayunmathur.library.ui.MaterialTheme-import com.vayunmathur.library.ui.Text import com.vayunmathur.library.ui.OverlayAction-import com.vayunmathur.library.ui.Spacing import com.vayunmathur.library.ui.TopAppBarOverlay import androidx.compose.runtime.Composable-import androidx.compose.runtime.getValue-import androidx.compose.runtime.mutableStateOf-import androidx.compose.runtime.remember-import androidx.compose.runtime.setValue-import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.painterResource-import androidx.compose.ui.text.style.TextOverflow import com.vayunmathur.findfamily.R import com.vayunmathur.findfamily.platform.MainPageActions import com.vayunmathur.findfamily.platform.MainPageUiState-import com.vayunmathur.library.ui.IconDelete-import com.vayunmathur.library.ui.IconNavigationArrow-import com.vayunmathur.library.ui.IconVerify @Composable internal fun MapOverlayBar( state: MainPageUiState, actions: MainPageActions,- backupPassphrase: String? = null, ) {- var backupMenuExpanded by remember { mutableStateOf(false) }- val gpsWarningDescription = stringResource(R.string.gps_fallback_warning_content_description)- val menuDescription = stringResource(R.string.map_menu_content_description) - // Selection-scoped actions (Find Nearby / verify / delete) live on the+ // Selection-scoped actions (Find Nearby / verify) live on the // PersonSheet / WaypointSheet destinations. The map's own overlay only- // carries the GPS warning and the backup menu; dismissal of a sheet is- // the back stack's job, so there is no navigate-back affordance here.+ // carries the GPS warning; there is no overflow/menu icon on this page. val overlayActions: List<OverlayAction> = listOfNotNull( if (state.usingGpsFallback) { OverlayAction(@@ -54,18 +35,6 @@ internal fun MapOverlayBar( onClick = { actions.onGpsWarningClick() } ) } else null,- // Singular backup entry point: one overflow button whose menu holds- // "Back up" and "Restore" (GitHub #879). Null in previews, where no- // passphrase exists and the button stays hidden.- backupPassphrase?.let { passphrase ->- OverlayAction(- icon = {- BackupMenuButton(passphrase, backupMenuExpanded, { backupMenuExpanded = it })- },- contentDescription = menuDescription,- onClick = { backupMenuExpanded = !backupMenuExpanded }- )- } ) TopAppBarOverlay(
findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonDetailSheet.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonDetailSheet.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonDetailSheet.ktindex 39f2f9fa94..838eadccf9 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonDetailSheet.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonDetailSheet.kt@@ -8,11 +8,8 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding-import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.OutlinedButton-import com.vayunmathur.library.ui.Switch import com.vayunmathur.library.ui.Text-import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource@@ -34,37 +31,10 @@ fun PersonDetailSheet( Column(Modifier.fillMaxWidth().navigationBarsPadding().padding(horizontal = 12.dp, vertical = 4.dp)) { UserCard(user, state.location, true) {} Spacer(Modifier.height(8.dp))- // Sharing controls are hidden for your own entry: you can't "stop sharing with- // yourself", and doing so per-person was a confusing way to try to turn the- // service off. Use the Quick Settings tile to disable tracking (GitHub #487).+ // No per-person hide/sharing toggle on this page: people cannot be+ // hidden or removed from here. Use the Quick Settings tile to pause+ // sharing globally. if (user.id != Networking.userid) {- Row(- Modifier.fillMaxWidth().padding(horizontal = 4.dp),- verticalAlignment = Alignment.CenterVertically- ) {- Text(- stringResource(R.string.share_your_location),- Modifier.weight(1f),- style = MaterialTheme.typography.bodyMedium- )- Switch(- user.sendingEnabled,- { send -> actions.setUserSharing(user, send) },- enabled = state.sharingGloballyEnabled- )- }- if (!state.sharingGloballyEnabled) {- Text(- stringResource(R.string.sharing_paused_note),- Modifier.padding(horizontal = 4.dp),- style = MaterialTheme.typography.bodySmall,- color = MaterialTheme.colorScheme.onSurfaceVariant- )- }- // Auto-toggle: "Turn on/off after" + duration/arrival dropdown (Never default)- Spacer(Modifier.height(4.dp))- AutoToggleRow(user, state.waypoints, actions)- Spacer(Modifier.height(4.dp)) // Per-person arrival/departure notification settings (issue #618). Each opens the // system channel settings so sound/vibration/DND can be tuned independently. val context = LocalContext.current
findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.ktindex 66e547928a..f5358c07a7 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.kt@@ -37,7 +37,7 @@ import com.vayunmathur.library.util.NavBackStack * person is selected, and dismissing it (back / scrim) pops back to the map. * * Hosts the person detail sheet plus the actions that used to branch on the- * selected user in the map overlay/FAB: Find Nearby, verify, delete, and+ * selected user in the map overlay/FAB: Find Nearby, verify, and * entering history mode (the scrubber renders here; the map underneath * keeps showing the historical pin for [userId]). */@@ -161,24 +161,12 @@ fun PersonSheet( Modifier.weight(1f), ) { Text(stringResource(R.string.verify_security_code_content_description)) } }- Row(+ OutlinedButton(+ { ffViewModel.mapState.setShowingPresent(false) }, Modifier.fillMaxWidth(),- horizontalArrangement = Arrangement.spacedBy(8.dp), ) {- OutlinedButton(- { ffViewModel.mapState.setShowingPresent(false) },- Modifier.weight(1f),- ) {- IconRestore()- Text(stringResource(R.string.history_title, user.name))- }- OutlinedButton(- {- ffViewModel.deleteUser(user)- backStack.pop()- },- Modifier.weight(1f),- ) { Text(stringResource(R.string.delete_person_content_description)) }+ IconRestore()+ Text(stringResource(R.string.history_title, user.name)) } } }
findfamily/src/main/java/com/vayunmathur/findfamily/ui/UserPicture.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/UserPicture.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/UserPicture.ktindex 1b1370d39a..1d95571d60 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/UserPicture.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/UserPicture.kt@@ -1,18 +1,23 @@ package com.vayunmathur.findfamily.ui +import android.content.Context import androidx.compose.foundation.border import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape import androidx.compose.runtime.Composable+import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.layout.ContentScale+import androidx.compose.ui.platform.LocalContext+import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import com.vayunmathur.findfamily.data.User import com.vayunmathur.library.image.ImageRequest import com.vayunmathur.library.image.compose.AsyncImage+import com.vayunmathur.library.image.util.sha256 import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.invisibleClickable import kotlin.io.encoding.Base64@@ -26,23 +31,49 @@ fun UserPicture(user: User, size: Dp, grayscale: Boolean = false, onClick: () -> UserPicture(user.photo, user.name.firstOrNull(), size, grayscale, onClick) } +/**+ * Builds the cached request for a person's face icon.+ *+ * Scrolling the people list re-composes these icons constantly, so the+ * request must be stable and cacheable through `:library:image`:+ * - a stable SHA-256 key (not `String.hashCode()`) is used for BOTH the+ * memory and disk caches, so a second render of the same face is served+ * from memory, and after memory eviction from disk, without refetching+ * or re-decoding the source;+ * - an explicit decode size (the icon's pixel size) is set, so the loader+ * never decodes a full-size photo into a 40 dp circle and the cache key+ * does not drift with layout constraints / measured size;+ * - callers `remember` the result, so the base64 decode below does not run+ * on every recomposition.+ */+internal fun peopleFaceRequest(context: Context, userPhoto: String, sizePx: Int): ImageRequest {+ val data: Any = if (userPhoto.startsWith("data")) {+ val cleanString = userPhoto.substringAfter("base64,")+ // The photo string is persisted in Room; a malformed base64 payload+ // must fail into the image loader (which shows nothing) rather than+ // throwing IllegalArgumentException during composition.+ runCatching { Base64.UrlSafe.decode(cleanString) }.getOrElse { userPhoto }+ } else {+ userPhoto+ }+ val cacheKey = "people-face-" + userPhoto.sha256()+ return ImageRequest.Builder(context)+ .data(data)+ .memoryCacheKey(cacheKey)+ .diskCacheKey(cacheKey)+ .size(sizePx)+ .build()+}+ @Composable fun UserPicture(userPhoto: String?, firstChar: Char?, size: Dp, grayscale: Boolean, onClick: () -> Unit) {- val context = androidx.compose.ui.platform.LocalContext.current+ val context = LocalContext.current val modifier = Modifier.clip(CircleShape).size(size).border(2.dp, MaterialTheme.colorScheme.primary, CircleShape).invisibleClickable(onClick)- if(userPhoto != null) {- val userOutput: Any = if(userPhoto.startsWith("data")) {- val cleanString = userPhoto.substringAfter("base64,")- // The photo string is persisted in Room; a malformed base64 payload- // must fail into the image loader (which shows nothing) rather than- // throwing IllegalArgumentException during composition.- runCatching { Base64.UrlSafe.decode(cleanString) }.getOrElse { userPhoto }- } else userPhoto+ if (userPhoto != null) {+ val sizePx = with(LocalDensity.current) { size.roundToPx() }.coerceAtLeast(1)+ val request = remember(userPhoto, sizePx) { peopleFaceRequest(context, userPhoto, sizePx) } AsyncImage(- ImageRequest.Builder(context)- .data(userOutput)- .memoryCacheKey("user-photo-${userPhoto.hashCode()}")- .build(),+ request, null, modifier, contentScale = ContentScale.FillWidth,
findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageInteractionsTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageInteractionsTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageInteractionsTest.ktindex d24c3a12a6..663ab38e5b 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageInteractionsTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageInteractionsTest.kt@@ -66,13 +66,13 @@ class MainPageInteractionsTest { } rule.setContent { MainPageContent(state = state, familyActions = actions,- actions = MainPageActions.Noop, map = {}, backupPassphrase = "pw")+ actions = MainPageActions.Noop, map = {}) } rule.waitForIdle() assertTrue(rule.onAllNodesWithText("Alice", substring = true).fetchSemanticsNodes().isNotEmpty()) assertTrue(accepted == null) }- @Test fun personDetailShowsSharingControls() {+ @Test fun personDetailShowsControls() { val u = user(7L, "Carol") rule.setContent { PersonDetailSheet(PersonUiState(user = u), PersonActions.Noop) } rule.onNodeWithText("Carol").assertIsDisplayed()
findfamily/src/test/java/com/vayunmathur/findfamily/ui/OverlayBarsTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/OverlayBarsTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/OverlayBarsTest.ktindex a6e26b0f0e..e73f4f4736 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/OverlayBarsTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/OverlayBarsTest.kt@@ -29,13 +29,13 @@ class OverlayBarsTest { sendingEnabled = true, requestStatus = RequestStatus.MUTUAL_CONNECTION, id = id) @Test fun overlayBarNothingSelected() {- rule.setContent { MapOverlayBar(MainPageUiState(usingGpsFallback = true), MainPageActions.Noop, "pw") }+ rule.setContent { MapOverlayBar(MainPageUiState(usingGpsFallback = true), MainPageActions.Noop) } rule.waitForIdle() } @Test fun overlayBarWithoutGpsFallback() { // Selection-scoped overlay actions moved to the sheet destinations; // the map overlay renders in its only (unselected) shape.- rule.setContent { MapOverlayBar(MainPageUiState(), MainPageActions.Noop, "pw") }+ rule.setContent { MapOverlayBar(MainPageUiState(), MainPageActions.Noop) } rule.waitForIdle() } @Test fun fabOverlayNothingSelected() {
findfamily/src/test/java/com/vayunmathur/findfamily/ui/PeopleFaceCacheTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/PeopleFaceCacheTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/PeopleFaceCacheTest.ktnew file mode 100644index 0000000000..f9a5e49035--- /dev/null+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/PeopleFaceCacheTest.kt@@ -0,0 +1,96 @@+package com.vayunmathur.findfamily.ui++import android.content.Context+import androidx.test.core.app.ApplicationProvider+import com.vayunmathur.library.image.DiskCache+import com.vayunmathur.library.image.ImageLoader+import com.vayunmathur.library.image.ImageResult+import com.vayunmathur.library.image.MemoryCache+import com.vayunmathur.library.image.fetchers.FetchResult+import com.vayunmathur.library.image.fetchers.Fetcher+import com.vayunmathur.library.image.util.ensureExists+import kotlinx.coroutines.runBlocking+import org.junit.runner.RunWith+import org.robolectric.RobolectricTestRunner+import java.io.File+import kotlin.io.encoding.Base64+import kotlin.test.Test+import kotlin.test.assertEquals+import kotlin.test.assertTrue++/**+ * Counting-fake proof that a people's face icon is cached: rendering the+ * same face a second time (and again after memory eviction, from disk)+ * does not refetch its source.+ */+@RunWith(RobolectricTestRunner::class)+class PeopleFaceCacheTest {++ private val ctx get() = ApplicationProvider.getApplicationContext<Context>()++ private fun svgBytes() =+ """<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><rect width="20" height="20" fill="#336699"/></svg>"""+ .toByteArray()++ private fun facePhoto(): String =+ "data:image/svg+xml;base64," + Base64.UrlSafe.encode(svgBytes())++ private class CountingFetcher(private val bytes: ByteArray) : Fetcher {+ var count = 0+ override suspend fun fetch(data: Any?, context: Context): FetchResult? {+ if (data !is ByteArray) return null+ count+++ return FetchResult.Bytes(bytes)+ }+ }++ @Test fun secondRenderOfSameFaceDoesNotRefetch(): Unit = runBlocking {+ val diskDir = File(ctx.cacheDir, "face-cache-${System.nanoTime()}").ensureExists()+ val disk = DiskCache.Builder().directory(diskDir).build()+ val fetcher = CountingFetcher(svgBytes())+ val loader = ImageLoader.Builder(ctx)+ .diskCache(disk)+ .memoryCache(MemoryCache.Builder().build())+ .addFetcher(fetcher)+ .build()+ val photo = facePhoto()+ val request = { peopleFaceRequest(ctx, photo, 40) }++ val first = loader.execute(request())+ assertTrue(first is ImageResult.Success, "first face load failed: $first")+ assertEquals(1, fetcher.count)++ // Second render of the same face: memory hit, no refetch.+ val second = loader.execute(request())+ assertTrue(second is ImageResult.Success)+ assertTrue((second as ImageResult.Success).isFromMemory)+ assertEquals(1, fetcher.count, "second render must not refetch")++ // After memory eviction, a fresh loader over the same disk cache+ // serves the face from disk without refetching either.+ var diskFetches = 0+ val diskLoader = ImageLoader.Builder(ctx)+ .diskCache(disk)+ .memoryCache(MemoryCache.Builder().build())+ .addFetcher(object : Fetcher {+ override suspend fun fetch(data: Any?, context: Context): FetchResult? {+ diskFetches+++ return null+ }+ })+ .build()+ val third = diskLoader.execute(request())+ assertTrue(third is ImageResult.Success, "disk face load failed: $third")+ assertEquals(ImageResult.DataSource.DISK, (third as ImageResult.Success).dataSource)+ assertEquals(0, diskFetches, "disk hit must not refetch")+ diskDir.deleteRecursively()+ }++ @Test fun differentFacesUseDifferentCacheKeys() {+ val a = peopleFaceRequest(ctx, facePhoto(), 40)+ val b = peopleFaceRequest(ctx, facePhoto() + "x", 40)+ assertTrue(a.memoryCacheKey != b.memoryCacheKey)+ assertEquals(a.memoryCacheKey, a.diskCacheKey)+ assertEquals(40, a.size?.width)+ }+}
findfamily/src/test/java/com/vayunmathur/findfamily/ui/PersonAndFamilySheetsRealTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/PersonAndFamilySheetsRealTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/PersonAndFamilySheetsRealTest.ktindex 1e6f44998f..73e0475ddd 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/PersonAndFamilySheetsRealTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/PersonAndFamilySheetsRealTest.kt@@ -27,7 +27,7 @@ import kotlin.test.assertEquals import kotlin.test.assertTrue import kotlin.time.Clock -/** Person/family sheet interactions: sharing switch, channel settings, no-show entry, requests. */+/** Person/family sheet interactions: channel settings, no-show entry, requests; no hide/delete controls. */ @RunWith(AndroidJUnit4::class) class PersonAndFamilySheetsRealTest { @@ -55,7 +55,7 @@ class PersonAndFamilySheetsRealTest { source = LocationSource.LIVE, ) - @Test fun personSheetTogglesSharingAndOpensNoShow() {+ @Test fun personSheetOpensNoShowWithoutHideControls() { val actions = Actions() val alice = user(7L, "Alice") rule.setContent {@@ -65,11 +65,8 @@ class PersonAndFamilySheetsRealTest { ) } rule.onNodeWithText("Alice").assertIsDisplayed()- // Flip the sharing switch off.- assertTrue(rule.onAllNodesWithText("Share", substring = true).fetchSemanticsNodes().isNotEmpty())+ assertTrue(rule.onAllNodesWithText("Share your location", substring = true).fetchSemanticsNodes().isEmpty()) rule.waitForIdle()- // The switch is the only toggleable; click by its row text proximity via semantics on the switch role.- rule.onNodeWithText("Share your location", substring = true).assertIsDisplayed() // Open the no-show dialog and dismiss it. rule.onNodeWithText("Watch", substring = true).performClick() rule.waitForIdle()@@ -79,7 +76,7 @@ class PersonAndFamilySheetsRealTest { assertEquals(1, actions.contactChange) } - @Test fun personSheetForSelfHidesSharingControls() {+ @Test fun personSheetForSelfHasNoHideControls() { val actions = Actions() // Networking.userid is 0 in a fresh sandbox; the self row (id 0 below // is avoided by using a fixed non-zero id and relying on the same@@ -96,7 +93,7 @@ class PersonAndFamilySheetsRealTest { assertTrue(rule.onAllNodesWithText("Change", substring = true).fetchSemanticsNodes().isNotEmpty()) } - @Test fun personSheetPausedSharingShowsNoteAndDisablesSwitch() {+ @Test fun personSheetPausedSharingShowsNoHideNote() { val actions = Actions() rule.setContent { PersonDetailSheet(@@ -105,7 +102,7 @@ class PersonAndFamilySheetsRealTest { ) } rule.waitForIdle()- assertTrue(rule.onAllNodesWithText("paused", substring = true).fetchSemanticsNodes().isNotEmpty())+ assertTrue(rule.onAllNodesWithText("Share your location", substring = true).fetchSemanticsNodes().isEmpty()) } @Test fun familySheetSelectsUserAndShowsSections() {
findfamily/src/test/java/com/vayunmathur/findfamily/ui/W5PersonDetailSheetTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/W5PersonDetailSheetTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/W5PersonDetailSheetTest.ktindex 341929607e..b87f798521 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/W5PersonDetailSheetTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/W5PersonDetailSheetTest.kt@@ -20,8 +20,8 @@ import kotlin.test.Test import kotlin.test.assertTrue /**- * Robolectric Compose tests for [PersonDetailSheet]: others get sharing- * controls + no-show entry, self hides them; switch toggles sharing.+ * Robolectric Compose tests for [PersonDetailSheet]: no hide/sharing or+ * delete controls on the people page; no-show entry remains. */ @RunWith(AndroidJUnit4::class) class W5PersonDetailSheetTest {@@ -40,7 +40,7 @@ class W5PersonDetailSheetTest { ) @Test- fun otherPersonShowsSharingControls() {+ fun otherPersonHasNoHideOrDeleteControls() { // Networking.userid defaults to 0L and cannot be set from tests; // any nonzero user id is therefore "another person". rule.setContent {@@ -49,14 +49,20 @@ class W5PersonDetailSheetTest { actions = PersonActions.Noop, ) }- rule.onNodeWithText("Share your location with this person", substring = true)- .assertIsDisplayed()+ assertTrue(+ rule.onAllNodesWithText("Share your location with this person", substring = true)+ .fetchSemanticsNodes().isEmpty(),+ )+ assertTrue(+ rule.onAllNodesWithText("Remove person", substring = true)+ .fetchSemanticsNodes().isEmpty(),+ ) rule.onNodeWithText("Watch for no-show", substring = true).assertIsDisplayed() rule.onNodeWithText("Change connected contact", substring = true).assertIsDisplayed() } @Test- fun selfHidesSharingControls() {+ fun selfHasNoHideControls() { rule.setContent { PersonDetailSheet( state = PersonUiState(user = user(0L)),@@ -71,14 +77,17 @@ class W5PersonDetailSheetTest { } @Test- fun pausedNoteShowsWhenGloballyDisabled() {+ fun pausedNoteNotShown() { rule.setContent { PersonDetailSheet( state = PersonUiState(user = user(1L), sharingGloballyEnabled = false), actions = PersonActions.Noop, ) }- rule.onNodeWithText("Sharing is paused", substring = true).assertIsDisplayed()+ assertTrue(+ rule.onAllNodesWithText("Sharing is paused", substring = true)+ .fetchSemanticsNodes().isEmpty(),+ ) } @Test
metadata_data/photos/findfamily/large-tablet/1.png
diff --git a/metadata_data/photos/findfamily/large-tablet/1.png b/metadata_data/photos/findfamily/large-tablet/1.pngindex 3d8bc3c103..3123694ff5 100644Binary files a/metadata_data/photos/findfamily/large-tablet/1.png and b/metadata_data/photos/findfamily/large-tablet/1.png differ
metadata_data/photos/findfamily/phone/1.png
diff --git a/metadata_data/photos/findfamily/phone/1.png b/metadata_data/photos/findfamily/phone/1.pngindex a981ea9cec..a312aeb320 100644Binary files a/metadata_data/photos/findfamily/phone/1.png and b/metadata_data/photos/findfamily/phone/1.png differ
metadata_data/photos/findfamily/phone/2.png
diff --git a/metadata_data/photos/findfamily/phone/2.png b/metadata_data/photos/findfamily/phone/2.pngindex fac991be30..c73c7d83ec 100644Binary files a/metadata_data/photos/findfamily/phone/2.png and b/metadata_data/photos/findfamily/phone/2.png differ