Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:OptIn(ExperimentalLayoutApi::class)

package io.github.garemat.lunachron.ui

import androidx.compose.animation.AnimatedVisibility
Expand Down Expand Up @@ -205,6 +207,39 @@ internal fun OnlineMachinationsTab(
}
}

// Submission status — visible to all, shows who has/hasn't submitted yet
item {
val submittedIds = remember(campaign.machinations) {
campaign.machinations.map { it.deviceId }.toSet()
}
FlowRow(
horizontalArrangement = Arrangement.spacedBy(6.dp),
verticalArrangement = Arrangement.spacedBy(4.dp)
) {
approvedMembers.forEach { m ->
val done = m.deviceId in submittedIds
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(3.dp)
) {
Icon(
if (done) Icons.Default.CheckCircle else Icons.Default.RadioButtonUnchecked,
contentDescription = null,
modifier = Modifier.size(11.dp),
tint = if (done) SupportGreen
else MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.45f)
)
Text(
m.username,
style = MaterialTheme.typography.labelSmall,
color = if (done) MaterialTheme.colorScheme.onSurface
else MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.45f)
)
}
}
}
}

if (myDeviceId.isNotEmpty() && eligibleTargets.isNotEmpty()) {
// Opponent exclusion notice
if (myNextOpponentId != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2795,6 +2795,30 @@ private fun MachinationsOverviewSection(
)
}
}

// Per-player submission detail
if (machinations.any { it.choices.isNotEmpty() }) {
val memberByDeviceId = members.associateBy { it.deviceId }
HorizontalDivider(thickness = 0.5.dp, modifier = Modifier.padding(top = 2.dp))
Text("Submissions", style = MaterialTheme.typography.labelSmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.padding(top = 2.dp))
for (entry in machinations.filter { it.choices.isNotEmpty() }) {
Column(verticalArrangement = Arrangement.spacedBy(1.dp)) {
Text(entry.username, style = MaterialTheme.typography.labelSmall, fontWeight = FontWeight.Bold)
entry.choices.forEach { choice ->
val targetName = memberByDeviceId[choice.targetDeviceId]?.username ?: "?"
val choiceColor = if (choice.type == "SUPPORT") Color(0xFF4CAF50)
else MaterialTheme.colorScheme.error
Text(
" ${choice.type} → $targetName",
style = MaterialTheme.typography.labelSmall,
color = choiceColor
)
}
}
}
}
}
}

Expand Down
Loading