From 3370e354c34965beb81f0d4d9582b89bc3dc4814 Mon Sep 17 00:00:00 2001 From: Kgothatso Ngako Date: Sun, 26 Jul 2026 02:46:16 +0200 Subject: [PATCH] Reorder artifact detail: chapters and translations first Move the Chapters and Translations sections to the top of the artifact detail screen and the descriptive Details and Versions sections to the bottom, so the actionable content leads. Co-Authored-By: Claude Opus 4.8 --- .../ui/composable/ArtifactDetailScreen.kt | 88 +++++++++---------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/press/mantra/compose/ui/composable/ArtifactDetailScreen.kt b/composeApp/src/commonMain/kotlin/press/mantra/compose/ui/composable/ArtifactDetailScreen.kt index dca6ffc2..7c486a7e 100644 --- a/composeApp/src/commonMain/kotlin/press/mantra/compose/ui/composable/ArtifactDetailScreen.kt +++ b/composeApp/src/commonMain/kotlin/press/mantra/compose/ui/composable/ArtifactDetailScreen.kt @@ -104,50 +104,6 @@ fun ArtifactDetailScreen( modifier = Modifier.padding(innerPadding).fillMaxSize().padding(20.dp), verticalArrangement = Arrangement.spacedBy(10.dp) ) { - // Details - item { - Text( - text = "Details", - style = MaterialTheme.typography.labelMedium - ) - } - item { - Card { - DetailRow(label = "Name", value = artifact.name) - DetailRow(label = "Url", value = artifact.url) - DetailRow(label = "Visibility", value = artifact.visibility) - DetailRow(label = "License", value = artifact.license) - DetailRow(label = "Dialect", value = artifact.dialectId) - DetailRow(label = "Author", value = artifact.publicKey) - DetailRow(label = "Created", value = artifact.createdAt.toString()) - } - } - - // Versions - item { - Text( - text = "Versions", - style = MaterialTheme.typography.labelMedium - ) - } - if (artifactDetailUIState.versions.isEmpty()) { - item { Text("No versions.") } - } else { - items( - items = artifactDetailUIState.versions, - key = { version -> version.id } - ) { version -> - Card { - ListItem( - headlineContent = { Text(version.versionLabel) }, - overlineContent = { Text("Version") } - ) - } - } - } - - item { HorizontalDivider() } - // Chapters item { Text( @@ -278,6 +234,50 @@ fun ArtifactDetailScreen( Text("Add Translation") } } + + item { HorizontalDivider() } + + // Details + item { + Text( + text = "Details", + style = MaterialTheme.typography.labelMedium + ) + } + item { + Card { + DetailRow(label = "Name", value = artifact.name) + DetailRow(label = "Url", value = artifact.url) + DetailRow(label = "Visibility", value = artifact.visibility) + DetailRow(label = "License", value = artifact.license) + DetailRow(label = "Dialect", value = artifact.dialectId) + DetailRow(label = "Author", value = artifact.publicKey) + DetailRow(label = "Created", value = artifact.createdAt.toString()) + } + } + + // Versions + item { + Text( + text = "Versions", + style = MaterialTheme.typography.labelMedium + ) + } + if (artifactDetailUIState.versions.isEmpty()) { + item { Text("No versions.") } + } else { + items( + items = artifactDetailUIState.versions, + key = { version -> version.id } + ) { version -> + Card { + ListItem( + headlineContent = { Text(version.versionLabel) }, + overlineContent = { Text("Version") } + ) + } + } + } } } }