NetworkAndServers: move ConditionsButton into operators card; wrap Save servers in its own card

- "Review conditions" (ConditionsButton — a bare SectionItemView) was
  rendered between the operators card and the messages card on the
  canvas without card chrome. Move it inside the operators SectionView
  lambda after the operator rows, so it shares the card and gets a
  2dp auto-divider above it separating it from the operator list.
- "Save servers" (a bare SectionItemView further down) is now wrapped
  in its own SectionView so it reads as a single-item card matching
  the iOS-style facelift of the rest of the screen.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
another-simple-pixel
2026-05-16 09:03:52 -07:00
parent 20daf4b4eb
commit 1d978fb2e0
@@ -214,9 +214,9 @@ fun ModalData.NetworkAndServersView(closeNetworkAndServers: () -> Unit) {
userServers.value.forEachIndexed { index, srv ->
srv.operator?.let { ServerOperatorRow(index, it, currUserServers, userServers, serverErrors, serverWarnings, currentRemoteHost?.remoteHostId) }
}
}
if (conditionsAction != null && anyOperatorEnabled.value) {
ConditionsButton(conditionsAction, rhId = currentRemoteHost?.remoteHostId)
if (conditionsAction != null && anyOperatorEnabled.value) {
ConditionsButton(conditionsAction, rhId = currentRemoteHost?.remoteHostId)
}
}
val footerText = if (conditionsAction is UsageConditionsAction.Review && conditionsAction.deadline != null && anyOperatorEnabled.value) {
String.format(generalGetString(MR.strings.operator_conditions_will_be_accepted_on), localDate(conditionsAction.deadline))
@@ -274,11 +274,13 @@ fun ModalData.NetworkAndServersView(closeNetworkAndServers: () -> Unit) {
}
val saveDisabled = !serversCanBeSaved(currUserServers.value, userServers.value, serverErrors.value)
SectionItemView(
{ scope.launch { saveServers(rhId = currentRemoteHost?.remoteHostId, currUserServers, userServers) } },
disabled = saveDisabled,
) {
Text(stringResource(MR.strings.smp_servers_save), color = if (!saveDisabled) MaterialTheme.colors.onBackground else MaterialTheme.colors.secondary)
SectionView {
SectionItemView(
{ scope.launch { saveServers(rhId = currentRemoteHost?.remoteHostId, currUserServers, userServers) } },
disabled = saveDisabled,
) {
Text(stringResource(MR.strings.smp_servers_save), color = if (!saveDisabled) MaterialTheme.colors.onBackground else MaterialTheme.colors.secondary)
}
}
val serversErr = globalServersError(serverErrors.value)
if (serversErr != null) {