Skip to content

Commit bf5f255

Browse files
committed
Fix details UI for Shell scripting, tmux, and regular expressions
1 parent 27826d8 commit bf5f255

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

composeApp/src/commonMain/kotlin/com/linuxcommandlibrary/app/App.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ fun LinuxApp(initialDeeplink: String? = null) {
195195
composable<Route.BasicGroups> { backStackEntry ->
196196
val route = backStackEntry.toRoute<Route.BasicGroups>()
197197
val basicsRepository: BasicsRepository = koinInject()
198-
if (basicsRepository.isTextEditor(route.categoryId)) {
198+
if (basicsRepository.usesCardLayout(route.categoryId)) {
199199
val viewModel: BasicEditorViewModel = koinInject { parametersOf(route.categoryId) }
200200
BasicEditorScreen(viewModel = viewModel, onNavigate = onNavigate)
201201
} else {

composeApp/src/commonMain/kotlin/com/linuxcommandlibrary/app/data/BasicsRepository.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ class BasicsRepository(private val assetReader: AssetReader) {
7373
null
7474
}
7575

76-
fun isTextEditor(categoryId: String): Boolean = categoryId.endsWith("texteditor")
76+
fun usesCardLayout(categoryId: String): Boolean =
77+
categoryId.endsWith("texteditor") ||
78+
categoryId in setOf("shellscripting", "tmux", "regularexpressions")
7779

7880
private fun parseCommandLine(line: String): Pair<String, String> {
7981
val codeContent = line.trim().removeSurrounding("```")

0 commit comments

Comments
 (0)