Modern Apps git

← Modern-Apps.git

web: make the overflow menu start with a five-icon action row

Commit
3c3d74b0cb838b23dd4a626a8454bdca247a2c4a
Author
Vayun Mathur <[email protected]>
When
2026-11-17 15:02 UTC (18 days ago)
Parents
6287be9
Rework the overflow (dropup) menu so its first item is a row of
five icon-only buttons - back, forward, reload, share, history -
and remove the corresponding Back, Forward, Reload, Share and
History text rows from below, so each of those actions has
exactly one entry point. Shields, install, bookmark, new-tab and
the library/settings destinations keep their text rows.

All five icons already exist as IconBack, IconArrowForward,
IconRefresh, IconShare and IconHistory in library/ui Icons.kt,
so the menu uses those shared IconXxx composables and no
material icon is referenced from the app; nothing needed adding
to library/ui. Unavailable actions now grey out in place via
IconButton's disabled state instead of vanishing: back/forward
follow canGoBack/canGoForward, reload is disabled on a new tab,
and share is disabled when the active tab has no URL. The
now-unused reload and go_forward strings (and their
translations) are removed so lint stays clean.

The existing menu tests that tapped the old text rows now tap
the icons by content description, and a new BrowserMenuIconRow
test covers the row composition and order, the absence of the
duplicate text rows, the disabled states (including that
disabled icons do not fire), the back/forward/reload actions,
history navigation to Route.History, and sharing the active
tab URL. Verified with :web:testDevUnitTest and :web:lintDev
(356 tests, 0 failures).

Diff

