diff --git a/assets/styles/article.css b/assets/styles/article.css index ef5329d..bbb4754 100644 --- a/assets/styles/article.css +++ b/assets/styles/article.css @@ -128,21 +128,49 @@ blockquote p { gap: 0.35rem; } -/* Thread depth: light indent, max visual level 3 (deeper uses --depth-3) */ -.comments .card.comment--depth-0 { - margin-left: 0; +/* Tracebacks: same flex+gap as .comments so spacing isn’t lost to margin collapse or .card { margin } from app.css */ +.comments-quotes__list { + display: flex; + flex-direction: column; + gap: 0.4rem; + min-height: 0; +} + +.comments-quotes__list > .card.comment--quote { + margin: 0; /* override app.css .card { margin-bottom: 50px } */ + flex-shrink: 0; } -.comments .card.comment--depth-1 { - margin-left: 0.28rem; +.comments-quotes__list .card.comment--quote .card-footer.nostr-previews { + margin-top: 0.75rem; } -.comments .card.comment--depth-2 { - margin-left: 0.6rem; +/* Thread: no depth indent; one accent color for all replies; compact vertical rhythm */ +.comments { + display: flex; + flex-direction: column; + gap: 0.4rem; } +.comments .card.comment { + margin-left: 0; + margin-bottom: 0; + padding: 0.5rem 0.65rem 0.5rem 0.7rem; + border-radius: 6px; + border: 1px solid var(--color-border); + border-left: 3px solid var(--color-primary); +} + +.comments .card.comment--depth-0, +.comments .card.comment--depth-1, +.comments .card.comment--depth-2, .comments .card.comment--depth-3 { - margin-left: 0.95rem; + margin-left: 0; + border-left-color: var(--color-primary); +} + +.comments .card.comment .metadata { + margin-bottom: 0.4rem; } .comment__reply-blurb { @@ -185,13 +213,13 @@ blockquote p { } .comment-reply { - margin-top: 1rem; - padding-top: 1rem; + margin-top: 0.45rem; + padding-top: 0.45rem; border-top: 1px solid var(--color-border); } .comment-reply--article { - margin-bottom: 1.5rem; + margin-bottom: 0.75rem; border: 1px solid var(--color-border); border-radius: 6px; border-top: 1px solid var(--color-border); @@ -219,8 +247,8 @@ blockquote p { } .comment-reply__toolbar--inline { - margin-bottom: 0.25rem; - margin-top: 0.5rem; + margin-bottom: 0.15rem; + margin-top: 0.3rem; justify-content: flex-end; } @@ -243,7 +271,7 @@ blockquote p { } .comment-reply--nested { - margin-top: 0.5rem; + margin-top: 0.3rem; } .comment-reply__head { diff --git a/assets/styles/layout.css b/assets/styles/layout.css index 7cdc4d8..eeda26f 100644 --- a/assets/styles/layout.css +++ b/assets/styles/layout.css @@ -92,13 +92,28 @@ nav a:hover { } .nostr-share-menu__trigger { + display: inline-flex; + align-items: center; + gap: 0.2rem; min-width: 2.25rem; - font-size: 1.15rem; + font-size: 0.9rem; line-height: 1.2; padding: 0.2rem 0.45rem; list-style: none; } +.nostr-share-menu__label { + font-size: 0.85rem; + font-weight: 600; + white-space: nowrap; +} + +.nostr-share-menu__glyph { + font-size: 1.1rem; + line-height: 1; + opacity: 0.9; +} + .nostr-share-menu__trigger::-webkit-details-marker { display: none; } @@ -578,6 +593,11 @@ footer { text-align: center; } +.site-footer__jumble { + margin: 0 0 0.65rem; + font-size: 0.95rem; +} + .site-footer__legal { margin: 1rem 0 0; font-size: 0.95rem; diff --git a/config/services.yaml b/config/services.yaml index 4698972..ec077ca 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -47,6 +47,8 @@ services: tags: [ 'twig.extension' ] App\Twig\NostrShareMenuExtension: tags: [ 'twig.extension' ] + App\Twig\MagazineJumbleExtension: + tags: [ 'twig.extension' ] # Nostr index snapshots: distinct key prefix from other cache.app users. App\Service\MagazineIndexStore: arguments: diff --git a/config/unfold.yaml b/config/unfold.yaml index 9543748..e3d5e73 100644 --- a/config/unfold.yaml +++ b/config/unfold.yaml @@ -45,8 +45,8 @@ parameters: magazine_prewarm_also_slugs: '%env(default:magazine_prewarm_also_slugs_empty:MAGAZINE_PREWARM_ALSO_SLUGS)%' external_links: - title: "Unfold" - url: "https://github.com/decent-newsroom/unfold" - description: "Project source code on GitHub." + url: "https://git.imwald.eu/silberengel/unfold/src/branch/imwald" + description: "This site’s Unfold source (imwald branch)." - title: "Decent Newsroom" url: "https://decentnewsroom.com/" description: "Decentralized magazine platform." diff --git a/src/Service/ArticleCommentThreadLoader.php b/src/Service/ArticleCommentThreadLoader.php index 4c4fa11..63c6752 100644 --- a/src/Service/ArticleCommentThreadLoader.php +++ b/src/Service/ArticleCommentThreadLoader.php @@ -309,7 +309,7 @@ final readonly class ArticleCommentThreadLoader $pRaw = isset($parent->content) ? (string) $parent->content : ''; $preview = $this->parentEventTextPreviewForBlurb($pRaw); if ($preview !== '') { - $blurb = '> *'.'Replying to thread'.'* — '."\n> ".$preview; + $blurb = '> *'.'Reply to'.'* — '."\n> ".$preview; } } } diff --git a/src/Service/NostrShareMenuBuilder.php b/src/Service/NostrShareMenuBuilder.php index b40b3c5..367ee5f 100644 --- a/src/Service/NostrShareMenuBuilder.php +++ b/src/Service/NostrShareMenuBuilder.php @@ -106,18 +106,13 @@ final class NostrShareMenuBuilder return new Key(); } - public function buildForRequest(Request $request): ?NostrShareMenuContext + /** + * Context for the header Nostr menu. Always returns a context on real HTTP requests (never null). + * Templates that do not include the header never call this; no need to suppress on XHR / fragments. + */ + public function buildForRequest(Request $request): NostrShareMenuContext { - if ($request->isXmlHttpRequest() || 'xmlhttprequest' === strtolower((string) $request->headers->get('X-Requested-With'))) { - return null; - } - if ($request->attributes->getBoolean('_embed')) { - return null; - } $route = (string) $request->attributes->get('_route', ''); - if (str_ends_with($route, 'fragment') || str_starts_with($request->getPathInfo(), '/fragment/')) { - return null; - } if ('' === $route) { return $this->siteWithRootMenu(); } diff --git a/src/Twig/MagazineJumbleExtension.php b/src/Twig/MagazineJumbleExtension.php new file mode 100644 index 0000000..2b1fa6b --- /dev/null +++ b/src/Twig/MagazineJumbleExtension.php @@ -0,0 +1,65 @@ +magazineOnJumbleUrl(...)), + ]; + } + + public function magazineOnJumbleUrl(): string + { + $key = new Key(); + try { + $pubkeyHex = $key->convertToHex($this->siteNpub); + } catch (\Throwable) { + return '#'; + } + if (64 !== \strlen($pubkeyHex) || !ctype_xdigit($pubkeyHex)) { + return '#'; + } + $d = \trim($this->rootMagazineDTag); + if ($d === '') { + return '#'; + } + try { + $naddr = Nip19Addressable::naddrBech32( + KindsEnum::PUBLICATION_INDEX->value, + strtolower($pubkeyHex), + $d, + [], + ); + } catch (\Throwable) { + return '#'; + } + $b = \rtrim($this->jumbleFeedNotesBase, '/'); + + return $b === '' ? $naddr : $b.'/'.$naddr; + } +} diff --git a/templates/components/Footer.html.twig b/templates/components/Footer.html.twig index 7f05e4d..1ebe653 100644 --- a/templates/components/Footer.html.twig +++ b/templates/components/Footer.html.twig @@ -24,6 +24,9 @@
{% endif %}