mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-04 12:57:45 +00:00
ui tests: track the chat list reorder in UiIdle, quote test without scroll-to-bottom; ci: Kotlin daemon heap for the APK build
This commit is contained in:
1 parent
377cdb17c1
commit
c58dd396e2
3 files changed
+11
-2
No files matched your search
@@ -352,6 +352,7 @@ jobs:
|
||||
working-directory: apps/multiplatform
|
||||
run: |
|
||||
./gradlew --no-daemon --console=plain -Psimplex.assets.dir=../../assets -Pandroid.injected.build.abi=arm64-v8a \
|
||||
-Pkotlin.daemon.jvmargs=-Xmx4g \
|
||||
:android:assembleFossDebug :android:assembleFossDebugAndroidTest
|
||||
mkdir -p "$RUNNER_TEMP/apk"
|
||||
cp "android/build/intermediates/apk/foss/debug/$APK" "$RUNNER_TEMP/apk"
|
||||
|
||||
+10
-1
@@ -10,6 +10,7 @@ import androidx.compose.ui.text.font.*
|
||||
import androidx.compose.ui.text.style.TextDecoration
|
||||
import chat.simplex.common.model.MsgFilter.*
|
||||
import chat.simplex.common.platform.*
|
||||
import chat.simplex.common.ui.UiIdle
|
||||
import chat.simplex.common.ui.theme.*
|
||||
import chat.simplex.common.views.call.*
|
||||
import chat.simplex.common.views.chat.*
|
||||
@@ -844,6 +845,7 @@ object ChatModel {
|
||||
private val subject = MutableSharedFlow<Unit>()
|
||||
private var remoteHostId: Long? = null
|
||||
private val chatsToPop = mutableMapOf<ChatId, Instant>()
|
||||
@Volatile private var pendingIdle = 0L
|
||||
|
||||
init {
|
||||
withLongRunningApi(idle = false) {
|
||||
@@ -852,6 +854,8 @@ object ChatModel {
|
||||
.collect {
|
||||
withContext(Dispatchers.Main) {
|
||||
chatsCtx.chats.replaceAll(popCollectedChats())
|
||||
UiIdle.finish(pendingIdle)
|
||||
pendingIdle = 0L
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -864,11 +868,16 @@ object ChatModel {
|
||||
}
|
||||
if (currentPosition > 0 || chatsToPop.isNotEmpty()) {
|
||||
chatsToPop[chatId] = Clock.System.now()
|
||||
if (pendingIdle == 0L) pendingIdle = UiIdle.start { "chat list reorder" }
|
||||
subject.emit(Unit)
|
||||
}
|
||||
}
|
||||
|
||||
fun clear() = chatsToPop.clear()
|
||||
fun clear() {
|
||||
chatsToPop.clear()
|
||||
UiIdle.finish(pendingIdle)
|
||||
pendingIdle = 0L
|
||||
}
|
||||
|
||||
private fun popCollectedChats(): List<Chat> {
|
||||
val chs = mutableListOf<Chat>()
|
||||
|
||||
-1
@@ -48,7 +48,6 @@ class ReceivedMessagesTest : UiTest() {
|
||||
}
|
||||
assumeTrue("Android: the chat does not reach bob's reply before the quote can be clicked (plan 15.4.1c, open)", !appPlatform.isAndroid)
|
||||
hideKeyboard()
|
||||
chat.scrollToBottom()
|
||||
assertFalse("the quoted message is out of view before the quote is clicked", exists(Ui.Chat.Item(original)))
|
||||
click(Ui.Chat.Item(reply).part("quote"))
|
||||
poll(what = "the quoted message scrolled into view") { exists(Ui.Chat.Item(original)) }
|
||||
|
||||
Reference in new issue
Block a user