From d9da6bda36165f6d89ee2d9a5143a1fba871824e Mon Sep 17 00:00:00 2001 From: Doug Hoyte Date: Thu, 19 Dec 2024 19:13:46 -0500 Subject: [PATCH] np --- src/apps/web/TODO | 2 ++ src/apps/web/WebData.h | 4 +++- src/apps/web/static/oddbean.css | 32 ++++++++++++++++++++++++++++---- src/apps/web/tmpls/events.tmpl | 4 ++++ src/apps/web/tmpls/main.tmpl | 4 ++++ 5 files changed, 41 insertions(+), 5 deletions(-) diff --git a/src/apps/web/TODO b/src/apps/web/TODO index 6d099a3..47e6fd0 100644 --- a/src/apps/web/TODO +++ b/src/apps/web/TODO @@ -1,6 +1,8 @@ read * nostr: links not replaced in feed titles * support nprofile/nevent/etc links + example nevent: https://oddbean.com/e/note1qmye0at28we63aze93xjr92nzw725td0a5ncz3htwlc3wg78kp6q7802ad + example nprofile: https://oddbean.com/e/note1ykjalrpaj6jvxeuc434yd7ksrj8yd2vte478700ta8np250l3clsyjvh4q * non-500 error pages when bech32 fails to parse, for example * search field: enter anything, pubkey (hex or npub), eventId, etc. maybe even full-text search? * rss diff --git a/src/apps/web/WebData.h b/src/apps/web/WebData.h index 54d6268..7c651e5 100644 --- a/src/apps/web/WebData.h +++ b/src/apps/web/WebData.h @@ -615,7 +615,9 @@ struct EventThread { if (processedLevIds.contains(e.ev.primaryKeyId)) continue; if (e.getKind() != 1) continue; - ctx.orphanNodes.emplace_back(e.getCreatedAt(), process(id)); + if (!eventCache.contains(e.parent)) { + ctx.orphanNodes.emplace_back(e.getCreatedAt(), process(id)); + } } std::sort(ctx.orphanNodes.begin(), ctx.orphanNodes.end(), [](auto &a, auto &b){ return a.timestamp < b.timestamp; }); diff --git a/src/apps/web/static/oddbean.css b/src/apps/web/static/oddbean.css index bbfbc54..5e5a944 100644 --- a/src/apps/web/static/oddbean.css +++ b/src/apps/web/static/oddbean.css @@ -62,7 +62,7 @@ h2 { align-items: center; @media only screen and (max-width: 576px){ - .oddbean-name { + .oddbean-name, .about { display: none; } } @@ -86,6 +86,7 @@ h2 { .feedname { margin-left: 3px; + color: #0032f5; } } @@ -114,9 +115,18 @@ h2 { #ob-footer { margin-top: 30px; - padding-top: 20px; - border-top: 1px solid #65cb25; + margin-bottom: 30px; + padding-top: 10px; + border-top: 2px solid #65cb25; text-align: center; + + .footer-links { + font-size: 90%; + } + + > * { + margin-top: 15px; + } } @@ -234,6 +244,20 @@ table.vert { padding-left: 20px; border-left: 1px dotted black; } + + .orphan-separator { + width: 100%; + text-align: center; + border-bottom: 2px dashed #c60000; + line-height: 0.1em; + margin: 10px 0 20px; + + > span { + color: #c60000; + padding: 0 10px; + background: #f6f6ef; + } + } } @@ -311,7 +335,7 @@ table.vert { .feed-description { padding-left: 20px; - border-left: 2px solid blue; + border-left: 2px solid #0032f5; white-space: pre-line; } } diff --git a/src/apps/web/tmpls/events.tmpl b/src/apps/web/tmpls/events.tmpl index 991da80..d39babb 100644 --- a/src/apps/web/tmpls/events.tmpl +++ b/src/apps/web/tmpls/events.tmpl @@ -1,6 +1,10 @@
$(ctx.foundEvents) +
?(ctx.orphanNodes.size() > 0) + orphan notes (missing parents) +
+
@(auto &e : ctx.orphanNodes) $(e.rendered)
diff --git a/src/apps/web/tmpls/main.tmpl b/src/apps/web/tmpls/main.tmpl index e1d0fe3..7443939 100644 --- a/src/apps/web/tmpls/main.tmpl +++ b/src/apps/web/tmpls/main.tmpl @@ -42,6 +42,10 @@