diff --git a/composeApp/src/androidMain/AndroidManifest.xml b/composeApp/src/androidMain/AndroidManifest.xml index 75adfe381..748c8d5ca 100644 --- a/composeApp/src/androidMain/AndroidManifest.xml +++ b/composeApp/src/androidMain/AndroidManifest.xml @@ -45,11 +45,13 @@ - - - + + - + diff --git a/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/components/CreateScopeBottomSheet.kt b/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/components/CreateScopeBottomSheet.kt index c6f841b25..2178b6aad 100644 --- a/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/components/CreateScopeBottomSheet.kt +++ b/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/components/CreateScopeBottomSheet.kt @@ -1,14 +1,12 @@ package io.middlepoint.morestuff.shared.ui.components import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.material3.BottomSheetDefaults import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.MaterialTheme import androidx.compose.material3.ModalBottomSheet @@ -86,15 +84,9 @@ fun CreateScopeBottomSheet( modifier = Modifier .fillMaxWidth() .padding(8.dp), - verticalAlignment = Alignment.CenterVertically + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.End ) { - Spacer(modifier = Modifier.weight(1f)) - Box( - modifier = Modifier.weight(1f), - contentAlignment = Alignment.Center - ) { - BottomSheetDefaults.DragHandle() - } TextButton( onClick = { if (scopeTitle.isNotBlank()) { @@ -110,7 +102,7 @@ fun CreateScopeBottomSheet( } ) { Column( - modifier = Modifier.fillMaxWidth(), + modifier = Modifier.fillMaxWidth().height(150.dp), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center ) { @@ -134,7 +126,8 @@ fun CreateScopeBottomSheet( Row( modifier = Modifier - .fillMaxWidth(), + .fillMaxWidth() + .padding(top = 8.dp), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.End ) { @@ -146,7 +139,7 @@ fun CreateScopeBottomSheet( fontSize = 18.sp, textAlign = TextAlign.End ), - modifier = Modifier.padding(end = 16.dp) + modifier = Modifier.padding(end = 16.dp, bottom = 16.dp) ) } } diff --git a/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/components/input/UserTextInput.kt b/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/components/input/UserTextInput.kt index 78f8f200f..82ddeabf2 100644 --- a/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/components/input/UserTextInput.kt +++ b/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/components/input/UserTextInput.kt @@ -67,7 +67,7 @@ fun UserTextInput( backgroundColor: Color = MaterialTheme.colorScheme.background, focusRequester: FocusRequester = remember { FocusRequester() }, startWithFocus: Boolean = false, - isAIEnabled: Boolean = false, + //isAIEnabled: Boolean = false, inputHint: String = stringResource(Res.string.task_chat_input_hint) ) { val a11ylabel = stringResource(Res.string.textfield_desc) @@ -84,7 +84,7 @@ fun UserTextInput( label = "neonOffset" ) - val aiEnabledTransition = updateTransition( +/* val aiEnabledTransition = updateTransition( targetState = isAIEnabled, label = "aiEnabledTransition" ) @@ -97,7 +97,7 @@ fun UserTextInput( val borderAlpha by aiEnabledTransition.animateFloat( label = "borderAlpha", transitionSpec = { tween(300) } - ) { enabled -> if (enabled) 1f else 0f } + ) { enabled -> if (enabled) 1f else 0f }*/ LaunchedEffect(Unit) { @@ -106,7 +106,7 @@ fun UserTextInput( } } - val animatedBorder = if (borderAlpha > 0f) { +/* val animatedBorder = if (borderAlpha > 0f) { val animatedNeonGradient = Brush.linearGradient( colors = listOf( Color(0xFFBDC6FF).copy(alpha = borderAlpha), @@ -117,7 +117,7 @@ fun UserTextInput( end = Offset(animatedOffset + 200f, 100f) ) BorderStroke(borderWidth, animatedNeonGradient) - } else null + } else null*/ Surface( modifier = modifier @@ -126,7 +126,7 @@ fun UserTextInput( .animateContentSize(), shape = RoundedCornerShape(42), color = backgroundColor, - border = animatedBorder, + // border = animatedBorder, ) { Row( modifier = Modifier @@ -167,19 +167,19 @@ fun UserTextInput( decorationBox = { innerTextField -> Box( contentAlignment = Alignment.CenterStart, - modifier = Modifier.padding(bottom = 6.dp, top = 6.dp) + modifier = Modifier.padding(bottom = 6.dp, top = 6.dp, start = 6.dp ) ) { if (value.text.isEmpty()) { - Crossfade(targetState = isAIEnabled, animationSpec = tween(350)) { aiEnabled -> + // Crossfade(targetState = isAIEnabled, animationSpec = tween(350)) { aiEnabled -> Text( - text = if (!aiEnabled) inputHint else stringResource(Res.string.chat_whit_ai), + text = /*if (!aiEnabled)*/ inputHint/* else stringResource(Res.string.chat_whit_ai)*/, modifier = Modifier.align(Alignment.CenterStart), style = LocalTextStyle.current.copy( color = LocalContentColor.current.copy(alpha = 0.6f), fontSize = 18.sp ) ) - } + // } } innerTextField() } diff --git a/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/screen/chat/task/TaskChatScreen.kt b/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/screen/chat/task/TaskChatScreen.kt index 82d993c9f..b04ad48b1 100644 --- a/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/screen/chat/task/TaskChatScreen.kt +++ b/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/screen/chat/task/TaskChatScreen.kt @@ -431,7 +431,7 @@ private fun TaskChatContent( onUpdateMessage = { content -> onEvent(TaskChatEvent.UpdateMessageContent(content)) }, - isAIEnabled = isAIEnabled, + //isAIEnabled = isAIEnabled, onToggleAI = { onEvent(TaskChatEvent.ActivateAI) }, modifier = Modifier .fillMaxWidth() @@ -503,7 +503,7 @@ private fun TaskChatInput( editingContent: String = "", onCancelEdit: () -> Unit = {}, onUpdateMessage: (String) -> Unit = {}, - isAIEnabled: Boolean = false, + //isAIEnabled: Boolean = false, onToggleAI: () -> Unit = {} ) { val isTextEmpty = remember { mutableStateOf(editingContent.isEmpty()) } @@ -550,7 +550,7 @@ private fun TaskChatInput( CompositionLocalProvider(LocalBoxWeight provides weight) { UserTextInput( value = userInputValue, - isAIEnabled = isAIEnabled, + //isAIEnabled = isAIEnabled, onValueChange = { userInputValue = it isTextEmpty.value = it.text.isBlank() @@ -561,7 +561,7 @@ private fun TaskChatInput( }, backgroundColor = MaterialTheme.colorScheme.surfaceVariant, modifier = Modifier.focusRequester(focusRequester), - leadingContent = { + /* leadingContent = { IconButton( onClick = onToggleAI, ) { @@ -582,7 +582,7 @@ private fun TaskChatInput( ) } } - }, + },*/ actionsContent = { Row( verticalAlignment = Alignment.CenterVertically, @@ -590,7 +590,18 @@ private fun TaskChatInput( modifier = Modifier.fillMaxWidth() ) { Box(modifier = Modifier.weight(1f), contentAlignment = Alignment.CenterEnd) { - this@Row.AnimatedVisibility( + SendIcon(onClick = { + if (editingMessageId != null) { + onUpdateMessage(userInputValue.text) + onCancelEdit() + } else { + sendTaskMessage(userInputValue.text) + userInputValue = TextFieldValue("") + isTextEmpty.value = true + showSendIcon.value = false + } + }) + /*this@Row.AnimatedVisibility( visible = isTextEmpty.value && editingMessageId == null, enter = fadeIn() + scaleIn(), exit = fadeOut() + scaleOut() @@ -603,9 +614,9 @@ private fun TaskChatInput( contentDescription = stringResource(Res.string.cd_select_images) ) } - } + }*/ - this@Row.AnimatedVisibility( + /* this@Row.AnimatedVisibility( visible = !isTextEmpty.value || editingMessageId != null, enter = fadeIn() + scaleIn(), exit = fadeOut() + scaleOut() @@ -621,7 +632,7 @@ private fun TaskChatInput( showSendIcon.value = false } }) - } + }*/ } } diff --git a/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/screen/settings/SettingsScreen.kt b/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/screen/settings/SettingsScreen.kt index 8dac9edb2..f6a70cad2 100644 --- a/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/screen/settings/SettingsScreen.kt +++ b/composeApp/src/commonMain/kotlin/io/middlepoint/morestuff/shared/ui/screen/settings/SettingsScreen.kt @@ -250,10 +250,10 @@ fun SettingsContent( LanguageSettings(onClick = openAppSettings ) } - ApiKeySettings( + /* ApiKeySettings( apiKey = model.apiKey, onApiKeyChange = setApiKey - ) + )*/ if (model.devSettings) { diff --git a/iosApp/MoreStuffShare/Info.plist b/iosApp/MoreStuffShare/Info.plist index 495ee6ef5..8fda143a0 100644 --- a/iosApp/MoreStuffShare/Info.plist +++ b/iosApp/MoreStuffShare/Info.plist @@ -8,12 +8,15 @@ NSExtensionActivationRule + + NSExtensionActivationSupportsText + + NSExtensionActivationSupportsWebURLWithMaxCount 1 NSExtensionActivationSupportsWebPageWithMaxCount