chore: improve ui consistently (#35)
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run

Reviewed-on: #35
This commit was merged in pull request #35.
This commit is contained in:
2026-11-20 12:28:25 +00:00
parent 51dd5c8630
commit f850f4c4c1
90 changed files with 2859 additions and 2061 deletions
+3
View File
@@ -8,3 +8,6 @@ publish.workspace = true
nostr.workspace = true
serde.workspace = true
utils = { path = "../utils" }
[lints]
workspace = true
+6 -7
View File
@@ -34,8 +34,9 @@ impl<'a> PullRequest<'a> {
};
let mut series = vec![last];
let mut tail = last;
loop {
let Some(prev_id) = series.last().unwrap().tags.event_ids().next() else {
let Some(prev_id) = tail.tags.event_ids().next() else {
break;
};
let Some(prev) = patches
@@ -46,6 +47,7 @@ impl<'a> PullRequest<'a> {
break;
};
series.push(prev);
tail = prev;
}
series.reverse();
series
@@ -86,21 +88,18 @@ impl<'a> PullRequest<'a> {
/// Walks reply links outward from the root patch, taking the newest child first.
fn forward_series(root: &'a Event, patches: &[&'a Event]) -> Vec<&'a Event> {
let mut series = vec![root];
let mut tail = root;
loop {
let next = patches
.iter()
.filter(|patch| !series.contains(patch))
.filter(|patch| {
patch
.tags
.event_ids()
.any(|id| id == series.last().unwrap().id)
})
.filter(|patch| patch.tags.event_ids().any(|id| id == tail.id))
.max_by_key(|patch| patch.created_at);
let Some(next) = next else {
break;
};
series.push(next);
tail = next;
}
series
}