From 44dbcaa59d06b8a34f2cbe08b0bbec461ebce8cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=B0=D0=B6=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=90=D1=80?= =?UTF-8?q?=D1=82=D0=B5=D0=BC?= Date: Thu, 26 Feb 2026 22:07:29 +0300 Subject: [PATCH 1/2] Add text size limit for share logs --- .../kick/module/logging/feature/table/util/LaunchUtils.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/module/logging/logging/src/androidMain/kotlin/ru/bartwell/kick/module/logging/feature/table/util/LaunchUtils.kt b/module/logging/logging/src/androidMain/kotlin/ru/bartwell/kick/module/logging/feature/table/util/LaunchUtils.kt index 786da57..46b9727 100644 --- a/module/logging/logging/src/androidMain/kotlin/ru/bartwell/kick/module/logging/feature/table/util/LaunchUtils.kt +++ b/module/logging/logging/src/androidMain/kotlin/ru/bartwell/kick/module/logging/feature/table/util/LaunchUtils.kt @@ -21,6 +21,7 @@ internal actual object LaunchUtils { private const val SHARE_FILE_NAME = "android.log" private const val SHARE_TEXT_TITLE = "Share logs as text" private const val SHARE_FILE_TITLE = "Share logs as file" + private const val MAX_SHARE_TEXT_CHARS = 120_000 internal actual fun canCopyLogs(): Boolean = true internal actual fun canSaveLogsToFile(): Boolean = true @@ -57,6 +58,10 @@ internal actual object LaunchUtils { internal actual fun shareLogsAsText(context: PlatformContext, logs: List) { val androidContext = context.get() val text = logs.joinToString(separator = "\n") { it.toLogString() } + if (text.length > MAX_SHARE_TEXT_CHARS) { + shareLogsAsFile(context = context, logs = logs) + return + } Intent(Intent.ACTION_SEND).apply { type = LOG_MIME_TYPE putExtra(Intent.EXTRA_TEXT, text) From ead7f79990b1a734b3af028932e70e475f196925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=B0=D0=B6=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=90=D1=80?= =?UTF-8?q?=D1=82=D0=B5=D0=BC?= Date: Sat, 27 Jun 2026 17:55:11 +0300 Subject: [PATCH 2/2] Add text selection to logging module --- .gitignore | 1 + .../table/presentation/LogViewerContent.kt | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 007f6af..0ff128a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ xcuserdata /module/network/ktor3/schemas/* /sample/shared/schemas/* /.gradle-home/* +/.refact/* diff --git a/module/logging/logging/src/commonMain/kotlin/ru/bartwell/kick/module/logging/feature/table/presentation/LogViewerContent.kt b/module/logging/logging/src/commonMain/kotlin/ru/bartwell/kick/module/logging/feature/table/presentation/LogViewerContent.kt index e7ca3f7..796f270 100644 --- a/module/logging/logging/src/commonMain/kotlin/ru/bartwell/kick/module/logging/feature/table/presentation/LogViewerContent.kt +++ b/module/logging/logging/src/commonMain/kotlin/ru/bartwell/kick/module/logging/feature/table/presentation/LogViewerContent.kt @@ -7,6 +7,7 @@ import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyRow import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.rememberLazyListState +import androidx.compose.foundation.text.selection.SelectionContainer import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.ClearAll import androidx.compose.material.icons.filled.FileDownload @@ -91,12 +92,14 @@ internal fun LogViewerContent( LabelsBar(component = component, state = state) } ErrorBox(modifier = Modifier.fillMaxSize(), error = state.error) { - LazyColumn( - state = listState, - modifier = Modifier.fillMaxSize().testTag("log_list"), - ) { - items(state.log) { item -> - Item(item) + SelectionContainer { + LazyColumn( + state = listState, + modifier = Modifier.fillMaxSize().testTag("log_list"), + ) { + items(state.log) { item -> + Item(item) + } } } }