From 85da03360d7dc7da0ce67e00c745afe49c09fc6e Mon Sep 17 00:00:00 2001 From: beyond Date: Sun, 6 Sep 2026 17:12:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=E6=90=9C=E7=B4=A2=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E6=B8=85=E9=99=A4=E7=A1=AE=E8=AE=A4=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5 (1M context) --- .../myapplication/screens/SearchScreen.kt | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/app/src/main/kotlin/com/example/myapplication/screens/SearchScreen.kt b/app/src/main/kotlin/com/example/myapplication/screens/SearchScreen.kt index 7d6f984..af926e6 100644 --- a/app/src/main/kotlin/com/example/myapplication/screens/SearchScreen.kt +++ b/app/src/main/kotlin/com/example/myapplication/screens/SearchScreen.kt @@ -58,7 +58,6 @@ import com.example.myapplication.data.EmbyServer import com.example.myapplication.ui.GlassSearchField import com.example.myapplication.ui.GlassTokens import com.example.myapplication.ui.LiquidGlassTopBar -import com.example.myapplication.ui.GlassConfirmDialog import com.example.myapplication.ui.LumaEmptyStateContainer import com.example.myapplication.ui.bottomBarContentPadding import com.example.myapplication.ui.design.LumaColors @@ -194,7 +193,6 @@ fun SearchScreen( val completedIds = remember { mutableSetOf() } var searching by remember { mutableStateOf(false) } var historyVersion by remember { mutableIntStateOf(0) } - var showClearHistoryConfirm by remember { mutableStateOf(false) } var lastSearchedQuery by remember { mutableStateOf("") } // Stabilize LaunchedEffect key — use only server IDs, not list reference @@ -350,7 +348,10 @@ fun SearchScreen( query.isBlank() && history.isNotEmpty() -> SearchHistoryList( history = history, onSelect = { onQueryChange(it) }, - onClear = { showClearHistoryConfirm = true }, + onClear = { + clearSearchHistory(context) + historyVersion++ + }, ) // ★ KEY FIX: searching = true always shows loading, never error/empty // This prevents the flash of error/empty state during transitions @@ -386,22 +387,6 @@ fun SearchScreen( } } } - - // Clear history confirmation dialog - if (showClearHistoryConfirm) { - GlassConfirmDialog( - title = stringResource(Res.string.search_history_clear), - message = stringResource(Res.string.search_history_clear), - confirmText = stringResource(Res.string.confirm_delete), - dismissText = stringResource(Res.string.confirm_cancel), - onConfirm = { - clearSearchHistory(context) - historyVersion++ - showClearHistoryConfirm = false - }, - onDismissRequest = { showClearHistoryConfirm = false }, - ) - } } // ─── Centered Loading ───────────────────────────────────────────────────────