docs(journal): POC-Status aktualisiert, Master-UX-Fixes dokumentiert und Follow-up geplant
Signed-off-by: Stefan Mogeritsch <stefan.mo.co@gmail.com>
This commit is contained in:
+5
-4
@@ -35,7 +35,7 @@ class DeviceInitializationViewModel(
|
||||
_uiState.update {
|
||||
it.copy(
|
||||
settings = existingSettings,
|
||||
isLocked = existingSettings.isConfigured
|
||||
isLocked = false // Immer offen für Bearbeitung beim Start des Wizards
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -133,10 +133,11 @@ class DeviceInitializationViewModel(
|
||||
_uiState.update { it.copy(showRoleChangeWarning = false, pendingRole = null) }
|
||||
}
|
||||
|
||||
fun addExpectedClient(name: String, role: NetworkRole) {
|
||||
println("[DeviceInit] Erwarteter Client hinzugefügt: $name ($role)")
|
||||
fun addExpectedClient() {
|
||||
val name = "Neuer Client ${uiState.value.settings.expectedClients.size + 1}"
|
||||
println("[DeviceInit] Erwarteter Client hinzugefügt: $name")
|
||||
updateSettings {
|
||||
it.copy(expectedClients = it.expectedClients + ExpectedClient(name, role))
|
||||
it.copy(expectedClients = it.expectedClients + ExpectedClient(name, NetworkRole.RICHTER))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+35
-4
@@ -236,7 +236,7 @@ actual fun DeviceInitializationConfig(
|
||||
HorizontalDivider(Modifier.padding(vertical = 8.dp))
|
||||
Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically) {
|
||||
Text("👥 Erwartete Clients", style = MaterialTheme.typography.titleSmall)
|
||||
TextButton(onClick = { /* Add Client Dialog */ }) {
|
||||
TextButton(onClick = { viewModel.addExpectedClient() }) {
|
||||
Icon(Icons.Default.Add, null, Modifier.size(18.dp))
|
||||
Spacer(Modifier.width(4.dp))
|
||||
Text("Hinzufügen")
|
||||
@@ -245,15 +245,46 @@ actual fun DeviceInitializationConfig(
|
||||
|
||||
settings.expectedClients.forEachIndexed { index, client ->
|
||||
ListItem(
|
||||
headlineContent = { Text(client.name, fontWeight = FontWeight.Medium) },
|
||||
supportingContent = { Text(client.role.name, style = MaterialTheme.typography.labelSmall) },
|
||||
headlineContent = {
|
||||
MsTextField(
|
||||
value = client.name,
|
||||
onValueChange = { newName ->
|
||||
viewModel.updateSettings { s ->
|
||||
val newList = s.expectedClients.toMutableList()
|
||||
newList[index] = newList[index].copy(name = newName)
|
||||
s.copy(expectedClients = newList)
|
||||
}
|
||||
},
|
||||
label = null,
|
||||
compact = true,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
)
|
||||
},
|
||||
supportingContent = {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
NetworkRole.entries.filter { it != NetworkRole.MASTER }.forEach { role ->
|
||||
val isSelected = client.role == role
|
||||
FilterChip(
|
||||
selected = isSelected,
|
||||
onClick = {
|
||||
viewModel.updateSettings { s ->
|
||||
val newList = s.expectedClients.toMutableList()
|
||||
newList[index] = newList[index].copy(role = role)
|
||||
s.copy(expectedClients = newList)
|
||||
}
|
||||
},
|
||||
label = { Text(role.name, style = MaterialTheme.typography.labelSmall) }
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
trailingContent = {
|
||||
IconButton(onClick = { viewModel.removeExpectedClient(index) }) {
|
||||
Icon(Icons.Default.Delete, null, tint = MaterialTheme.colorScheme.error, modifier = Modifier.size(20.dp))
|
||||
}
|
||||
},
|
||||
colors = ListItemDefaults.colors(containerColor = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.5f)),
|
||||
modifier = Modifier.padding(vertical = 2.dp)
|
||||
modifier = Modifier.padding(vertical = 4.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user