diff --git a/feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/TweaksAction.kt b/feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/TweaksAction.kt index e513dcc80..75b70438b 100644 --- a/feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/TweaksAction.kt +++ b/feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/TweaksAction.kt @@ -121,8 +121,6 @@ sealed interface TweaksAction { data object OnClearDownloadsDismiss : TweaksAction - data object OnHelpClick : TweaksAction - data object OnFeedbackClick : TweaksAction data object OnFeedbackDismiss : TweaksAction diff --git a/feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/TweaksViewModel.kt b/feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/TweaksViewModel.kt index 2e6edd781..28cbf1dec 100644 --- a/feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/TweaksViewModel.kt +++ b/feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/TweaksViewModel.kt @@ -20,6 +20,7 @@ import zed.rainxch.core.domain.model.ProxyConfig import zed.rainxch.core.domain.model.ProxyScope import zed.rainxch.core.domain.model.TranslationProvider import zed.rainxch.core.domain.network.ProxyTestOutcome +import zed.rainxch.core.domain.logging.GitHubStoreLogger import zed.rainxch.core.domain.network.ProxyTester import zed.rainxch.core.domain.repository.DeviceIdentityRepository import zed.rainxch.core.domain.repository.ProxyRepository @@ -28,7 +29,6 @@ import zed.rainxch.core.domain.repository.TelemetryRepository import zed.rainxch.core.domain.repository.TweaksRepository import zed.rainxch.core.domain.system.InstallerStatusProvider import zed.rainxch.core.domain.system.UpdateScheduleManager -import zed.rainxch.core.domain.utils.BrowserHelper import zed.rainxch.tweaks.presentation.model.ProxyScopeFormState import zed.rainxch.githubstore.core.presentation.res.Res import zed.rainxch.githubstore.core.presentation.res.failed_to_save_proxy_settings @@ -44,7 +44,6 @@ import zed.rainxch.profile.domain.repository.ProfileRepository import zed.rainxch.tweaks.presentation.model.ProxyType class TweaksViewModel( - private val browserHelper: BrowserHelper, private val tweaksRepository: TweaksRepository, private val profileRepository: ProfileRepository, private val installerStatusProvider: InstallerStatusProvider, @@ -54,6 +53,7 @@ class TweaksViewModel( private val seenReposRepository: SeenReposRepository, private val deviceIdentityRepository: DeviceIdentityRepository, private val telemetryRepository: TelemetryRepository, + private val logger: GitHubStoreLogger, ) : ViewModel() { private var hasLoadedInitialData = false private var cacheSizeJob: Job? = null @@ -315,7 +315,7 @@ class TweaksViewModel( ) } }.onFailure { error -> - println("TweaksViewModel: failed to persist installer attribution: ${error.message}") + logger.error("TweaksViewModel: failed to persist installer attribution", error) _state.update { it.copy(installerAttributionCustomError = "write_failed") } @@ -327,7 +327,7 @@ class TweaksViewModel( viewModelScope.launch { tweaksRepository.getInstallerAttribution() .catch { e -> - println("TweaksViewModel: installer attribution flow error: ${e.message}") + logger.error("TweaksViewModel: installer attribution flow error", e) } .collect { attribution -> _state.update { current -> @@ -678,7 +678,7 @@ class TweaksViewModel( }.onSuccess { _state.update { it.copy(installerAttributionCustomError = null) } }.onFailure { error -> - println("TweaksViewModel: failed to persist installer attribution: ${error.message}") + logger.error("TweaksViewModel: failed to persist installer attribution", error) _state.update { it.copy(installerAttributionCustomError = "write_failed") } } } @@ -768,12 +768,6 @@ class TweaksViewModel( _state.update { it.copy(isClearDownloadsDialogVisible = false) } } - TweaksAction.OnHelpClick -> { - browserHelper.openUrl( - url = "https://github.com/OpenHub-Store/GitHub-Store/issues", - ) - } - TweaksAction.OnMirrorPickerClick -> { // Handled in composable } diff --git a/feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/components/sections/About.kt b/feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/components/sections/About.kt index d260faf1b..181a45cc5 100644 --- a/feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/components/sections/About.kt +++ b/feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/components/sections/About.kt @@ -1,6 +1,8 @@ package zed.rainxch.tweaks.presentation.components.sections +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth @@ -8,6 +10,7 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.LazyListScope +import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight @@ -25,6 +28,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp @@ -113,18 +117,18 @@ private fun AboutItem( horizontalArrangement = Arrangement.spacedBy(12.dp), verticalAlignment = Alignment.CenterVertically, ) { - IconButton( - shapes = IconButtonDefaults.shapes(), - onClick = { }, - colors = - IconButtonDefaults.iconButtonColors( - containerColor = MaterialTheme.colorScheme.secondaryContainer, - contentColor = MaterialTheme.colorScheme.onSecondaryContainer, - ), + Box( + modifier = + Modifier + .size(40.dp) + .clip(CircleShape) + .background(MaterialTheme.colorScheme.secondaryContainer), + contentAlignment = Alignment.Center, ) { Icon( imageVector = icon, contentDescription = null, + tint = MaterialTheme.colorScheme.onSecondaryContainer, modifier = Modifier.size(24.dp), ) } diff --git a/feature/tweaks/presentation/src/jvmMain/kotlin/zed/rainxch/tweaks/presentation/RestartApp.jvm.kt b/feature/tweaks/presentation/src/jvmMain/kotlin/zed/rainxch/tweaks/presentation/RestartApp.jvm.kt index 2891b5289..58a1f849b 100644 --- a/feature/tweaks/presentation/src/jvmMain/kotlin/zed/rainxch/tweaks/presentation/RestartApp.jvm.kt +++ b/feature/tweaks/presentation/src/jvmMain/kotlin/zed/rainxch/tweaks/presentation/RestartApp.jvm.kt @@ -1,5 +1,6 @@ package zed.rainxch.tweaks.presentation +import co.touchlab.kermit.Logger import kotlin.system.exitProcess /** @@ -29,18 +30,17 @@ actual fun restartAppAfterLanguageChange() { .inheritIO() .start() } else { - System.err.println( - "restartAppAfterLanguageChange: ProcessHandle has no command; exiting without relaunch", - ) + Logger.w { + "restartAppAfterLanguageChange: ProcessHandle has no command; exiting without relaunch" + } } } catch (t: Throwable) { // Swallow: we'd rather exit cleanly than leave the user in a // limbo where the app is stuck with the old locale because - // the relaunch errored out. stderr so packaging regressions - // are still noticeable in logs without adding a logging dep. - System.err.println( - "restartAppAfterLanguageChange: relaunch failed (${t.javaClass.simpleName}: ${t.message}), falling back to plain exit", - ) + // the relaunch errored out. + Logger.w(t) { + "restartAppAfterLanguageChange: relaunch failed, falling back to plain exit" + } } exitProcess(0) }