Skip to content

Commit

Permalink
np
Browse files Browse the repository at this point in the history
  • Loading branch information
hoytech committed Dec 20, 2024
1 parent d71b89f commit d9da6bd
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/apps/web/TODO
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/apps/web/WebData.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; });
Expand Down
32 changes: 28 additions & 4 deletions src/apps/web/static/oddbean.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ h2 {
align-items: center;

@media only screen and (max-width: 576px){
.oddbean-name {
.oddbean-name, .about {
display: none;
}
}
Expand All @@ -86,6 +86,7 @@ h2 {

.feedname {
margin-left: 3px;
color: #0032f5;
}
}

Expand Down Expand Up @@ -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;
}
}


Expand Down Expand Up @@ -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;
}
}
}


Expand Down Expand Up @@ -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;
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/apps/web/tmpls/events.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<div class="event-root">
$(ctx.foundEvents)

<div class="orphan-separator"> ?(ctx.orphanNodes.size() > 0)
<span>orphan notes (missing parents)</span>
</div>

<div class="replies"> @(auto &e : ctx.orphanNodes)
$(e.rendered)
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/apps/web/tmpls/main.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
</div>

<div id="ob-footer">
<div>
<a href="/about">About Oddbean</a>
</div>

<form method="get" action="/search">
Search: <input type="text" name="q" size="17" autocorrect="off" spellcheck="false" autocapitalize="off" autocomplete="false">
</form>
Expand Down

0 comments on commit d9da6bd

Please sign in to comment.