DRY pass #3: the "from the text" mark is one composable (#5373)
CI & Build / Python lint (push) Successful in 2s
CI & Build / Build now, or wait for Android? (push) Successful in 2s
Android / Build, or is the channel already serving this? (push) Successful in 3s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
Desktop (Tauri) / Web tests, clippy, Rust tests and rustfmt (push) Skipped
Desktop (Tauri) / Tauri desktop (Linux) (push) Skipped
Desktop (Tauri) / Windows installer (cross-compiled) (push) Skipped
Desktop (Tauri) / Update manifest (push) Skipped
CI & Build / Web typecheck and unit tests (push) Successful in 11s
CI & Build / Python tests (push) Successful in 13s
Android / Core and FFI clippy and tests (push) Successful in 54s
CI & Build / integration (push) Successful in 1m41s
CI & Build / Build & push image (push) Skipped
Android / Kotlin + Rust (APK) (push) Successful in 9m17s
Android / Build the server image (push) Successful in 1s

The label picker and the editor's tag row each wrote the same Text: the
label_from_tag string, labelSmall, onSurfaceVariant, 8dp start padding.
Chips.kt's FromTextMark() is now both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 20:14:24 -04:00
co-authored by Claude Opus 5.5
parent d6204d320a
commit 67df94350c
3 changed files with 15 additions and 14 deletions
@@ -9,8 +9,10 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.fabledsword.inkwell.R
/** The corner of every chip on a card: tags, reminders, who shared it. */ /** The corner of every chip on a card: tags, reminders, who shared it. */
internal val CHIP_RADIUS = 6.dp internal val CHIP_RADIUS = 6.dp
@@ -36,3 +38,14 @@ internal fun TintChip(
.padding(horizontal = 6.dp, vertical = 2.dp), .padding(horizontal = 6.dp, vertical = 2.dp),
) )
} }
/** Marks a tag the note's text carries, beside its name, wherever tags are listed. */
@Composable
internal fun FromTextMark() {
Text(
text = stringResource(R.string.label_from_tag),
style = MaterialTheme.typography.labelSmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.padding(start = 8.dp),
)
}
@@ -381,12 +381,7 @@ fun EditorLabelRow(
.padding(horizontal = 10.dp, vertical = 4.dp), .padding(horizontal = 10.dp, vertical = 4.dp),
) )
if (label.viaTag) { if (label.viaTag) {
Text( FromTextMark()
text = stringResource(R.string.label_from_tag),
style = MaterialTheme.typography.labelSmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.padding(start = 8.dp),
)
} else if (!readOnly) { } else if (!readOnly) {
IconButton(onClick = { IconButton(onClick = {
// Only the MANUAL labels are sent: the core replaces // Only the MANUAL labels are sent: the core replaces
@@ -120,14 +120,7 @@ fun LabelSheet(
style = MaterialTheme.typography.bodyLarge, style = MaterialTheme.typography.bodyLarge,
modifier = Modifier.padding(start = 4.dp), modifier = Modifier.padding(start = 4.dp),
) )
if (fromTag) { if (fromTag) FromTextMark()
Text(
text = stringResource(R.string.label_from_tag),
style = MaterialTheme.typography.labelSmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.padding(start = 8.dp),
)
}
} }
} }
} }