refactor: retire the brand before mantra, and keep the three records of it

Phase 0 of docs/curated-to-mantra.md, item 2. The app has been Mantra since
before this repository had a docs/ directory, and four things still said Torch,
the brand before it: the theme composable, `TorchTheme`, at 116 sites; the
user agent, `UserAgent.APP_NAME` and `CLIENT_NAME`; two error strings a user
could actually be shown ("tell X to use Torch", "finished setting up Torch");
and iOS, where `Config.xcconfig` built `PRODUCT_NAME=Torch` under the bundle id
`ac.aux.compose.Aux` and the project's product reference was still `Aux.app` --
two brands ago. All four now say Mantra.

**This is done natively, before anything is pulled from the fork, so that the
fork's theme maps onto a name that means something.** The Curated fork retired
Torch itself in d26cf6c7 (`TorchTheme` -> `CuratedTheme`, later `CurareTheme`).
The pull rewrites every fork commit into this repository's names, and until
now the only honest target for `CurareTheme` was `TorchTheme` -- the brand
before last -- which would have had every pulled screen wrapping itself in a
name the app stopped using long ago. `MantraTheme` is what the rewrite maps to
from here; docs/scripts/curated-unbrand.py's theme, `UserAgent` and iOS rules
are changed in this commit for that reason, and the comment that said "change
here if Phase 0 renames it" goes with them. Retiring Torch as part of the pull
instead -- by taking the rewritten d26cf6c7 -- was rejected because that commit
would then be a fork commit renaming something the fork never had, and because
the iOS half of the debt was never the fork's to pay.

**The user agent went last, and the reason it could go at all is written where
the next reader will look.** `CLIENT_NAME` is the `client` tag on every relay
list this app publishes, which is why it was left alone when the top bar was
fixed: it goes on the wire, so it read as a network identity question. It is
attribution and nothing derives from it, which is the difference between it
and the two `mantra/` hash tags that must never move; the comment on the
`HomeScreen` bar and the paragraph in material-design-conformance.md that both
said "still says Torch" now say that, in order, rather than describing a state
this commit ends.

**Three records keep the old name on purpose.** material-design-conformance.md:278
records a finding -- the top bar once read "Torch" while the window title read
"Mantra" -- and changing it would falsify the record. The paragraph at :654 is
rewritten rather than deleted because it was a statement of current state, and
the current state changed. `NavigationRoutingTest`'s "Introducing... Torch"
fixture is the string a stranded user actually saw, and the test is about the
stranding. Nothing else in the tree says Torch.

**iOS is unverified.** The build gates the apple targets behind `isMacOsX` and
this was built on linux; the xcconfig and pbxproj edits are the same shape the
fork's went through, and this is the first time this repository has named
itself there. Build it on a Mac before believing it.

:composeApp:compileDebugKotlinAndroid and :composeApp:compileKotlinJvm clean;
:composeApp:jvmTest 736 tests, 0 failures; :composeApp:testDebugUnitTest 403
tests, 0 failures; :composeApp:m3Audit all budgets met.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Kgothatso NgakoandClaude Opus 5 committed 2026-09-13 11:42:36 +02:00
1 parent b796a32be3
commit 4681ac1a03
74 files changed
+161 -155

No files matched your search

