From 7e750d2517899ed04c52887a2ea4dd9d23f9704a Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 16 May 2026 22:00:30 +0000 Subject: [PATCH 1/2] feat(profile): restore Lightning Address + LNURL fields in Edit Profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lightning fields had moved entirely into the NWC wallet setup screen (NIP47SetupScreen), so a user with no NWC connection had no way to set their lud16/lud06 — required for receiving zaps. Add an expandable Lightning section in the profile editor that reads/writes lud16 and lud06, auto-expanded when either is set. NIP47SetupScreen keeps its lud16 field; both flows go through sendNewUserMetadata which already no-ops null params, so editing only one side never wipes the other. https://claude.ai/code/session_01R2E6rMfhxKA8csVarjxKJd --- .../ui/actions/NewUserMetadataScreen.kt | 42 +++++++++++++++++++ .../ui/actions/NewUserMetadataViewModel.kt | 8 ++++ 2 files changed, 50 insertions(+) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewUserMetadataScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewUserMetadataScreen.kt index ae124dfaf4..c8210d1755 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewUserMetadataScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewUserMetadataScreen.kt @@ -73,6 +73,7 @@ fun NewUserMetadataScreen( val context = LocalContext.current val socialExpanded = rememberSaveable { mutableStateOf(false) } + val lightningExpanded = rememberSaveable { mutableStateOf(false) } LaunchedEffect(postViewModel, accountViewModel) { postViewModel.load() @@ -81,6 +82,11 @@ fun NewUserMetadataScreen( if (postViewModel.twitter.value.isNotBlank() || postViewModel.mastodon.value.isNotBlank() || postViewModel.github.value.isNotBlank()) { socialExpanded.value = true } + + // Auto-expand lightning if any has data + if (postViewModel.lnAddress.value.isNotBlank() || postViewModel.lnURL.value.isNotBlank()) { + lightningExpanded.value = true + } } Scaffold( @@ -271,6 +277,42 @@ fun NewUserMetadataScreen( singleLine = true, ) + // -- Lightning -- + ExpandableSection( + title = stringRes(R.string.lightning_address), + expanded = lightningExpanded, + ) { + OutlinedTextField( + label = { Text(text = stringRes(R.string.lightning_address)) }, + modifier = Modifier.fillMaxWidth(), + value = postViewModel.lnAddress.value, + onValueChange = { postViewModel.lnAddress.value = it }, + placeholder = { + Text( + text = "me@mylightningnode.com", + color = MaterialTheme.colorScheme.placeholderText, + ) + }, + singleLine = true, + ) + + Spacer(modifier = Modifier.height(10.dp)) + + OutlinedTextField( + label = { Text(text = stringRes(R.string.lnurl)) }, + modifier = Modifier.fillMaxWidth(), + value = postViewModel.lnURL.value, + onValueChange = { postViewModel.lnURL.value = it }, + placeholder = { + Text( + text = "LNURL1…", + color = MaterialTheme.colorScheme.placeholderText, + ) + }, + singleLine = true, + ) + } + // -- Social Proofs -- ExpandableSection( title = stringRes(R.string.social_proof), diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewUserMetadataViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewUserMetadataViewModel.kt index 80db28a2dc..c5ea8056fb 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewUserMetadataViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewUserMetadataViewModel.kt @@ -57,6 +57,8 @@ class NewUserMetadataViewModel : ViewModel() { val website = mutableStateOf("") val pronouns = mutableStateOf("") val nip05 = mutableStateOf("") + val lnAddress = mutableStateOf("") + val lnURL = mutableStateOf("") val twitter = mutableStateOf("") val github = mutableStateOf("") @@ -80,6 +82,8 @@ class NewUserMetadataViewModel : ViewModel() { website.value = it.info.website ?: "" pronouns.value = it.info.pronouns ?: "" nip05.value = it.info.nip05 ?: "" + lnAddress.value = it.info.lud16 ?: "" + lnURL.value = it.info.lud06 ?: "" } twitter.value = "" @@ -117,6 +121,8 @@ class NewUserMetadataViewModel : ViewModel() { pronouns = pronouns.value, about = about.value, nip05 = nip05.value, + lnAddress = lnAddress.value, + lnURL = lnURL.value, ) val identities = @@ -140,6 +146,8 @@ class NewUserMetadataViewModel : ViewModel() { banner.value = "" website.value = "" nip05.value = "" + lnAddress.value = "" + lnURL.value = "" twitter.value = "" github.value = "" mastodon.value = "" From 44234aa6482296a9abedfd550f655b00abc8d97a Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 16 May 2026 22:16:52 +0000 Subject: [PATCH 2/2] feat(profile): inline Lightning Address + LNURL fields in Edit Profile Promote the two lightning fields out of an expandable section so they sit alongside name/about/nip05/website as regular always-visible inputs. https://claude.ai/code/session_01R2E6rMfhxKA8csVarjxKJd --- .../ui/actions/NewUserMetadataScreen.kt | 68 ++++++++----------- 1 file changed, 29 insertions(+), 39 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewUserMetadataScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewUserMetadataScreen.kt index c8210d1755..c83719af68 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewUserMetadataScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewUserMetadataScreen.kt @@ -73,7 +73,6 @@ fun NewUserMetadataScreen( val context = LocalContext.current val socialExpanded = rememberSaveable { mutableStateOf(false) } - val lightningExpanded = rememberSaveable { mutableStateOf(false) } LaunchedEffect(postViewModel, accountViewModel) { postViewModel.load() @@ -82,11 +81,6 @@ fun NewUserMetadataScreen( if (postViewModel.twitter.value.isNotBlank() || postViewModel.mastodon.value.isNotBlank() || postViewModel.github.value.isNotBlank()) { socialExpanded.value = true } - - // Auto-expand lightning if any has data - if (postViewModel.lnAddress.value.isNotBlank() || postViewModel.lnURL.value.isNotBlank()) { - lightningExpanded.value = true - } } Scaffold( @@ -277,41 +271,37 @@ fun NewUserMetadataScreen( singleLine = true, ) - // -- Lightning -- - ExpandableSection( - title = stringRes(R.string.lightning_address), - expanded = lightningExpanded, - ) { - OutlinedTextField( - label = { Text(text = stringRes(R.string.lightning_address)) }, - modifier = Modifier.fillMaxWidth(), - value = postViewModel.lnAddress.value, - onValueChange = { postViewModel.lnAddress.value = it }, - placeholder = { - Text( - text = "me@mylightningnode.com", - color = MaterialTheme.colorScheme.placeholderText, - ) - }, - singleLine = true, - ) + Spacer(modifier = Modifier.height(10.dp)) - Spacer(modifier = Modifier.height(10.dp)) + OutlinedTextField( + label = { Text(text = stringRes(R.string.lightning_address)) }, + modifier = Modifier.fillMaxWidth(), + value = postViewModel.lnAddress.value, + onValueChange = { postViewModel.lnAddress.value = it }, + placeholder = { + Text( + text = "me@mylightningnode.com", + color = MaterialTheme.colorScheme.placeholderText, + ) + }, + singleLine = true, + ) - OutlinedTextField( - label = { Text(text = stringRes(R.string.lnurl)) }, - modifier = Modifier.fillMaxWidth(), - value = postViewModel.lnURL.value, - onValueChange = { postViewModel.lnURL.value = it }, - placeholder = { - Text( - text = "LNURL1…", - color = MaterialTheme.colorScheme.placeholderText, - ) - }, - singleLine = true, - ) - } + Spacer(modifier = Modifier.height(10.dp)) + + OutlinedTextField( + label = { Text(text = stringRes(R.string.lnurl)) }, + modifier = Modifier.fillMaxWidth(), + value = postViewModel.lnURL.value, + onValueChange = { postViewModel.lnURL.value = it }, + placeholder = { + Text( + text = "LNURL1…", + color = MaterialTheme.colorScheme.placeholderText, + ) + }, + singleLine = true, + ) // -- Social Proofs -- ExpandableSection(