Modern Apps git

← Modern-Apps.git

news: shorten feed search hint to Search

Commit
07c9c762cce05fdee337c9036d3251746f25d88a
Author
Vayun Mathur <[email protected]>
When
2026-12-02 02:24 UTC (4 days ago)
Parents
197288e
The News feed search bar said "Search downloaded news", which is
longer and more specific than the owner wants the bar to read.

Point the ScaffoldSearch placeholder at the existing generic
library-ui search string (UiR.string.search, "Search" in the
default locale with existing localisations in the library-ui
locale files) instead of the news-owned feed_search_placeholder,
and remove the now-unused news string. Search behaviour is
unchanged; only the hint text changes.

Update the unit and instrumented tests that pinned the old hint
to look for "Search".

Verified: ./gradlew :news:lint :news:lintVitalRelease
:news:testDevUnitTest green (BUILD SUCCESSFUL; lintVitalRelease
itself reported SKIPPED by Gradle, lint and lintDev ran, unit
tests passed).

Diff

news/src/androidTest/java/com/vayunmathur/news/ui/CoreJourneyTest.kt
diff --git a/news/src/androidTest/java/com/vayunmathur/news/ui/CoreJourneyTest.kt b/news/src/androidTest/java/com/vayunmathur/news/ui/CoreJourneyTest.ktindex 3fcd2f80fa..1dd306c8c0 100644--- a/news/src/androidTest/java/com/vayunmathur/news/ui/CoreJourneyTest.kt+++ b/news/src/androidTest/java/com/vayunmathur/news/ui/CoreJourneyTest.kt@@ -34,14 +34,14 @@ class CoreJourneyTest {         val packageName = targetContext.packageName         grantAll(instrumentation.uiAutomation, targetContext.packageManager, packageName)         launch(packageName, device, targetContext)-        waitAny(device, "Search downloaded news", "No articles yet. Pull to refresh.")+        waitAny(device, "Search", "No articles yet. Pull to refresh.")         // Try to open the first story: story rows are clickable cards below the chips.         Thread.sleep(3000)         val rows = device.findObjects(By.clickable(true))         val storyRow = rows.firstOrNull { it.visibleBounds.top > 300 && it.visibleBounds.height() > 60 }         if (storyRow != null) {             val b = storyRow.visibleBounds; device.click(b.centerX(), b.centerY())-            val landed = waitAny(device, "Summary", "How it developed", "1 source", "This story is no longer in the downloaded feed.", "Search downloaded news")+            val landed = waitAny(device, "Summary", "How it developed", "1 source", "This story is no longer in the downloaded feed.", "Search")             if (landed == "Summary" || landed == "How it developed" || landed == "1 source") {                 // Open the first article in the reader.                 val arts = device.findObjects(By.clickable(true))
news/src/main/java/com/vayunmathur/news/ui/FeedScreen.kt
diff --git a/news/src/main/java/com/vayunmathur/news/ui/FeedScreen.kt b/news/src/main/java/com/vayunmathur/news/ui/FeedScreen.ktindex f743416493..4d187fdc22 100644--- a/news/src/main/java/com/vayunmathur/news/ui/FeedScreen.kt+++ b/news/src/main/java/com/vayunmathur/news/ui/FeedScreen.kt@@ -16,6 +16,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.vayunmathur.library.ui.AppScaffold+import com.vayunmathur.library.ui.R as UiR import com.vayunmathur.library.ui.ScaffoldSearch import com.vayunmathur.library.ui.adaptiveGridCells import com.vayunmathur.library.ui.isMediumWidth@@ -108,7 +109,7 @@ internal fun FeedContent(         search = ScaffoldSearch(             query = searchQuery,             onQueryChange = onSearchQueryChange,-            placeholder = stringResource(R.string.feed_search_placeholder),+            placeholder = stringResource(UiR.string.search),         ),         isRefreshing = isRefreshing,         onRefresh = onRefresh,
news/src/main/res/values/strings.xml
diff --git a/news/src/main/res/values/strings.xml b/news/src/main/res/values/strings.xmlindex f03957f739..75c3672327 100644--- a/news/src/main/res/values/strings.xml+++ b/news/src/main/res/values/strings.xml@@ -6,7 +6,6 @@     <string name="feed_empty">No articles yet. Pull to refresh.</string>     <string name="feed_all_categories">All</string>     <string name="feed_refresh_failed">Could not refresh all sources; showing the cached feed.</string>-    <string name="feed_search_placeholder">Search downloaded news</string>     <string name="feed_search_empty">No downloaded articles match. Search covers titles and articles you have opened.</string>     <!-- ReaderScreen -->     <string name="reader_text_smaller">Smaller text</string>
news/src/test/java/com/vayunmathur/news/ui/FeedScreenTest.kt
diff --git a/news/src/test/java/com/vayunmathur/news/ui/FeedScreenTest.kt b/news/src/test/java/com/vayunmathur/news/ui/FeedScreenTest.ktindex 954b7f3da9..6cf30c9bc7 100644--- a/news/src/test/java/com/vayunmathur/news/ui/FeedScreenTest.kt+++ b/news/src/test/java/com/vayunmathur/news/ui/FeedScreenTest.kt@@ -61,7 +61,7 @@ class FeedScreenTest {     @Test fun searchBarIsTheTopAppBar_noNewsTitle() {         setFeed()         // The search field occupies the top bar; the "News" title is gone.-        rule.onNodeWithText("Search downloaded news").assertIsDisplayed()+        rule.onNodeWithText("Search").assertIsDisplayed()         assertEquals(0, rule.onAllNodesWithText("News").fetchSemanticsNodes().size)         // Saved/Settings navigation remains reachable; no Sources         // entry point remains anywhere on the feed.@@ -78,7 +78,7 @@ class FeedScreenTest {      @Test fun typingShowsClear_clearRestoresFeed() {         setFeed()-        rule.onNodeWithText("Search downloaded news").performTextInput("gamma")+        rule.onNodeWithText("Search").performTextInput("gamma")         rule.waitForIdle()         // Clear affordance appears once the query is non-empty.         rule.onNodeWithContentDescription("Close").assertIsDisplayed()@@ -97,7 +97,7 @@ class FeedScreenTest {         rule.waitUntil(timeoutMillis = 5_000) {             rule.onAllNodesWithText("All").fetchSemanticsNodes().isNotEmpty()         }-        rule.onNodeWithText("Search downloaded news").assertIsDisplayed()+        rule.onNodeWithText("Search").assertIsDisplayed()         rule.onNodeWithText("All").assertIsDisplayed()     }