fix: resolve all build compilation and style check warnings (#597)

* fix: resolve all build compilation and style check warnings

* fix: remove unused import in SystemViewModel
This commit is contained in:
M57 authored and GitHub committed 2026-07-14 21:55:37 +03:00
1 parent 48f5ffbe52
commit d1fc477bcd
28 files changed
+293 -192

No files matched your search

@@ -28,6 +28,7 @@ import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.Send
import androidx.compose.material.icons.filled.CheckCircle
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.Code
@@ -37,7 +38,6 @@ import androidx.compose.material.icons.filled.History
import androidx.compose.material.icons.filled.Language
import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.filled.SelectAll
import androidx.compose.material.icons.filled.Send
import androidx.compose.material.icons.filled.Terminal
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button
@@ -115,7 +115,7 @@ import kotlin.math.abs
*/
private fun sourceIcon(source: String?): ImageVector? =
when (source?.lowercase()) {
"telegram", "tg" -> Icons.Filled.Send
"telegram", "tg" -> Icons.AutoMirrored.Filled.Send
"web", "dashboard" -> Icons.Filled.Language
"api", "rest" -> Icons.Filled.Code
"cli", "terminal" -> Icons.Filled.Terminal
@@ -254,10 +254,6 @@ private fun JsonElement.searchText(): String? =
.firstNotNullOfOrNull { fieldName -> this[fieldName]?.searchText() }
?: wrapperFieldNames.firstNotNullOfOrNull { fieldName -> this[fieldName]?.searchText() }
}
else -> {
null
}
}
private fun displayedSessions(state: SessionsUiState): List<SessionTreeItem> =
@@ -85,8 +85,8 @@ class SessionsViewModel : ViewModel() {
it.copy(
isLoading = false,
isLoadingMore = false,
sessions = data?.sessions.orEmpty(),
total = data?.total ?: 0,
sessions = data.sessions.orEmpty(),
total = data.total,
selectedIds = emptySet(),
)
}
@@ -173,7 +173,7 @@ class SessionsViewModel : ViewModel() {
_uiState.update {
it.copy(
isSearching = false,
searchResults = result.data?.results.orEmpty(),
searchResults = result.data.results.orEmpty(),
searchError = null,
)
}
@@ -207,8 +207,7 @@ class SessionsViewModel : ViewModel() {
it.copy(
isLoadingStats = false,
stats =
data?.let { SessionStats(total = it.total, active = it.active) }
?: SessionStats(),
SessionStats(total = data.total, active = data.active),
)
}
},
@@ -318,7 +317,7 @@ class SessionsViewModel : ViewModel() {
}
when (result) {
is NetworkResult.Success -> {
val promptText = result.data?.prompt ?: "No prompt available"
val promptText = result.data.prompt ?: "No prompt available"
_uiState.update { it.copy(toastMessage = promptText) }
}