build(amethyst): read commons Compose resources; drop a duplicated string

Enables app-side (still-native) screens to reference commons' generated
`Res` directly, so a string shared between a commons renderer and an
Android screen no longer has to be duplicated across the two resource
trees. commons already exposes `Res` publicly (publicResClass = true); the
only missing piece was the Compose-resources runtime on amethyst's
classpath — the JetBrains compose artifacts are already there transitively
via :commons, this just adds components-resources so
`org.jetbrains.compose.resources.*` resolves.

Proof + cleanup: the V4V split editor now reads
podcast_value_split_percent from commons `Res` instead of the Android res
tree, and that key is removed from amethyst — collapsing the duplication
introduced when PodcastValueSplits moved to commons. (podcast_value_for_value
stays app-side: it feeds an Android-int ResourceToastMsg, which has no
Compose-resource form.)

This unblocks the next wave of renderer extractions whose strings are
shared with native screens (relay discovery, calendar, …) — those screens
can now switch to commons `Res` rather than forcing a duplicate.

Verified: :amethyst:compileFdroidDebugKotlin and :commons:compileKotlinJvm
both pass; touched strings.xml well-formed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gmrt3jwYPDJ38MJGJ6GaNr
This commit is contained in:
Claude
2026-07-17 22:50:07 +00:00
parent 62c2d7755d
commit 60a226891c
11 changed files with 9 additions and 11 deletions
+4
View File
@@ -391,6 +391,10 @@ dependencies {
implementation(project(":commons"))
implementation(project(":nestsClient"))
implementation(project(":nappletHost"))
// Compose Multiplatform resources runtime, so app-side screens that share a
// string with a commons renderer can read commons' generated `Res` directly
// instead of duplicating the key in the Android res tree.
implementation(libs.jetbrains.compose.components.resources)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.activity.compose)
@@ -54,6 +54,8 @@ import com.vitorpamplona.amethyst.commons.icons.symbols.Icon
import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols
import com.vitorpamplona.amethyst.commons.podcasts.RecipientDraft
import com.vitorpamplona.amethyst.commons.podcasts.V4VSplitEditorState
import com.vitorpamplona.amethyst.commons.resources.Res
import com.vitorpamplona.amethyst.commons.resources.podcast_value_split_percent
import com.vitorpamplona.amethyst.ui.note.BaseUserPicture
import com.vitorpamplona.amethyst.ui.note.UsernameDisplay
import com.vitorpamplona.amethyst.ui.note.creators.userSuggestions.ShowUserSuggestionList
@@ -63,6 +65,7 @@ import com.vitorpamplona.amethyst.ui.stringRes
import com.vitorpamplona.amethyst.ui.theme.Size40dp
import com.vitorpamplona.amethyst.ui.theme.SuggestionListDefaultHeightPage
import com.vitorpamplona.amethyst.ui.theme.grayText
import org.jetbrains.compose.resources.stringResource
/**
* Editor for a Podcasting-2.0 value-for-value split. Recipients are added the Amethyst-native way —
@@ -186,7 +189,7 @@ private fun RecipientShell(
Row(verticalAlignment = Alignment.CenterVertically) {
content()
Text(
text = stringRes(R.string.podcast_value_split_percent, percent),
text = stringResource(Res.string.podcast_value_split_percent, percent),
style = MaterialTheme.typography.titleMedium,
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.primary,
@@ -254,7 +257,7 @@ private fun ManualRecipientCard(
Row(verticalAlignment = Alignment.CenterVertically) {
Text(
text = stringRes(R.string.podcast_value_split_percent, percent),
text = stringResource(Res.string.podcast_value_split_percent, percent),
style = MaterialTheme.typography.titleMedium,
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.primary,
@@ -1222,7 +1222,6 @@
<string name="podcast_transcript">Přepis</string>
<string name="podcast_chapters">Kapitoly</string>
<string name="podcast_value_for_value">Value-for-Value</string>
<string name="podcast_value_split_percent">%1$d%%</string>
<string name="podcast_hosts_and_guests">Moderátoři a hosté</string>
<string name="podcast_top_supporters">Nejlepší podporovatelé</string>
<plurals name="podcast_chapters_count">
@@ -955,7 +955,6 @@
<string name="podcast_transcript">Transcription</string>
<string name="podcast_chapters">Chapitres</string>
<string name="podcast_value_for_value">Valeur-pour-valeur</string>
<string name="podcast_value_split_percent">%1$d%%</string>
<string name="podcast_hosts_and_guests">Hôtes &amp; invités</string>
<string name="podcast_top_supporters">Meilleurs supporters</string>
<plurals name="podcast_chapters_count">
@@ -1099,7 +1099,6 @@
<string name="podcast_transcript">प्रतिलिपि</string>
<string name="podcast_chapters">अध्याय</string>
<string name="podcast_value_for_value">मूल्य के लिए मूल्य</string>
<string name="podcast_value_split_percent">%1$d प्रतिशतप्रतिशत</string>
<string name="podcast_hosts_and_guests">निमन्त्रक तथा अभ्यागत</string>
<string name="podcast_top_supporters">ऊर्ध्वतम समर्थक</string>
<plurals name="podcast_chapters_count">
@@ -1099,7 +1099,6 @@
<string name="podcast_transcript">Átírás</string>
<string name="podcast_chapters">Fejezetek</string>
<string name="podcast_value_for_value">Értéket az értékért</string>
<string name="podcast_value_split_percent">%1$d%%</string>
<string name="podcast_hosts_and_guests">Házigazdák és vendégek</string>
<string name="podcast_top_supporters">Legfőbb támogatók</string>
<plurals name="podcast_chapters_count">
@@ -962,7 +962,6 @@
<string name="podcast_transcript">Transcript</string>
<string name="podcast_chapters">Hoofdstukken</string>
<string name="podcast_value_for_value">Value-for-Value</string>
<string name="podcast_value_split_percent">%1$d%%</string>
<string name="podcast_hosts_and_guests">Hosts &amp; gasten</string>
<string name="podcast_top_supporters">Topsupporters</string>
<plurals name="podcast_chapters_count">
@@ -1222,7 +1222,6 @@ Zaplanowane posty z innych kont nie zostaną opublikowane, dopóki to konto jest
<string name="podcast_transcript">Transkrypcja</string>
<string name="podcast_chapters">Rozdziały</string>
<string name="podcast_value_for_value">Wartość-za-wartość</string>
<string name="podcast_value_split_percent">%1$d%%</string>
<string name="podcast_hosts_and_guests">Gospodarze &amp; Goście</string>
<string name="podcast_top_supporters">Najwięksi darczyńcy</string>
<plurals name="podcast_chapters_count">
@@ -1042,7 +1042,6 @@ Za podpisovanje se je potrebno prijaviti s privatnim ključem</string>
<string name="podcast_transcript">Prepis</string>
<string name="podcast_chapters">Poglavja</string>
<string name="podcast_value_for_value">Vrednost za vrednost</string>
<string name="podcast_value_split_percent">%1$d%%</string>
<string name="podcast_hosts_and_guests">Gostitelji in Gostje</string>
<string name="podcast_top_supporters">Naj podporniki</string>
<plurals name="podcast_chapters_count">
@@ -1085,7 +1085,6 @@
<string name="podcast_transcript">文稿</string>
<string name="podcast_chapters">章节</string>
<string name="podcast_value_for_value">Value-for-Value</string>
<string name="podcast_value_split_percent">%1$d%%</string>
<string name="podcast_hosts_and_guests">主播 &amp; 客串</string>
<string name="podcast_top_supporters">顶级支持者</string>
<plurals name="podcast_chapters_count">
-1
View File
@@ -1224,7 +1224,6 @@
<string name="podcast_transcript">Transcript</string>
<string name="podcast_chapters">Chapters</string>
<string name="podcast_value_for_value">Value-for-Value</string>
<string name="podcast_value_split_percent">%1$d%%</string>
<string name="podcast_hosts_and_guests">Hosts &amp; Guests</string>
<string name="podcast_top_supporters">Top Supporters</string>
<plurals name="podcast_chapters_count">