Fix Git editor reword workflow and UI coverage
- show Git editor file paths instead of the submitted git command - surface follow-up commit message editors during interactive rebase reword - add rename-commit UI tests for editor and amend-message solution paths - add broader embedded level solution scenarios for alternate Git workflows
This commit is contained in:
@@ -30,6 +30,7 @@ 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.platform.testTag
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
@@ -58,7 +59,7 @@ fun GitMessageEditorDialog(
|
||||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
|
||||
LaunchedEffect(state.invocation.command) {
|
||||
contentFocusRequester.requestFocus()
|
||||
runCatching { contentFocusRequester.requestFocus() }
|
||||
keyboardController?.show()
|
||||
}
|
||||
|
||||
@@ -86,6 +87,7 @@ fun GitMessageEditorDialog(
|
||||
) {
|
||||
Text(
|
||||
text = state.invocation.title,
|
||||
modifier = Modifier.testTag("git-message-editor-title"),
|
||||
color = TextPrimary,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 20.sp,
|
||||
@@ -94,11 +96,21 @@ fun GitMessageEditorDialog(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
) {
|
||||
EditorButton(label = "Save", enabled = state.content.isNotBlank(), onClick = onSave)
|
||||
EditorButton(label = "Dismiss", onClick = onClose)
|
||||
EditorButton(
|
||||
label = "Save",
|
||||
enabled = state.content.isNotBlank(),
|
||||
modifier = Modifier.testTag("git-message-editor-save"),
|
||||
onClick = onSave,
|
||||
)
|
||||
EditorButton(
|
||||
label = "Dismiss",
|
||||
modifier = Modifier.testTag("git-message-editor-dismiss"),
|
||||
onClick = onClose,
|
||||
)
|
||||
}
|
||||
Text(
|
||||
text = state.invocation.command,
|
||||
text = state.invocation.displayPath,
|
||||
modifier = Modifier.testTag("git-message-editor-path"),
|
||||
color = TextSecondary,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontSize = 13.sp,
|
||||
@@ -118,7 +130,8 @@ fun GitMessageEditorDialog(
|
||||
onValueChange = onContentChange,
|
||||
modifier = Modifier
|
||||
.sizeIn(minWidth = 1200.dp, minHeight = 1200.dp)
|
||||
.focusRequester(contentFocusRequester),
|
||||
.focusRequester(contentFocusRequester)
|
||||
.testTag("git-message-editor-content"),
|
||||
textStyle = TextStyle(
|
||||
color = TextPrimary,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
@@ -141,11 +154,13 @@ fun GitMessageEditorDialog(
|
||||
private fun EditorButton(
|
||||
label: String,
|
||||
enabled: Boolean = true,
|
||||
modifier: Modifier = Modifier,
|
||||
onClick: () -> Unit,
|
||||
) {
|
||||
Button(
|
||||
onClick = onClick,
|
||||
enabled = enabled,
|
||||
modifier = modifier,
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = Accent,
|
||||
contentColor = AppBackground,
|
||||
|
||||
Reference in New Issue
Block a user