Add git pushing after every commit.
Improve hardware keyboard and editor focus handling - Map physical Tab, arrow, and Enter keys to the terminal actions used by the on-screen controls. - Keep focus in the terminal input after command submission. - Focus editor content fields when editor dialogs open.
This commit is contained in:
@@ -23,8 +23,13 @@ import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.focus.FocusRequester
|
||||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.graphics.SolidColor
|
||||
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
@@ -49,6 +54,13 @@ fun GitMessageEditorDialog(
|
||||
val horizontalScroll = rememberScrollState()
|
||||
val verticalScroll = rememberScrollState()
|
||||
val dialogScroll = rememberScrollState()
|
||||
val contentFocusRequester = remember { FocusRequester() }
|
||||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
|
||||
LaunchedEffect(state.invocation.command) {
|
||||
contentFocusRequester.requestFocus()
|
||||
keyboardController?.show()
|
||||
}
|
||||
|
||||
Dialog(
|
||||
onDismissRequest = onClose,
|
||||
@@ -104,7 +116,9 @@ fun GitMessageEditorDialog(
|
||||
BasicTextField(
|
||||
value = state.content,
|
||||
onValueChange = onContentChange,
|
||||
modifier = Modifier.sizeIn(minWidth = 1000.dp, minHeight = 700.dp),
|
||||
modifier = Modifier
|
||||
.sizeIn(minWidth = 1000.dp, minHeight = 700.dp)
|
||||
.focusRequester(contentFocusRequester),
|
||||
textStyle = TextStyle(
|
||||
color = TextPrimary,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
|
||||
Reference in New Issue
Block a user