Fix runtime diagnostics, rotation stability, and manpage search positioning

- Expand the missing-native-Git message with the selected ABI, 32/64-bit ABI lists,
  Android version, device model/platform details, expected binary path, and a request
  to report the information so device support can be added.
- Use application-scoped DataStore delegates for game progress and pane layout
  preferences to avoid duplicate DataStore instances during activity recreation, such
  as screen orientation changes.
- Center manpage search matches in the visible scroll viewport when possible and apply
  IME padding so keyboard-covered space is accounted for.
- Support mobile-friendly handling for interactive add/stage commands (`git add -i`,
  `git stage -i`, and `git add --interactive`) by routing them through GitHug's
  staging semantics instead of rejecting them or launching Git's terminal UI.
- Apply IME padding to editor dialogs so controls remain reachable while the keyboard
  is displayed.
This commit is contained in:
Joe Tretter
2026-05-09 14:22:07 -05:00
parent edec66bfe6
commit 0acf8c9ab0
10 changed files with 80 additions and 213 deletions

View File

@@ -97,7 +97,7 @@ object GitSandboxEngine {
}
parts.size >= 2 && (parts[1] == "stage" || parts[1] == "add") -> {
if (parts.drop(2).any { it == "-i" || it == "--interactive" }) {
return repo to listOf("Interactive staging is not supported in the mobile terminal. Use git add <path> or git add -p <path>.")
return interactiveAdd(repo, parts.drop(2))
}
val target = parts.drop(2).lastOrNull { !it.startsWith("-") }
?: return repo to listOf("usage: git add <path>")
@@ -162,6 +162,28 @@ object GitSandboxEngine {
}
}
private fun interactiveAdd(repo: RepoState, arguments: List<String>): Pair<RepoState, List<String>> {
val targets = arguments.filterNot { it == "-i" || it == "--interactive" || it.startsWith("--") }
val target = targets.lastOrNull()
val updated = repo.files.map { file ->
if (file.deleted) {
file
} else if (target == null || target == "." || file.name == target) {
file.copy(staged = true)
} else {
file
}
}
val stagedCount = updated.count { updatedFile ->
val before = repo.files.firstOrNull { it.name == updatedFile.name }
updatedFile.staged && before?.staged != true
}
return repo.copy(files = updated) to listOf(
"Interactive add is handled by GitHug Android.",
"Staged ${if (target == null || target == ".") "$stagedCount file(s)" else target}.",
)
}
fun tokenizeCommand(command: String): List<String> {
return tokenizeShellCommand(command).map { it.value }
}