web/src/main/java/com/vayunmathur/web/ui/BrowserMenu.kt
diff --git a/web/src/main/java/com/vayunmathur/web/ui/BrowserMenu.kt b/web/src/main/java/com/vayunmathur/web/ui/BrowserMenu.ktindex 2c051c7546..fbd73883f7 100644--- a/web/src/main/java/com/vayunmathur/web/ui/BrowserMenu.kt+++ b/web/src/main/java/com/vayunmathur/web/ui/BrowserMenu.kt@@ -2,6 +2,7 @@ package com.vayunmathur.web.ui  import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column+import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape@@ -22,6 +23,10 @@ import com.vayunmathur.library.ui.DropdownMenuItem import com.vayunmathur.library.ui.ExternalIntents import com.vayunmathur.library.ui.IconArrowForward import com.vayunmathur.library.ui.IconBack+import com.vayunmathur.library.ui.IconButton+import com.vayunmathur.library.ui.IconHistory+import com.vayunmathur.library.ui.IconRefresh+import com.vayunmathur.library.ui.IconShare import com.vayunmathur.library.ui.IconShield import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.OutlinedTextField@@ -44,8 +49,12 @@ import com.vayunmathur.web.platform.newTab import com.vayunmathur.web.platform.removeBookmark  /**- * Overflow menu for the browser chrome: nav, shields, reload, install/pin,- * bookmark, share, new tabs, and the library/settings destinations.+ * Overflow ("dropup") menu for the browser chrome. Its first item is a+ * row of five icon-only buttons — back, forward, reload, share,+ * history — followed by shields, install/pin, bookmark, new tabs, and+ * the remaining library/settings destinations as text rows. The five+ * icon actions deliberately have no text rows below: one entry point+ * per action.  */ @Composable internal fun BrowserMenu(@@ -69,25 +78,38 @@ internal fun BrowserMenu(     val shareLinkTitle = stringResource(R.string.share_link)     val bookmarks by viewModel.bookmarks.collectAsStateWithLifecycle()     val activeTab = viewModel.activeTab+    val shareEnabled = activeTab?.url?.isNotBlank() == true+    val onShare: () -> Unit = {+        onDismiss()+        activeTab?.let { tab ->+            if (tab.url.isBlank()) return@let+            val sendIntent = android.content.Intent().apply {+                action = android.content.Intent.ACTION_SEND+                putExtra(android.content.Intent.EXTRA_TEXT, tab.url)+                type = "text/plain"+            }+            ExternalIntents.launch(context, android.content.Intent.createChooser(sendIntent, shareLinkTitle))+        }+    }     DropdownMenu(expanded = expanded, onDismissRequest = onDismiss) {-        DropdownMenuItem(-            text = { Text(stringResource(UiR.string.back)) },-            leadingIcon = { IconBack() },-            onClick = {-                onDismiss()-                onGoBack()-            },-            enabled = canGoBack,-        )-        DropdownMenuItem(-            text = { Text(stringResource(R.string.go_forward)) },-            leadingIcon = { IconArrowForward() },-            onClick = {-                onDismiss()-                onGoForward()-            },-            enabled = canGoForward,-        )+        // First item: the five frequent actions as one icon-only row.+        // These replace the old Back/Forward/Reload/Share/History text+        // rows below — those destinations must not appear twice. Icons+        // come from library/ui (IconBack & friends), never material+        // icons directly. IconButton greys its content out when+        // disabled, so unavailable actions (no back history, nothing+        // to reload/share on a new tab) read as disabled in place+        // instead of vanishing and reflowing the row.+        Row(+            modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp),+            horizontalArrangement = Arrangement.SpaceEvenly,+        ) {+            IconButton(onClick = { onDismiss(); onGoBack() }, enabled = canGoBack) { IconBack() }+            IconButton(onClick = { onDismiss(); onGoForward() }, enabled = canGoForward) { IconArrowForward() }+            IconButton(onClick = { onDismiss(); onReload() }, enabled = !isNewTabActive) { IconRefresh() }+            IconButton(onClick = onShare, enabled = shareEnabled) { IconShare() }+            IconButton(onClick = { onDismiss(); backStack.add(Route.History) }) { IconHistory() }+        }         if (shieldHost != null) {             DropdownMenuItem(                 text = { Text(stringResource(R.string.shields)) },@@ -101,16 +123,6 @@ internal fun BrowserMenu(                 },             )         }-        if (!isNewTabActive) {-            DropdownMenuItem(-                text = { Text(stringResource(R.string.reload)) },-                onClick = {-                    onDismiss()-                    onReload()-                }-            )-        }-         if (activeTab != null && !isNewTabActive) {             val pwa = viewModel.getPwaInfo(activeTab.id)             val pinSupported = PwaHelper.isPinSupported(context)@@ -136,21 +148,8 @@ internal fun BrowserMenu(                 }             }         )-        DropdownMenuItem(text = { Text(stringResource(UiR.string.share)) }, onClick = {-            onDismiss()-            activeTab?.let { tab ->-                if (tab.url.isBlank()) return@let-                val sendIntent = android.content.Intent().apply {-                    action = android.content.Intent.ACTION_SEND-                    putExtra(android.content.Intent.EXTRA_TEXT, tab.url)-                    type = "text/plain"-                }-                ExternalIntents.launch(context, android.content.Intent.createChooser(sendIntent, shareLinkTitle))-            }-        })         DropdownMenuItem(text = { Text(stringResource(R.string.new_tab)) }, onClick = { onDismiss(); viewModel.newTab() })         DropdownMenuItem(text = { Text(stringResource(R.string.new_private_tab)) }, onClick = { onDismiss(); viewModel.newTab(isPrivate = true) })-        DropdownMenuItem(text = { Text(stringResource(R.string.history)) }, onClick = { onDismiss(); backStack.add(Route.History) })         DropdownMenuItem(text = { Text(stringResource(R.string.bookmarks)) }, onClick = { onDismiss(); backStack.add(Route.Bookmarks) })         DropdownMenuItem(text = { Text(stringResource(R.string.downloads)) }, onClick = { onDismiss(); backStack.add(Route.Downloads) })         DropdownMenuItem(text = { Text(stringResource(R.string.installed_apps)) }, onClick = { onDismiss(); backStack.add(Route.InstalledSites) })
web/src/main/res/values-ar/strings.xml
diff --git a/web/src/main/res/values-ar/strings.xml b/web/src/main/res/values-ar/strings.xmlindex 409d98db3c..053100ec65 100644--- a/web/src/main/res/values-ar/strings.xml+++ b/web/src/main/res/values-ar/strings.xml@@ -2,7 +2,6 @@ <resources>     <string name="app_name">الويب</string>     <string name="search_or_enter_address">ابحث أو أدخل عنوانًا</string>-    <string name="reload">إعادة التحميل</string>     <string name="bookmarks">الإشارات المرجعية</string>     <string name="history">السجل</string>     <string name="new_tab">علامة تبويب جديدة</string>@@ -117,7 +116,6 @@     </plurals>     <string name="no_site_data_yet_cookies_localstorage_in">لا بيانات موقع بعد. تستمر ملفات تعريف الارتباط، التخزين المحلي، قاعدة البيانات المفهرسة والأذونات عبر عمليات التحميل في دليل ملف تعريف الـ WebView. يتم استبعاد علامات التبويب الخاصة.</string>     <string name="open_link">فتح الرابط</string>-    <string name="go_forward">إلى الأمام</string>     <string name="cleartext_blocked_title">تم حظر الاتصال غير الآمن</string>     <string name="cleartext_blocked_message">تم طلب %1$s عبر HTTP عادي. الاتصالات غير المشفرة مسموحة فقط للأجهزة على شبكتك المحلية.</string>     <string name="local_network_title">السماح بالوصول للشبكة المحلية؟</string>
web/src/main/res/values-et/strings.xml
diff --git a/web/src/main/res/values-et/strings.xml b/web/src/main/res/values-et/strings.xmlindex 33290a8a5f..fee133b432 100644--- a/web/src/main/res/values-et/strings.xml+++ b/web/src/main/res/values-et/strings.xml@@ -3,7 +3,6 @@     <string name="history">Ajalugu</string>     <string name="app_name">Veeb</string>     <string name="search_or_enter_address">Otsi või sisesta aadress</string>-    <string name="reload">Laadi uuesti</string>     <string name="bookmarks">Järjehoidjad</string>     <string name="new_tab">Uus vahekaart</string>     <string name="new_private_tab">Uus privaatne vahekaart</string>@@ -115,7 +114,6 @@     <string name="toolbar_at_bottom">Tööriistariba all ääres</string>     <string name="keeps_the_address_bar_within_thumb_reach">Kuvab aadressi- ja tööriistariba pöidlavajutuse kaugusel</string>     <string name="open_link">Ava link</string>-    <string name="go_forward">Edasi</string>     <string name="retry">Proovi uuesti</string>     <string name="search_tab_text">Veeb</string>     <string name="search_tab_images">Pildid</string>
web/src/main/res/values-fr/strings.xml
diff --git a/web/src/main/res/values-fr/strings.xml b/web/src/main/res/values-fr/strings.xmlindex ede4c32bcd..873bdfb2c8 100644--- a/web/src/main/res/values-fr/strings.xml+++ b/web/src/main/res/values-fr/strings.xml@@ -52,7 +52,6 @@     <string name="privacy_data">Confidentialité et données</string>     <string name="open_a_site_and_tap_menu_install_app_add">Ouvrez un site et appuyez sur Menu → Installer l’application / Ajouter à l’écran d’accueil. Cela crée un raccourci épinglé qui lance PwaActivity en mode autonome, sans interface du navigateur. La meilleure icône 192 × 192 ou apple-touch-icon est utilisée ; à défaut, une tuile avec une lettre s’affiche.</string>     <string name="new_private_tab">Nouvel onglet privé</string>-    <string name="reload">Recharger</string>     <string name="blank_new_tab_tap_the_address_pill_to_se">Nouvel onglet vide — appuyez sur la barre d’adresse pour effectuer une recherche. L’URL complète y est visible. Les commandes d’actualisation et d’effacement se trouvent dans la carte développée de la barre de recherche.</string>     <string name="delete_bookmark">Supprimer le favori ?</string>     <string name="bookmarks_inside_will_also_be_deleted">Les favoris contenus dans « %1$s » seront également supprimés.</string>
web/src/main/res/values-it/strings.xml
diff --git a/web/src/main/res/values-it/strings.xml b/web/src/main/res/values-it/strings.xmlindex 8e7d5404f4..2bc3551f2c 100644--- a/web/src/main/res/values-it/strings.xml+++ b/web/src/main/res/values-it/strings.xml@@ -3,7 +3,6 @@     <string name="history">Cronologia</string>     <string name="app_name">Web</string>     <string name="search_or_enter_address">Cerca o inserisci un indirizzo</string>-    <string name="reload">Ricarica</string>     <string name="bookmarks">Segnalibri</string>     <string name="site_data">Dati del sito</string>     <string name="app_name_2">Nome app</string>
web/src/main/res/values-ja/strings.xml
diff --git a/web/src/main/res/values-ja/strings.xml b/web/src/main/res/values-ja/strings.xmlindex 836e6c093b..37b261b746 100644--- a/web/src/main/res/values-ja/strings.xml+++ b/web/src/main/res/values-ja/strings.xml@@ -4,7 +4,6 @@     <string name="history">履歴</string>     <string name="app_name">ウェブ</string>     <string name="search_or_enter_address">検索またはアドレスを入力</string>-    <string name="reload">再読み込み</string>     <string name="bookmarks">ブックマーク</string>     <string name="new_tab">新しいタブ</string>     <string name="new_private_tab">新しいプライベートタブ</string>
web/src/main/res/values-ru/strings.xml
diff --git a/web/src/main/res/values-ru/strings.xml b/web/src/main/res/values-ru/strings.xmlindex c9c66bd78e..e9f0457e55 100644--- a/web/src/main/res/values-ru/strings.xml+++ b/web/src/main/res/values-ru/strings.xml@@ -6,7 +6,6 @@     <string name="history">История</string>     <string name="app_name">Web</string>     <string name="search_or_enter_address">Поиск или введите адрес</string>-    <string name="reload">Перезагрузить</string>     <string name="new_tab">Новая вкладка</string>     <string name="new_private_tab">Новая приватная вкладка</string>     <string name="downloads">Загрузки</string>
web/src/main/res/values-sv/strings.xml
diff --git a/web/src/main/res/values-sv/strings.xml b/web/src/main/res/values-sv/strings.xmlindex 5ff2d0f282..ae1ecdd915 100644--- a/web/src/main/res/values-sv/strings.xml+++ b/web/src/main/res/values-sv/strings.xml@@ -5,7 +5,6 @@     <string name="history">Historik</string>     <string name="app_name">Webb</string>     <string name="search_or_enter_address">Sök eller ange adress</string>-    <string name="reload">Ladda om</string>     <string name="new_tab">Ny flik</string>     <string name="new_private_tab">Ny privat flik</string>     <string name="downloads">Hämtningar</string>@@ -115,7 +114,6 @@     <string name="local_network_title">Tillåt åtkomst till lokalt nätverk?</string>     <string name="local_network_message">%1$s verkar vara en enhet i ditt nätverk. Android behöver behörighet till det lokala nätverket innan sidan kan läsas in.</string>     <string name="open_link">Öppna länk</string>-    <string name="go_forward">Framåt</string>     <plurals name="shields_blocked_count">         <item quantity="one">%1$d blockerad på den här sidan</item>         <item quantity="other">%1$d blockerade på den här sidan</item>
web/src/main/res/values-zh-rCN/strings.xml
diff --git a/web/src/main/res/values-zh-rCN/strings.xml b/web/src/main/res/values-zh-rCN/strings.xmlindex b1f142ba79..d362151fd2 100644--- a/web/src/main/res/values-zh-rCN/strings.xml+++ b/web/src/main/res/values-zh-rCN/strings.xml@@ -48,7 +48,6 @@     <string name="privacy_data">隐私和数据</string>     <string name="open_a_site_and_tap_menu_install_app_add">打开一个网站,点击菜单 → 安装应用 / 添加到主屏幕。这将创建一个固定快捷方式,用于独立启动 PwaActivity(无浏览器界面)。图标将优先使用最佳的 192×192 图标或 apple-touch-icon;如果没有,则回退为字母图标。</string>     <string name="new_private_tab">新私密标签页</string>-    <string name="reload">重新加载</string>     <string name="blank_new_tab_tap_the_address_pill_to_se">空白新标签页 — 点击地址栏进行搜索。地址栏中显示完整网址。在展开的搜索栏卡片中可直接刷新/清除实时内容。</string>     <string name="delete_bookmark">删除书签?</string>     <string name="bookmarks_inside_will_also_be_deleted">“%1$s”中的书签也将被删除。</string>
web/src/main/res/values/strings.xml
diff --git a/web/src/main/res/values/strings.xml b/web/src/main/res/values/strings.xmlindex 8d5f7cb659..076ef42e21 100644--- a/web/src/main/res/values/strings.xml+++ b/web/src/main/res/values/strings.xml@@ -2,7 +2,6 @@ <resources>     <string name="app_name">Web</string>     <string name="search_or_enter_address">Search or enter address</string>-    <string name="reload">Reload</string>     <string name="bookmarks">Bookmarks</string>     <string name="history">History</string>     <string name="new_tab">New tab</string>@@ -109,7 +108,6 @@     <string name="shields_clear_exceptions">Clear all site exceptions</string>     <string name="copy_link">Copy link</string>     <string name="open_link">Open link</string>-    <string name="go_forward">Forward</string>     <string name="open_in_new_tab">Open in new tab</string>     <string name="link_copied">Link copied</string>     <string name="cleartext_blocked_title">Insecure connection blocked</string>
web/src/test/java/com/vayunmathur/web/ui/BrowserMenuIconRowTest.kt
diff --git a/web/src/test/java/com/vayunmathur/web/ui/BrowserMenuIconRowTest.kt b/web/src/test/java/com/vayunmathur/web/ui/BrowserMenuIconRowTest.ktnew file mode 100644index 0000000000..9147232b93--- /dev/null+++ b/web/src/test/java/com/vayunmathur/web/ui/BrowserMenuIconRowTest.kt@@ -0,0 +1,168 @@+package com.vayunmathur.web.ui++import android.os.Looper+import androidx.compose.ui.test.assertIsEnabled+import androidx.compose.ui.test.assertIsNotEnabled+import androidx.compose.ui.test.hasText+import androidx.compose.ui.test.junit4.createComposeRule+import androidx.compose.ui.test.onNodeWithContentDescription+import androidx.compose.ui.test.performClick+import androidx.room3.Room+import androidx.test.core.app.ApplicationProvider+import com.vayunmathur.library.util.NavBackStack+import com.vayunmathur.web.Route+import com.vayunmathur.web.data.WebDatabase+import com.vayunmathur.web.platform.TestStores+import com.vayunmathur.web.platform.WebViewModel+import com.vayunmathur.web.platform.newTab+import kotlin.test.AfterTest+import kotlin.test.Test+import kotlin.test.assertEquals+import kotlin.test.assertNotNull+import kotlin.test.assertTrue+import org.junit.Rule+import org.junit.runner.RunWith+import org.robolectric.RobolectricTestRunner+import org.robolectric.Shadows.shadowOf++@RunWith(RobolectricTestRunner::class)+class BrowserMenuIconRowTest {++    @get:Rule val rule = createComposeRule()++    private val context = ApplicationProvider.getApplicationContext<android.content.Context>()+    private val db = Room.inMemoryDatabaseBuilder(context, WebDatabase::class.java)+        .allowMainThreadQueries().build()+    private val stores = TestStores(db)+    private val createdVms = mutableListOf<WebViewModel>()++    @AfterTest fun cleanup() {+        val m = androidx.lifecycle.ViewModel::class.java.getDeclaredMethod("onCleared")+        m.isAccessible = true+        createdVms.forEach { runCatching { m.invoke(it) } }+        createdVms.clear()+        db.close()+    }++    private fun vm(): WebViewModel {+        val v = WebViewModel(stores, context, windowId = "menu-${System.nanoTime()}", incognito = false)+        createdVms += v+        shadowOf(Looper.getMainLooper()).idle()+        return v+    }++    private fun setMenu(+        v: WebViewModel,+        stack: NavBackStack<Route> = NavBackStack(arrayOf<Route>(Route.Browser)),+        isNewTabActive: Boolean = false,+        canGoBack: Boolean = true,+        canGoForward: Boolean = true,+        onGoBack: () -> Unit = {},+        onGoForward: () -> Unit = {},+        onReload: () -> Unit = {},+    ) {+        rule.setContent {+            BrowserMenu(+                expanded = true,+                onDismiss = {},+                viewModel = v,+                backStack = stack,+                isNewTabActive = isNewTabActive,+                isCurrentBookmarked = false,+                canGoBack = canGoBack,+                canGoForward = canGoForward,+                onGoBack = onGoBack,+                onGoForward = onGoForward,+                shieldHost = null,+                blockedCount = 0,+                onShieldClick = {},+                onShowInstallDialog = {},+                onReload = onReload,+            )+        }+        rule.waitForIdle()+    }++    @Test fun iconRowHasFiveActionsInOrderAndNoDuplicateTextRows() {+        val v = vm()+        v.newTab(url = "https://menu.example/page")+        setMenu(v)+        val descriptions = listOf("Back", "Forward", "Refresh", "Share", "History")+        val lefts = descriptions.map { desc ->+            rule.onNodeWithContentDescription(desc).fetchSemanticsNode().boundsInRoot.left+        }+        // One row, left to right in the required order.+        assertEquals(lefts.sorted(), lefts)+        assertEquals(descriptions.size, lefts.toSet().size)+        // The same actions no longer exist as text rows underneath.+        for (label in listOf("Back", "Forward", "Reload", "Share", "History")) {+            assertTrue(+                rule.onAllNodes(hasText(label, substring = false)).fetchSemanticsNodes().isEmpty(),+                "duplicate text row still present: $label",+            )+        }+        // Remaining text destinations are still there.+        assertTrue(rule.onAllNodes(hasText("New tab", substring = true)).fetchSemanticsNodes().isNotEmpty())+        assertTrue(rule.onAllNodes(hasText("Bookmarks", substring = true)).fetchSemanticsNodes().isNotEmpty())+    }++    @Test fun iconRowDisabledStatesGreyOutAndDoNotFire() {+        val v = vm()+        v.newTab(url = "https://menu.example/page")+        var backFired = false+        var reloadFired = false+        setMenu(+            v,+            isNewTabActive = true,+            canGoBack = false,+            canGoForward = false,+            onGoBack = { backFired = true },+            onReload = { reloadFired = true },+        )+        rule.onNodeWithContentDescription("Back").assertIsNotEnabled()+        rule.onNodeWithContentDescription("Forward").assertIsNotEnabled()+        // Nothing to reload on a new tab, so reload is disabled in place.+        rule.onNodeWithContentDescription("Refresh").assertIsNotEnabled()+        // Share and History stay available.+        rule.onNodeWithContentDescription("Share").assertIsEnabled()+        rule.onNodeWithContentDescription("History").assertIsEnabled()+        rule.onNodeWithContentDescription("Back").performClick()+        rule.onNodeWithContentDescription("Refresh").performClick()+        rule.waitForIdle()+        assertTrue(!backFired && !reloadFired)+    }++    @Test fun iconRowActionsFireAndHistoryNavigates() {+        val v = vm()+        v.newTab(url = "https://menu.example/page")+        val stack = NavBackStack(arrayOf<Route>(Route.Browser))+        var back = false+        var forward = false+        var reload = false+        setMenu(+            v,+            stack = stack,+            onGoBack = { back = true },+            onGoForward = { forward = true },+            onReload = { reload = true },+        )+        rule.onNodeWithContentDescription("Back").performClick()+        rule.onNodeWithContentDescription("Forward").performClick()+        rule.onNodeWithContentDescription("Refresh").performClick()+        rule.waitForIdle()+        assertTrue(back && forward && reload)+        rule.onNodeWithContentDescription("History").performClick()+        rule.waitForIdle()+        assertEquals(Route.History, stack.backStack.lastOrNull())+    }++    @Test fun shareIconSharesActiveTabUrl() {+        val v = vm()+        v.newTab(url = "https://menu.example/share-me")+        setMenu(v)+        rule.onNodeWithContentDescription("Share").performClick()+        rule.waitForIdle()+        val started = shadowOf(context as android.app.Application).nextStartedActivity+        assertNotNull(started)+    }+}
web/src/test/java/com/vayunmathur/web/ui/SearchAndMenuDeepTest.kt
diff --git a/web/src/test/java/com/vayunmathur/web/ui/SearchAndMenuDeepTest.kt b/web/src/test/java/com/vayunmathur/web/ui/SearchAndMenuDeepTest.ktindex 2288cc24d3..52e2b7eb67 100644--- a/web/src/test/java/com/vayunmathur/web/ui/SearchAndMenuDeepTest.kt+++ b/web/src/test/java/com/vayunmathur/web/ui/SearchAndMenuDeepTest.kt@@ -6,6 +6,7 @@ import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.hasScrollAction import androidx.compose.ui.test.hasText import androidx.compose.ui.test.junit4.createComposeRule+import androidx.compose.ui.test.onNodeWithContentDescription import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick import androidx.compose.ui.test.performScrollToNode@@ -118,8 +119,7 @@ class SearchAndMenuDeepTest {         rule.waitForIdle()         // Remove-bookmark item (already bookmarked state) is present.         rule.onNodeWithText("Remove bookmark").assertIsDisplayed()-        rule.onNode(hasScrollAction()).performScrollToNode(hasText("Share"))-        rule.onNodeWithText("Share").performClick()+        rule.onNodeWithContentDescription("Share").performClick()         rule.waitForIdle()         // Robolectric records the chooser intent the share item fires.         val started = shadowOf(context as android.app.Application).nextStartedActivity
web/src/test/java/com/vayunmathur/web/ui/WebPagesDeepTest.kt
diff --git a/web/src/test/java/com/vayunmathur/web/ui/WebPagesDeepTest.kt b/web/src/test/java/com/vayunmathur/web/ui/WebPagesDeepTest.ktindex fdb6770996..9194c3f6a0 100644--- a/web/src/test/java/com/vayunmathur/web/ui/WebPagesDeepTest.kt+++ b/web/src/test/java/com/vayunmathur/web/ui/WebPagesDeepTest.kt@@ -5,6 +5,7 @@ import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.hasText import androidx.compose.ui.test.isToggleable import androidx.compose.ui.test.junit4.createComposeRule+import androidx.compose.ui.test.onNodeWithContentDescription import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.longClick import androidx.compose.ui.test.performClick@@ -305,16 +306,16 @@ class WebPagesDeepTest {             )         }         rule.waitForIdle()-        rule.onNodeWithText("Back").performClick()+        rule.onNodeWithContentDescription("Back").performClick()         rule.waitForIdle()         assertTrue(back)-        rule.onNodeWithText("Forward").performClick()+        rule.onNodeWithContentDescription("Forward").performClick()         rule.waitForIdle()         assertTrue(forward)         rule.onNodeWithText("Shields").performClick()         rule.waitForIdle()         assertTrue(shields)-        rule.onNodeWithText("Reload").performClick()+        rule.onNodeWithContentDescription("Refresh").performClick()         rule.waitForIdle()         assertTrue(reload)         scrollToText("Bookmarks")
web/src/test/java/com/vayunmathur/web/ui/WebPagesTest.kt
diff --git a/web/src/test/java/com/vayunmathur/web/ui/WebPagesTest.kt b/web/src/test/java/com/vayunmathur/web/ui/WebPagesTest.ktindex 0bd6b25c5a..470fb46aea 100644--- a/web/src/test/java/com/vayunmathur/web/ui/WebPagesTest.kt+++ b/web/src/test/java/com/vayunmathur/web/ui/WebPagesTest.kt@@ -6,6 +6,7 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.junit4.createComposeRule+import androidx.compose.ui.test.onNodeWithContentDescription import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick import androidx.room3.Room@@ -196,7 +197,7 @@ class WebPagesTest {             )         }         rule.waitForIdle()-        rule.onNodeWithText("History").performClick()+        rule.onNodeWithContentDescription("History").performClick()         rule.waitForIdle()         assertTrue(dismissed)         assertEquals(Route.History, stack.backStack.last())