Add exercise description onboarding bubble

Remove duplicate IME padding that caused keyboard gap
Add md alias for mkdir helper command
Add dir alias for ls helper command
Add cd.. shortcut for cd .. helper command
This commit is contained in:
Joe Tretter
2026-05-05 20:08:51 -05:00
parent 344ff99f0a
commit b8c4096123
6 changed files with 112 additions and 14 deletions

View File

@@ -13,7 +13,6 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
@@ -78,6 +77,7 @@ fun GitHugApp() {
var manPageState by remember { mutableStateOf<ManPageState?>(null) }
var solvedCelebrationTitle by remember { mutableStateOf<String?>(null) }
var showTerminalInputHint by remember { mutableStateOf(true) }
var showExerciseDescriptionHint by remember { mutableStateOf(true) }
val currentLevel = levels[currentLevelIndex]
LaunchedEffect(solvedCelebrationTitle) {
@@ -414,6 +414,7 @@ fun GitHugApp() {
if (raw.isBlank()) return
showTerminalInputHint = false
showExerciseDescriptionHint = false
suppressedImeEcho = submittedText
clearCommandInput(recreateField = true)
@@ -460,7 +461,6 @@ fun GitHugApp() {
modifier = Modifier
.fillMaxSize()
.background(AppBackground)
.imePadding()
.verticalScroll(screenScrollState)
.padding(horizontal = 10.dp, vertical = 8.dp),
verticalArrangement = Arrangement.spacedBy(8.dp),
@@ -489,7 +489,9 @@ fun GitHugApp() {
level = currentLevel,
visibleHint = if (activeExerciseDetail == ExerciseDetailPanel.HINT) visibleHint else null,
suggestionsExpanded = activeExerciseDetail == ExerciseDetailPanel.SUGGESTIONS,
showDescriptionHint = showExerciseDescriptionHint,
onToggleSuggestions = {
showExerciseDescriptionHint = false
activeExerciseDetail = if (activeExerciseDetail == ExerciseDetailPanel.SUGGESTIONS) null else ExerciseDetailPanel.SUGGESTIONS
if (activeExerciseDetail == ExerciseDetailPanel.SUGGESTIONS) {
visibleHint = null
@@ -497,13 +499,17 @@ fun GitHugApp() {
applyRecommendedPaneWeights(persist = false)
},
onHint = {
showExerciseDescriptionHint = false
val hint = currentLevel.hints.getOrNull(hintIndex) ?: "No more hints for this level."
visibleHint = hint
activeExerciseDetail = ExerciseDetailPanel.HINT
hintIndex = (hintIndex + 1).coerceAtMost(currentLevel.hints.size)
applyRecommendedPaneWeights(persist = false)
},
onReset = { resetCurrentLevel() },
onReset = {
showExerciseDescriptionHint = false
resetCurrentLevel()
},
)
},
terminalContent = {
@@ -524,6 +530,7 @@ fun GitHugApp() {
suppressedImeEcho = null
if (it.text.isNotEmpty()) {
showTerminalInputHint = false
showExerciseDescriptionHint = false
}
commandInput = it
},