AGPL-3.0-only, a source link in the app, and everything on dev since #5 #6

Merged
bvandeusen merged 214 commits from dev into main 2026-10-21 21:40:00 -04:00
5 changed files with 28 additions and 64 deletions
Showing only changes of commit 74ee288fd4 - Show all commits
@@ -175,6 +175,20 @@ fun ConfirmDialog(
)
}
/** Secondary text under a field or a heading: smaller, and in the quieter ink. */
@Composable
fun Hint(
text: String,
modifier: Modifier = Modifier,
) {
Text(
text = text,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = modifier,
)
}
/** The three tones a panel or notice can take, mapped onto the note palette. */
enum class Tone { NEUTRAL, WARN, ERROR }
@@ -222,11 +222,7 @@ private fun TargetName(
Column(modifier = modifier) {
Text(text = title, style = MaterialTheme.typography.bodyLarge)
detail?.let {
Text(
text = it,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Hint(it)
}
}
}
@@ -201,11 +201,7 @@ private fun SignInFields(
singleLine = true,
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
)
Text(
text = stringResource(R.string.sync_device_name_help),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Hint(stringResource(R.string.sync_device_name_help))
} else {
PlainTextField(
value = token,
@@ -218,11 +214,7 @@ private fun SignInFields(
imeAction = ImeAction.Done,
),
)
Text(
text = stringResource(R.string.sync_token_help),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Hint(stringResource(R.string.sync_token_help))
}
}
@@ -260,11 +252,7 @@ private fun AddressSection(
Text(stringResource(R.string.sync_check))
}
}
Text(
text = stringResource(R.string.sync_address_help),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Hint(stringResource(R.string.sync_address_help))
}
/** Everything the probe produced: progress, failure, what answered, and the risk. */
@@ -311,11 +299,7 @@ private fun ProbeCard(
fontWeight = FontWeight.SemiBold,
)
version?.let {
Text(
text = stringResource(R.string.sync_server_version, it),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Hint(stringResource(R.string.sync_server_version, it))
}
Text(
text = describeCompatibility(compatibility),
@@ -145,10 +145,8 @@ private fun BuildLine() {
val context = LocalContext.current
val unknown = stringResource(R.string.build_unknown)
val version = remember(context) { context.installedVersionName() ?: unknown }
Text(
Hint(
text = version,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.padding(bottom = 16.dp),
)
}
@@ -182,11 +180,7 @@ private fun LinkedPanel(
fontWeight = FontWeight.SemiBold,
)
state.linkedAs?.let {
Text(
text = stringResource(R.string.sync_linked_as, it),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Hint(stringResource(R.string.sync_linked_as, it))
}
Text(
text =
@@ -199,11 +193,7 @@ private fun LinkedPanel(
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
if (state.pending) {
Text(
text = stringResource(R.string.sync_unsent),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Hint(stringResource(R.string.sync_unsent))
}
}
@@ -224,11 +214,7 @@ private fun LinkedPanel(
state.lastOutcome?.let { outcome ->
if (state.syncError == null) {
Text(
text = syncSummary(outcome),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Hint(syncSummary(outcome))
}
// Rejections are the server refusing a SPECIFIC change. Surfaced, never
// swallowed, because only a person can resolve them.
@@ -268,10 +254,8 @@ private fun LinkedPanel(
onOutcome = onInstallOutcome,
)
Text(
Hint(
text = stringResource(R.string.sync_footer),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.padding(vertical = 8.dp),
)
@@ -68,18 +68,10 @@ fun UpdateCard(
}
Column(modifier = Modifier.fillMaxWidth().padding(top = 4.dp)) {
Text(
text = stringResource(R.string.update_installed_version, state.installedVersion),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Hint(stringResource(R.string.update_installed_version, state.installedVersion))
if (!state.selfUpdates) {
Text(
text = stringResource(R.string.update_debug_build),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Hint(stringResource(R.string.update_debug_build))
return@Column
}
@@ -95,11 +87,7 @@ fun UpdateCard(
style = MaterialTheme.typography.bodyMedium,
)
} else if (state.upToDate) {
Text(
text = stringResource(R.string.update_current),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Hint(stringResource(R.string.update_current))
}
if (state.working) {
@@ -204,10 +192,8 @@ private val BANNER_SPINNER = 18.dp
*/
@Composable
fun UnlinkedUpdateNote() {
Text(
Hint(
text = stringResource(R.string.update_needs_server),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
// Carries the bottom breathing room the connect button used to provide,
// now that it is the last thing on the unlinked screen.
modifier = Modifier.padding(top = 8.dp, bottom = 24.dp),