@@ -7,7 +7,7 @@ import androidx.compose.ui.Modifier
import androidx.navigation.NavHostController
import press.mantra.compose.ui.composable.navigation.MantraNavHost
import press.mantra.compose.ui.composable.widgets.ProvideSnackbarHost
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import fr.acinq.phoenix.PhoenixGlobal
@Composable
@@ -16,7 +16,7 @@ fun MantraApp(
mantraGlobal: MantraGlobal,
phoenixGlobal: PhoenixGlobal
) {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -23,7 +23,7 @@ import com.vitorpamplona.quartz.nip51Lists.relayLists.RelayFeedsListEvent
import press.mantra.compose.ui.composable.navigation.routes.NostrEventDetailRoute
import press.mantra.compose.ui.composable.widgets.profile.ProfileAvatar
import press.mantra.compose.ui.composable.widgets.profile.ProfileColor
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import kotlin.time.Clock
import kotlin.time.Instant
import press.mantra.compose.ui.theme.ConformancePreviews
@@ -180,7 +180,7 @@ fun ProfileRenderAsListItemPreview() {
about = "I am the stone that the builder refused.",
nostrEventId = "nostrEventId"
)
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.padding(20.dp)
) {
@@ -21,7 +21,7 @@ import press.mantra.compose.database.model.Profile
import press.mantra.compose.database.model.QuotedRelation
import press.mantra.compose.ui.composable.widgets.content.RichContent
import press.mantra.compose.ui.composable.widgets.profile.ProfileAvatar
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.theme.ConformancePreviews
data class LocalQuotedNostrEvent(
@@ -113,7 +113,7 @@ data class LocalQuotedNostrEvent(
@ConformancePreviews
@Composable
private fun LocalQuotedNostrEventPreview() {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.padding(20.dp)
) {
@@ -1,8 +1,8 @@
package press.mantra.compose.network
object UserAgent {
const val APP_NAME = "Torch"
const val CLIENT_NAME = "Torch"
const val APP_NAME = "Mantra"
const val CLIENT_NAME = "Mantra"
}
fun String.asClientTag(): Array<String> = arrayOf(
@@ -395,7 +395,7 @@ fun ActiveProfileScreen(
@ConformancePreviews
@Composable
private fun UnannouncedProfileScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -59,7 +59,7 @@ import press.mantra.compose.repository.NostrRepository
import press.mantra.compose.ui.composable.navigation.routes.ChatRoomDetailRoute
import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.state.ChatRoomMessagingUIState
import com.vitorpamplona.quartz.nip01Core.core.HexKey
import press.mantra.compose.repository.MantraRepository
@@ -405,7 +405,7 @@ fun AddArtifactScreen(
@ConformancePreviews
@Composable
private fun AddArtifactScreenPreview() {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -49,7 +49,7 @@ import press.mantra.compose.ui.composable.navigation.routes.FrostSigningRoute
import press.mantra.compose.ui.composable.navigation.routes.ImplementationPendingRoute
import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.AddChapterViewModel
import press.mantra.compose.ui.view.state.AddChapterUIState
import press.mantra.compose.ui.theme.spacing
@@ -313,7 +313,7 @@ fun AddChapterScreen(
@ConformancePreviews
@Composable
private fun AddChapterScreenPreview() {
TorchTheme {
MantraTheme {
Surface(modifier = Modifier.fillMaxSize()) {
AddChapterScreen(
activeUserPublicKey = "",
@@ -51,7 +51,7 @@ import press.mantra.compose.ui.composable.navigation.routes.FrostSigningRoute
import press.mantra.compose.ui.composable.navigation.routes.ImplementationPendingRoute
import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.AddDialectViewModel
import press.mantra.compose.ui.view.state.AddDialectUIState
import press.mantra.compose.ui.theme.spacing
@@ -340,7 +340,7 @@ fun AddDialectScreen(
@ConformancePreviews
@Composable
private fun AddDialectScreenPreview() {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -32,7 +32,7 @@ import press.mantra.compose.database.model.intermdiate.LocalChatRoom
import press.mantra.compose.repository.ChatRepository
import press.mantra.compose.repository.NostrRepository
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.AddMemberToChatRoomConfirmationViewModel
import press.mantra.compose.ui.view.state.AddMemberToChatRoomConfirmationUIState
import com.vitorpamplona.quartz.nip01Core.core.HexKey
@@ -217,7 +217,7 @@ fun AddMemberToChatRoomConfirmationScreen(
@ConformancePreviews
@Composable
private fun ChatRoomDetailScreenPreview() {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -227,7 +227,7 @@ private fun ChatRoomDetailScreenPreview() {
chatRoomId = "publicKey",
relayHint = null,
initialChatRoomDetailUIState =
// AddMemberToChatRoomConfirmationUIState.Error("Profile missing key package event.\n\nTry again later or tell Person to use Torch."),
// AddMemberToChatRoomConfirmationUIState.Error("Profile missing key package event.\n\nTry again later or tell Person to use Mantra."),
AddMemberToChatRoomConfirmationUIState.Loaded(
localChatRoom = LocalChatRoom(
chatRoom = ChatRoom(
@@ -53,7 +53,7 @@ import press.mantra.compose.ui.composable.navigation.routes.FrostSigningRoute
import press.mantra.compose.ui.composable.navigation.routes.ImplementationPendingRoute
import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.AddTranslationArtifactVersionViewModel
import press.mantra.compose.ui.view.state.AddTranslationArtifactVersionUIState
import press.mantra.compose.ui.theme.spacing
@@ -317,7 +317,7 @@ fun AddTranslationArtifactVersionScreen(
@ConformancePreviews
@Composable
private fun AddTranslationArtifactVersionScreenPreview() {
TorchTheme {
MantraTheme {
Surface(modifier = Modifier.fillMaxSize()) {
AddTranslationArtifactVersionScreen(
activeUserPublicKey = "",
@@ -44,7 +44,7 @@ import press.mantra.compose.ui.composable.navigation.routes.ChapterDetailRoute
import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.navigation.routes.TranslationArtifactVersionDetailRoute
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.ArtifactDetailViewModel
import press.mantra.compose.ui.view.state.ArtifactDetailUIState
import press.mantra.compose.ui.theme.spacing
@@ -333,7 +333,7 @@ fun ArtifactDetailScreen(
@ConformancePreviews
@Composable
private fun ArtifactDetailScreenPreview() {
TorchTheme {
MantraTheme {
Surface(modifier = Modifier.fillMaxSize()) {
ArtifactDetailScreen(
activeUserPublicKey = "",
@@ -34,7 +34,7 @@ import com.vitorpamplona.quartz.nip01Core.core.HexKey
import press.mantra.compose.database.model.MantraChapter
import press.mantra.compose.repository.MantraRepository
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.ChapterDetailViewModel
import press.mantra.compose.ui.view.state.ChapterDetailUIState
import press.mantra.compose.ui.theme.spacing
@@ -199,7 +199,7 @@ fun ChapterDetailScreen(
@ConformancePreviews
@Composable
private fun ChapterDetailScreenPreview() {
TorchTheme {
MantraTheme {
Surface(modifier = Modifier.fillMaxSize()) {
ChapterDetailScreen(
activeUserPublicKey = "",
@@ -175,7 +175,7 @@ fun ChatRoomCreationScreen(
@ConformancePreviews
@Composable
private fun LoadingScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -77,7 +77,7 @@ import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.composable.widgets.dialogs.ModalBottomSheet
import press.mantra.compose.ui.composable.widgets.rememberNotifier
import press.mantra.compose.ui.composable.widgets.profile.ProfileAvatar
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.ChatRoomDetailViewModel
import press.mantra.compose.ui.view.state.ChatRoomDetailUIState
import com.vitorpamplona.quartz.nip01Core.core.HexKey
@@ -1222,7 +1222,7 @@ private fun ReindexMarmotGroupEventsButton(
@ConformancePreviews
@Composable
private fun ChatRoomMessagingScreenPreview() {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -52,7 +52,7 @@ import press.mantra.compose.ui.composable.navigation.routes.FrostSigningRoute
import press.mantra.compose.ui.composable.navigation.routes.ProposalListRoute
import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.ChatRoomMessagingViewModel
import press.mantra.compose.ui.view.state.ChatRoomMessagingUIState
import com.vitorpamplona.quartz.nip01Core.core.HexKey
@@ -466,7 +466,7 @@ fun ChatRoomMessagingScreen(
@ConformancePreviews
@Composable
private fun ChatRoomMessagingScreenPreview() {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -396,7 +396,7 @@ fun CreateProfileScreen(
@ConformancePreviews
@Composable
fun CreateAccountScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -63,7 +63,7 @@ import press.mantra.compose.repository.ChatRepository
import press.mantra.compose.repository.DkgRepository
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.composable.widgets.profile.ProfileColor
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.database.model.types.DkgApprovalStep
import press.mantra.compose.ui.composable.navigation.routes.DkgJoinApprovalRoute
import press.mantra.compose.ui.composable.navigation.routes.DkgRound1ApprovalRoute
@@ -865,7 +865,7 @@ private fun QuorumStepper(
@ConformancePreviews
@Composable
private fun DkgRitualScreenPreview() {
TorchTheme {
MantraTheme {
Surface(modifier = Modifier.fillMaxSize()) {
DkgRitualScreen(
activeUserPublicKey = "",
@@ -52,7 +52,7 @@ import press.mantra.compose.repository.ChatRepository
import press.mantra.compose.repository.FrostSigningRepository
import press.mantra.compose.text.ProposedEvent
import press.mantra.compose.ui.composable.widgets.profile.ProfileAvatar
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.FrostSigningViewModel
import press.mantra.compose.ui.view.state.FrostSigningUIState
import press.mantra.compose.ui.theme.spacing
@@ -410,7 +410,7 @@ private fun statusOf(session: FrostSigningSession): String = when (session.stage
@ConformancePreviews
@Composable
private fun FrostSigningScreenPreview() {
TorchTheme {
MantraTheme {
Surface(modifier = Modifier.fillMaxSize()) {
FrostSigningScreen(
activeUserPublicKey = "",
@@ -48,7 +48,7 @@ import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.composable.widgets.dialogs.NewChatBottomSheetDialog
import press.mantra.compose.ui.composable.widgets.dialogs.StartDirectMessageToNpubOrNip05Dialog
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.ChatRoomListViewModel
import press.mantra.compose.ui.view.model.HomeScreenType
import press.mantra.compose.ui.view.model.HomeViewModel
@@ -155,10 +155,12 @@ fun HomeScreen(
title = {
// "Mantra". The launcher label, the desktop window title, the
// landing screen and the package name all say so; this bar was
// the last place still saying "Torch". `UserAgent.APP_NAME` is
// the other, and is left alone -- it goes on the wire to relay
// operators, so it is a network identity question rather than
// a content one.
// the last place still saying "Torch", the brand before this
// one, and `UserAgent.CLIENT_NAME` was the other. That one went
// last, because it goes on the wire: it is the `client` tag on
// every relay list this app publishes. It could move because it
// is attribution and nothing derives from it -- unlike the two
// `mantra/` hash tags, which must never move at all.
Text(stringResource(Res.string.mantra))
},
// No navigation icon and no actions. The avatar in the leading
@@ -350,7 +352,7 @@ fun HomeScreen(
@ConformancePreviews
@Composable
private fun HomeScreenPreview() {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -47,7 +47,7 @@ fun ImplementationPendingScreen(
@ConformancePreviews
@Composable
private fun ImplementationPendingScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -246,7 +246,7 @@ fun KeyPackageManagementScreen(
@ConformancePreviews
@Composable
private fun UnannouncedProfileScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -299,7 +299,7 @@ private fun KeyRecoveryOption(
@ConformancePreviews
@Composable
private fun KeyRecoveryScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -115,7 +115,7 @@ fun LandingScreen(
@ConformancePreviews
@Composable
private fun LandingScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -31,7 +31,7 @@ fun LoadingScreen(
@ConformancePreviews
@Composable
private fun LoadingScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -23,7 +23,7 @@ import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.composable.widgets.detail.MetadataEventDetail
import press.mantra.compose.ui.composable.widgets.detail.TextNoteEventDetail
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.NostrEventDetailViewModel
import press.mantra.compose.ui.view.state.NostrEventDetailUIState
import com.vitorpamplona.quartz.nip01Core.core.HexKey
@@ -149,7 +149,7 @@ fun NostrEventDetailScreen(
@ConformancePreviews
@Composable
private fun NostrEventDetailScreenPreview() {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -50,7 +50,7 @@ import press.mantra.compose.repository.FrostSigningRepository
import press.mantra.compose.text.ProposedEvent
import press.mantra.compose.ui.composable.navigation.routes.FrostSigningRoute
import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.ProposalListViewModel
import press.mantra.compose.ui.view.state.ProposalListUIState
import press.mantra.compose.ui.theme.spacing
@@ -418,7 +418,7 @@ private fun ProposalListScreenPreview() {
signerId = 1
)
TorchTheme {
MantraTheme {
Surface(modifier = Modifier.fillMaxSize()) {
ProposalListScreen(
activeUserPublicKey = "u".repeat(64),
@@ -460,7 +460,7 @@ private fun RecoveryPhraseCheckbox(
@ConformancePreviews
@Composable
private fun RecoveryPhraseScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -487,7 +487,7 @@ private fun RecoveryPhraseScreenPreview() {
@ConformancePreviews
@Composable
private fun RecoveryPhraseScreenHiddenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -35,7 +35,7 @@ import press.mantra.compose.ui.composable.navigation.routes.AddMemberToChatRoomC
import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.composable.widgets.profile.ProfileAvatar
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.SearchMemberToAddToChatRoomViewModel
import press.mantra.compose.ui.view.state.SearchMemberToAddToChatRoomUIState
import com.vitorpamplona.quartz.nip01Core.core.HexKey
@@ -226,7 +226,7 @@ fun SearchMemberToAddToChatRoomScreen(
@ConformancePreviews
@Composable
private fun ChatRoomDetailScreenPreview() {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -284,7 +284,7 @@ fun SearchResultScreen(
@ConformancePreviews
@Composable
private fun SearchResultScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -58,7 +58,7 @@ import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.navigation.routes.SearchResultRoute
import press.mantra.compose.ui.composable.widgets.profile.ProfileAvatar
import press.mantra.compose.ui.composable.widgets.profile.ProfileColor
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.SearchViewModel
import press.mantra.compose.ui.view.state.SearchUIState
import press.mantra.compose.ui.theme.spacing
@@ -426,7 +426,7 @@ fun SearchScreen(
@ConformancePreviews
@Composable
private fun SearchScreenPreview() {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -37,7 +37,7 @@ import press.mantra.compose.repository.NostrRepository
import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.composable.widgets.profile.ProfileAvatar
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.SelectChatRoomMembersViewModel
import press.mantra.compose.ui.view.state.SelectChatRoomMembersUIState
import com.vitorpamplona.quartz.nip01Core.core.HexKey
@@ -283,7 +283,7 @@ fun SelectChatRoomMembersScreen(
@ConformancePreviews
@Composable
private fun SelectChatRoomMembersScreenPreview() {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -47,7 +47,7 @@ import press.mantra.compose.repository.DkgRepository
import press.mantra.compose.repository.NostrRepository
import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.SelectChatRoomTypeViewModel
import press.mantra.compose.ui.view.state.SelectChatRoomTypeUIState
import com.vitorpamplona.quartz.nip01Core.core.HexKey
@@ -465,7 +465,7 @@ private fun QuorumPicker(
@ConformancePreviews
@Composable
private fun SelectChatRoomTypeScreenPreview() {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -62,7 +62,7 @@ import press.mantra.compose.ui.composable.widgets.LocalSnackbarHostState
import press.mantra.compose.ui.composable.widgets.ScreenStateTransition
import press.mantra.compose.ui.composable.widgets.profile.ProfileAvatar
import press.mantra.compose.ui.theme.ConformancePreviews
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.theme.readableContent
import press.mantra.compose.ui.theme.spacing
import press.mantra.compose.ui.view.model.SelectSubgroupAdminsViewModel
@@ -326,7 +326,7 @@ private fun QuorumStepper(
@ConformancePreviews
@Composable
private fun SelectSubgroupAdminsScreenPreview() {
TorchTheme {
MantraTheme {
Surface(modifier = Modifier.fillMaxSize()) {
SelectSubgroupAdminsScreen(
activeUserPublicKey = "a".repeat(64),
@@ -230,7 +230,7 @@ fun ShareProfileScreen(
@ConformancePreviews
@Composable
private fun UnannouncedProfileScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -45,7 +45,7 @@ fun SignInToProfileScreen() {
@ConformancePreviews
@Composable
private fun SignInToProfileScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -127,7 +127,7 @@ fun SocialPreconditionScreen(
@ConformancePreviews
@Composable
private fun SocialPreconditionScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -49,7 +49,7 @@ import press.mantra.compose.ui.composable.navigation.routes.FrostSigningRoute
import press.mantra.compose.ui.composable.navigation.routes.ImplementationPendingRoute
import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.TranslateChunkViewModel
import press.mantra.compose.ui.view.state.TranslateChunkUIState
import press.mantra.compose.ui.theme.spacing
@@ -270,7 +270,7 @@ fun TranslateChunkScreen(
@ConformancePreviews
@Composable
private fun TranslateChunkScreenPreview() {
TorchTheme {
MantraTheme {
Surface(modifier = Modifier.fillMaxSize()) {
TranslateChunkScreen(
activeUserPublicKey = "",
@@ -42,7 +42,7 @@ import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.navigation.routes.TranslationChapterRoute
import press.mantra.compose.ui.composable.widgets.DetailRow
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.TranslationArtifactVersionDetailViewModel
import press.mantra.compose.ui.view.state.TranslationArtifactVersionDetailUIState
import press.mantra.compose.ui.theme.spacing
@@ -287,7 +287,7 @@ fun TranslationArtifactVersionDetailScreen(
@ConformancePreviews
@Composable
private fun TranslationArtifactVersionDetailScreenPreview() {
TorchTheme {
MantraTheme {
Surface(modifier = Modifier.fillMaxSize()) {
TranslationArtifactVersionDetailScreen(
activeUserPublicKey = "",
@@ -42,7 +42,7 @@ import press.mantra.compose.repository.MantraRepository
import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.navigation.routes.TranslateChunkRoute
import press.mantra.compose.ui.composable.widgets.LoadingDataIndicator
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.TranslationChapterViewModel
import press.mantra.compose.ui.view.state.ChunkTranslationPair
import press.mantra.compose.ui.view.state.TranslationChapterUIState
@@ -245,7 +245,7 @@ private fun TableRow(
@ConformancePreviews
@Composable
private fun TranslationChapterScreenPreview() {
TorchTheme {
MantraTheme {
Surface(modifier = Modifier.fillMaxSize()) {
TranslationChapterScreen(
activeUserPublicKey = "",
@@ -79,7 +79,7 @@ fun UnannouncedProfileScreen() {
@ConformancePreviews
@Composable
private fun UnannouncedProfileScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -79,7 +79,7 @@ fun UnindexedProfileScreen() {
@ConformancePreviews
@Composable
private fun UnannouncedProfileScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -79,7 +79,7 @@ fun UnqueuedProfileScreen() {
@ConformancePreviews
@Composable
private fun UnannouncedProfileScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -91,7 +91,7 @@ fun UnqueuedProfileSynchronizationScreen(
@ConformancePreviews
@Composable
private fun UnqueuedProfileSynchronizationScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -73,7 +73,7 @@ fun UnsignedProfileScreen() {
@ConformancePreviews
@Composable
private fun UnsignedProfileScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -75,7 +75,7 @@ fun UnsyncedProfileScreen(
@ConformancePreviews
@Composable
private fun UnsyncedProfileScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -468,7 +468,7 @@ fun WriteNewNoteScreen(
@ConformancePreviews
@Composable
private fun WriteNewNoteScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -69,7 +69,7 @@ fun LoadingDataIndicator(
@ConformancePreviews
@Composable
private fun TransferHistoryScreenPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(modifier = Modifier.fillMaxSize()) {
LoadingDataIndicator(
text = "Starting up"
@@ -120,7 +120,7 @@ fun QuotedNote(
@ConformancePreviews
@Composable
private fun QuotedNotePreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -401,7 +401,7 @@ fun RichContent(
@ConformancePreviews
@Composable
private fun RichContentPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -50,7 +50,7 @@ import press.mantra.compose.ui.composable.navigation.routes.ChatRoomMessagingRou
import press.mantra.compose.ui.composable.navigation.routes.ImplementationPendingRoute
import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.composable.widgets.profile.ProfileAvatar
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import press.mantra.compose.ui.view.model.MetadataEventDetailType
import press.mantra.compose.ui.view.model.MetadataEventDetailViewModel
import press.mantra.compose.ui.view.state.MetadataEventDetailUIState
@@ -326,7 +326,7 @@ fun MetadataEventDetail(
@Composable
private fun MetadataEventEventDetailPreview() {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -393,7 +393,7 @@ fun TextNoteEventDetail(
@Composable
private fun TextNoteEventDetailPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -36,7 +36,7 @@ import press.mantra.compose.extensions.bech32ToHexOrNull
import press.mantra.compose.ui.composable.navigation.routes.ChatRoomMessagingRoute
import press.mantra.compose.ui.composable.navigation.routes.ImplementationPendingRoute
import press.mantra.compose.ui.composable.navigation.routes.Route
import press.mantra.compose.ui.theme.TorchTheme
import press.mantra.compose.ui.theme.MantraTheme
import com.vitorpamplona.quartz.nip01Core.core.HexKey
import fr.acinq.phoenix.utils.Parser
import kotlinx.coroutines.CoroutineScope
@@ -190,7 +190,7 @@ fun StartDirectMessageToNpubOrNip05Dialog(
@ConformancePreviews
@Composable
private fun StartDirectMessageToNpubOrNip05DialogPreview() {
TorchTheme {
MantraTheme {
Surface(
modifier = Modifier.fillMaxSize()
) {
@@ -129,7 +129,7 @@ fun press.mantra.compose.database.model.intermdiate.LocalNostrEvent.ListView(
@ConformancePreviews
@Composable
private fun EventListViewRepostedPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -180,7 +180,7 @@ private fun EventListViewRepostedPreview() {
@ConformancePreviews
@Composable
private fun EventListViewInReplyPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -187,7 +187,7 @@ internal fun TextNoteFeedItem(
@ConformancePreviews
@Composable
private fun TextNoteFeedItemPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -218,7 +218,7 @@ private fun TextNoteFeedItemPreview() {
@ConformancePreviews
@Composable
private fun TextNoteFeedItemInReplyToPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -272,7 +272,7 @@ private fun TextNoteFeedItemInReplyToPreview() {
@ConformancePreviews
@Composable
private fun TextNoteFeedItemQuoteNostrEventPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -93,7 +93,7 @@ fun ProfileAvatar(
@ConformancePreviews
@Composable
fun ProfileAvatarPreview() {
press.mantra.compose.ui.theme.TorchTheme {
press.mantra.compose.ui.theme.MantraTheme {
Surface(
modifier = Modifier.padding(MaterialTheme.spacing.space250)
) {
@@ -59,7 +59,7 @@ enum class Breakpoint(val minWidth: Dp) {
* them.
*
* Total, including for a width below [Compact.minWidth]. This is called from
* [TorchTheme] on every composition, and a desktop window reports a zero size for
* [MantraTheme] on every composition, and a desktop window reports a zero size for
* the frame before its first layout pass; throwing there would take the app down
* on a resize rather than on anything a user did.
*/
@@ -71,7 +71,7 @@ enum class Breakpoint(val minWidth: Dp) {
/**
* The breakpoint the current window is in.
*
* Provided by [TorchTheme] as [LocalBreakpoint], so screens read
* Provided by [MantraTheme] as [LocalBreakpoint], so screens read
* `MaterialTheme.breakpoint` rather than calling this. It is public because the two
* entry points that compose above the theme -- the desktop passphrase gate, and any
* future splash -- have nowhere else to get it.
@@ -79,7 +79,7 @@ enum class Breakpoint(val minWidth: Dp) {
* **Why the window size and not `currentWindowAdaptiveInfo()`.** The latter also computes
* a [androidx.compose.material3.adaptive.Posture] from the platform's fold state, which
* on android means reaching for `WindowInfoTracker` and an `Activity`. This is called
* from [TorchTheme], which wraps every `@Preview` in the tree, and a preview context is
* from [MantraTheme], which wraps every `@Preview` in the tree, and a preview context is
* not an activity. `currentWindowDpSize()` is `LocalWindowInfo` and `LocalDensity` and
* nothing else, so it answers everywhere. The pane scaffolds ask for posture themselves,
* where a fold genuinely changes the answer.
@@ -90,7 +90,7 @@ fun currentBreakpoint(): Breakpoint = Breakpoint.ofWidth(currentWindowDpSize().w
/**
* Defaults to [Breakpoint.Compact] rather than throwing, because that is the layout every
* screen in this app was written against: a composable that never reaches a [TorchTheme]
* screen in this app was written against: a composable that never reaches a [MantraTheme]
* should render as it did before breakpoints existed, not fail.
*/
val LocalBreakpoint = staticCompositionLocalOf { Breakpoint.Compact }
@@ -21,7 +21,7 @@ import androidx.compose.ui.tooling.preview.Preview
* is right in the default scheme is right in the high-contrast one by construction. A
* per-screen high-contrast preview would be 51 more renders checking something already
* proved, and there is no `@Preview` parameter for it anyway -- it needs
* `TorchTheme(contrast = …)` in the body. [ThemeGallery] covers the schemes once, over
* `MantraTheme(contrast = …)` in the body. [ThemeGallery] covers the schemes once, over
* the components rather than over the screens.
*
* @see ThemeGallery
@@ -17,7 +17,7 @@ import androidx.navigation.NavBackStackEntry
/**
* Whether the platform has been asked to keep motion to a minimum.
*
* Provided by [TorchTheme] as [LocalReducedMotion]; the transitions below read it, so a
* Provided by [MantraTheme] as [LocalReducedMotion]; the transitions below read it, so a
* call site does not have to remember to. Reading it directly is for a screen animating
* something the shared helpers do not cover.
*
@@ -12,7 +12,7 @@ import androidx.compose.ui.unit.dp
* M3's spacing scale, and the semantic names layered over it.
*
* `MaterialTheme` has no spacing slot, so this rides a composition local beside it, the
* same way [ExtendedColors] does. [TorchTheme] provides it.
* same way [ExtendedColors] does. [MantraTheme] provides it.
*
* **The scale** is M3's own, an 8dp system where `space100 = 8dp`, including the sub-8
* nested units Material defines because its components need them. Numbers are from
@@ -393,7 +393,7 @@ val unspecified_scheme = ColorFamily(
* Brand colours that are not part of the generated scheme.
*
* `ColorScheme` has no slot for them -- M3 calls them extended colours and expects them to
* ride alongside -- so they travel on their own composition local, provided by [TorchTheme]
* ride alongside -- so they travel on their own composition local, provided by [MantraTheme]
* from the same `darkTheme` the scheme is chosen with. Reading `isSystemInDarkTheme()` at
* the call site instead would be subtly wrong: it would ignore a caller who passed
* `darkTheme` explicitly, and a preview forcing dark would show light pills.
@@ -408,7 +408,7 @@ data class ExtendedColors(
* The extended colours for the current theme.
*
* Defaults to the light families rather than to `unspecified_scheme` so that anything
* composing outside [TorchTheme] renders a real colour instead of nothing. That should not
* composing outside [MantraTheme] renders a real colour instead of nothing. That should not
* happen -- as of this commit nothing in the tree does -- but an invisible button is a worse
* way to find out than a light-themed one.
*/
@@ -484,7 +484,7 @@ internal fun appColorScheme(darkTheme: Boolean, contrast: ThemeContrast): ColorS
*/
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
@Composable
fun TorchTheme(
fun MantraTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
contrast: ThemeContrast = platformThemeContrast(),
// Dynamic color is available on Android 12+
@@ -44,7 +44,7 @@ import press.mantra.compose.ui.composable.widgets.Decorative
@Preview(name = "Six schemes", group = "schemes", widthDp = 1200, heightDp = 900)
@Composable
private fun ThemeGalleryPreview() {
// One render holding all six, not six renders. The contrast step is a `TorchTheme`
// One render holding all six, not six renders. The contrast step is a `MantraTheme`
// parameter and no preview annotation can set it, so the combinations have to be laid
// out in the body -- and laying them out side by side is what makes them comparable,
// which is the only reason to look at them at all.
@@ -70,7 +70,7 @@ private fun ThemeGalleryPreview() {
*/
@Composable
fun ThemeGallery(darkTheme: Boolean, contrast: ThemeContrast) {
TorchTheme(darkTheme = darkTheme, contrast = contrast, dynamicColor = false) {
MantraTheme(darkTheme = darkTheme, contrast = contrast, dynamicColor = false) {
Surface {
Column(
modifier = Modifier.padding(MaterialTheme.spacing.compactPadding),
@@ -74,7 +74,7 @@ class AddMemberToChatRoomConfirmationViewModel(
val lookupTimeout = launch {
delay(RELAY_LOOKUP_TIMEOUT)
addMemberToChatRoomConfirmationUIState =
AddMemberToChatRoomConfirmationUIState.Error("Profile missing key package event. Try again later or tell ${profile.humanReadableNameOrPubkey()} to use Torch.")
AddMemberToChatRoomConfirmationUIState.Error("Profile missing key package event. Try again later or tell ${profile.humanReadableNameOrPubkey()} to use Mantra.")
}
// Observe rather than read once: the key package usually lands a moment after
@@ -123,7 +123,7 @@ class ChatRoomMessagingViewModel(
val lookupTimeout = viewModelScope.launch {
delay(RELAY_LOOKUP_TIMEOUT)
chatRoomMessagingUIState = ChatRoomMessagingUIState.Error(
"Couldn't find this profile's chat details on the relays yet. They may not have finished setting up Torch."
"Couldn't find this profile's chat details on the relays yet. They may not have finished setting up Mantra."
)
}