fix: move skill source badge beside install button in hub cards (#502)
The hub card UI is rendered by the local private HubSkillCard in SkillsScreen.kt (not the unused components/HubSkillsTab.kt copy). Moved SourceBadge out of the top-right name row to the left of the Install button in the card footer (left-aligned source, right-aligned action), tying the skill origin (hub/clawhub/etc) to the install action.
This commit is contained in:
@@ -683,26 +683,17 @@ private fun HubSkillCard(
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth().padding(16.dp),
|
modifier = Modifier.fillMaxWidth().padding(16.dp),
|
||||||
) {
|
) {
|
||||||
// ── Top row: name + source badge ──
|
// ── Top row: name ──
|
||||||
Row(
|
Text(
|
||||||
|
text = hubSkill.name,
|
||||||
|
style =
|
||||||
|
MaterialTheme.typography.titleMedium.copy(
|
||||||
|
fontWeight = FontWeight.SemiBold,
|
||||||
|
),
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
)
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = hubSkill.name,
|
|
||||||
style =
|
|
||||||
MaterialTheme.typography.titleMedium.copy(
|
|
||||||
fontWeight = FontWeight.SemiBold,
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis,
|
|
||||||
modifier = Modifier.weight(1f),
|
|
||||||
)
|
|
||||||
hubSkill.source?.let { source ->
|
|
||||||
Spacer(modifier = Modifier.width(6.dp))
|
|
||||||
SourceBadge(source = source)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── Category ──
|
// ── Category ──
|
||||||
hubSkill.category?.let { cat ->
|
hubSkill.category?.let { cat ->
|
||||||
@@ -726,12 +717,17 @@ private fun HubSkillCard(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Install button ──
|
// ── Source badge + Install button ──
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
horizontalArrangement = Arrangement.End,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
|
hubSkill.source?.let { source ->
|
||||||
|
SourceBadge(source = source)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
}
|
||||||
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
Button(
|
Button(
|
||||||
onClick = onInstall,
|
onClick = onInstall,
|
||||||
enabled = !isInstalling,
|
enabled = !isInstalling,
|
||||||
|
|||||||
Reference in New Issue
Block a user