fix(search): remove result row fade-in when the query changes

Remove the fade-in animation from result rows so that items render
directly when the query changes.
This commit is contained in:
OneWay committed 2026-10-04 12:33:00 +00:00
1 parent cec914ed00
commit f227546111
1 file changed
+6 -15
@@ -1,6 +1,5 @@
package com.example.research.ui.main.components package com.example.research.ui.main.components
import androidx.compose.animation.core.tween
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.* import androidx.compose.foundation.lazy.*
@@ -56,20 +55,12 @@ fun SearchResultsList(
val entry = if (showStale) staleEntries.getOrNull(index) val entry = if (showStale) staleEntries.getOrNull(index)
else if (index in 0 until results.itemCount) results.peek(index) else null else if (index in 0 until results.itemCount) results.peek(index) else null
if (entry != null) { if (entry != null) {
Box( SearchResultItem(
modifier = Modifier.animateItem( entry = entry,
fadeInSpec = if (index < 8) tween(150) else null, resultIndex = index,
placementSpec = null, onArticleClick = onArticleClick,
fadeOutSpec = null showDictionaryName = showDictionaryName
) )
) {
SearchResultItem(
entry = entry,
resultIndex = index,
onArticleClick = onArticleClick,
showDictionaryName = showDictionaryName
)
}
} }
} }