From d49b32472b29d40472dbfd7b8cf396adc8287daa Mon Sep 17 00:00:00 2001 From: Silberengel Date: Thu, 23 Apr 2026 14:49:15 +0200 Subject: [PATCH] bug-fixes --- assets/controllers/comment_reply_controller.js | 14 ++++++++------ assets/styles/app.css | 12 +++++++++--- importmap.php | 10 ++++++++++ src/Controller/FeaturedAuthorsController.php | 10 +++++++++- templates/partial/author_profile_header.html.twig | 4 ++-- 5 files changed, 38 insertions(+), 12 deletions(-) diff --git a/assets/controllers/comment_reply_controller.js b/assets/controllers/comment_reply_controller.js index d4a75df..345e346 100644 --- a/assets/controllers/comment_reply_controller.js +++ b/assets/controllers/comment_reply_controller.js @@ -68,8 +68,9 @@ export default class extends Controller { return; } this.setHint('Preparing event…'); - const { nip19 } = await import('nostr-tools'); - const link = this.buildParentBech32(nip19); + // `nostr-tools` entry pulls @noble/curves (bare spec → breaks in AssetMapper). NIP-19 only needs bech32 helpers. + const { naddrEncode, neventEncode } = await import('nostr-tools/nip19'); + const link = this.buildParentBech32(naddrEncode, neventEncode); const blurb = `> Replying to **${this.blurbLabelValue}** — [view parent](nostr:${link})\n\n`; const unsigned = { kind: 1111, @@ -135,18 +136,19 @@ export default class extends Controller { } /** - * @param {import('nostr-tools').nip19} nip19 + * @param {function(object): string} naddrEncode + * @param {function(object): string} neventEncode */ - buildParentBech32(nip19) { + buildParentBech32(naddrEncode, neventEncode) { const allZero = /^0{64}$/.test(this.parentIdValue); const parts = (this.expectedCoordinateValue || '').split(':'); const k = parts[0] ? parseInt(parts[0], 10) : 30023; const pub = parts[1] || this.authorPubkeyValue; const d = parts[2] || ''; if (allZero && d !== '') { - return nip19.naddrEncode({ kind: k, pubkey: pub, identifier: d, relays: [] }); + return naddrEncode({ kind: k, pubkey: pub, identifier: d, relays: [] }); } - return nip19.neventEncode({ + return neventEncode({ id: this.parentIdValue, kind: this.parentKindValue, pubkey: this.authorPubkeyValue, diff --git a/assets/styles/app.css b/assets/styles/app.css index 18b780f..4a27403 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -621,21 +621,26 @@ footer a { white-space: nowrap; } -/* Do not use .author-profile__meta-value on this wrapper: its overflow:hidden clips the ✓. Ellipsis only the link. */ +/* NIP-05: ellipsis long addresses; keep ✓ immediately after the (truncated) text, not at the column edge. */ .author-profile__nip05-value { display: flex; align-items: center; - gap: 0.3rem; + justify-content: flex-start; + flex-wrap: nowrap; + gap: 0.25rem; min-width: 0; + max-width: 100%; width: 100%; } .author-profile__nip05-link { + flex: 0 1 auto; min-width: 0; + /* reserve space for the checkmark on the same “line” of layout */ + max-width: calc(100% - 1.4rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - flex: 1 1 0; word-break: normal; } @@ -647,6 +652,7 @@ footer a { opacity: 0.85; user-select: none; flex-shrink: 0; + flex-grow: 0; } .author-profile__payment-type { diff --git a/importmap.php b/importmap.php index 45613a9..93f5f2d 100644 --- a/importmap.php +++ b/importmap.php @@ -52,6 +52,16 @@ return [ 'nostr-tools' => [ 'version' => '2.10.4', ], + // Subpath: bech32 only (no @noble/curves) — used by comment_reply_controller for NIP-19 in blurb lines. + 'nostr-tools/nip19' => [ + 'version' => '2.10.4', + ], + '@noble/hashes' => [ + 'version' => '1.3.1', + ], + '@scure/base' => [ + 'version' => '1.1.1', + ], 'quill/dist/quill.core.css' => [ 'version' => '2.0.3', 'type' => 'css', diff --git a/src/Controller/FeaturedAuthorsController.php b/src/Controller/FeaturedAuthorsController.php index c839dac..a044145 100644 --- a/src/Controller/FeaturedAuthorsController.php +++ b/src/Controller/FeaturedAuthorsController.php @@ -6,6 +6,7 @@ namespace App\Controller; use App\Repository\FeaturedAuthorRepository; use App\Service\CacheService; +use App\Service\NostrClient; use App\Service\ProfileIdentityLinksBuilder; use App\Service\ProfilePaymentLinksBuilder; use swentel\nostr\Key\Key; @@ -23,6 +24,7 @@ final class FeaturedAuthorsController extends AbstractController public function index( FeaturedAuthorRepository $featuredAuthorRepository, CacheService $cacheService, + NostrClient $nostrClient, ProfileIdentityLinksBuilder $profileIdentityLinks, ProfilePaymentLinksBuilder $profilePaymentLinks, ParameterBagInterface $params, @@ -37,11 +39,17 @@ final class FeaturedAuthorsController extends AbstractController $author = $bundle['content']; $kind0Tags = $bundle['kind0_tags']; $jumbleProfileHref = $jumbleBase !== '' ? $jumbleBase.'/'.$npub : null; + $kind10133 = []; + try { + $kind10133 = $nostrClient->getKind10133PaymentTargetEventsForNpub($npub, 20); + } catch (\Throwable) { + } + $extraPayto = $profilePaymentLinks->collectPaytoUrisFromNipA3Kind10133Events($kind10133); $authors[] = [ 'author' => $author, 'npub' => $npub, 'profile_websites' => $profileIdentityLinks->buildWebsites($author, $kind0Tags), - 'profile_payment_links' => $profilePaymentLinks->buildPaymentRows($author, $kind0Tags, []), + 'profile_payment_links' => $profilePaymentLinks->buildPaymentRows($author, $kind0Tags, $extraPayto), 'jumble_profile_href' => $jumbleProfileHref, ]; } diff --git a/templates/partial/author_profile_header.html.twig b/templates/partial/author_profile_header.html.twig index e5ff9cc..4d440d2 100644 --- a/templates/partial/author_profile_header.html.twig +++ b/templates/partial/author_profile_header.html.twig @@ -22,7 +22,7 @@ {% for row in profile_websites %}
  • Website - {{ row.label|e }} + {{ row.label|e }}
  • {% endfor %} @@ -51,7 +51,7 @@ {% for row in profile_payment_links %}
  • - {{ row.label|e }} + {{ row.label|e }}
  • {% endfor %}