chore: eliminate all Kotlin compiler warnings in main source (#877)
* chore: eliminate all Kotlin compiler warnings in main source * test(chat): fix cross-class coroutine leaks poisoning the unit suite - ChatUpdateCommandTest: inject FakeSlashUsageStore — the real DataStore store inits on real IO threads with a relaxed-mock app (cacheDir NPE) and leaks an uncaught exception into the next runTest class. - ChatUpdateCommandTest + SlashCommandDispatchRpcTest: mock ProfileSwitchCoordinator.switched (ChatViewModelTest pattern) — VMs otherwise park collectors on the singleton flow that crash later classes (ProfileSwitchCoordinatorTest) on stale-Main resumption. Full suite: 944 tests, 0 failures (was 2 flaky per run). --------- Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
1 parent
b05cffa9c4
commit
1e6e248891
14 files changed
+88
-38
No files matched your search
@@ -2890,7 +2890,7 @@ class ChatViewModel(
|
||||
if (lastAssistantIdx >= 0) {
|
||||
val target = mapped[lastAssistantIdx]
|
||||
if (target.reasoningText.isBlank()) {
|
||||
mapped[lastAssistantIdx] = target.copy(reasoningText = pendingReasoning!!)
|
||||
mapped[lastAssistantIdx] = target.copy(reasoningText = pendingReasoning)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,9 @@ import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.BasicTextField
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.InsertDriveFile
|
||||
import androidx.compose.material.icons.automirrored.filled.Send
|
||||
import androidx.compose.material.icons.filled.Close
|
||||
import androidx.compose.material.icons.filled.InsertDriveFile
|
||||
import androidx.compose.material3.DropdownMenu
|
||||
import androidx.compose.material3.DropdownMenuItem
|
||||
import androidx.compose.material3.Icon
|
||||
@@ -405,7 +405,7 @@ fun AttachmentChip(
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
} else {
|
||||
Icon(
|
||||
imageVector = Icons.Default.InsertDriveFile,
|
||||
imageVector = Icons.AutoMirrored.Filled.InsertDriveFile,
|
||||
contentDescription = attachment.name,
|
||||
modifier = Modifier.size(24.dp),
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
|
||||
@@ -90,7 +90,7 @@ object ToolViewBuilder {
|
||||
raw = firstString(parseMaybeObject(value), listOf("context"))
|
||||
}
|
||||
|
||||
return compactPreview(raw ?: "", max)
|
||||
return compactPreview(raw, max)
|
||||
}
|
||||
|
||||
private fun contextValue(value: JsonElement?): String {
|
||||
@@ -1328,8 +1328,8 @@ object ToolViewBuilder {
|
||||
val elements = result?.get("elements") as? JsonArray
|
||||
if (elements != null) {
|
||||
val mode = firstString(result, listOf("mode"))
|
||||
val width = intValue(result?.get("width"))
|
||||
val height = intValue(result?.get("height"))
|
||||
val width = intValue(result.get("width"))
|
||||
val height = intValue(result.get("height"))
|
||||
val modePart = mode.takeIf { it.isNotEmpty() }?.let { " ($it)" } ?: ""
|
||||
val sizePart = if (width != null && height != null) " ${width}x$height" else ""
|
||||
return "${elements.size} elements$modePart$sizePart"
|
||||
|
||||
Reference in new issue
Block a user