Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: add replies to patch show output
Fintan Halpenny committed 2 years ago
commit 96c65eb2b39d8adcb80ecc9a0cd3241fca394221
parent 3a2e06e498dd28cd3bf5893e234490e12e739cfb
2 files changed +15 -0
modified radicle-cli/src/terminal/patch.rs
@@ -435,6 +435,16 @@ pub fn show(
    for line in timeline::timeline(profile, patch) {
        widget.push(line);
    }
+

+
    if verbose {
+
        for (id, comment) in revision.replies() {
+
            let hstack = term::comment::header(id, comment, profile);
+

+
            widget = widget.divider();
+
            widget.push(hstack);
+
            widget.push(term::textarea(comment.body()).wrap(60));
+
        }
+
    }
    widget.print();

    Ok(())
modified radicle/src/cob/patch.rs
@@ -1420,6 +1420,11 @@ impl Revision {
        &self.discussion
    }

+
    /// Iterate over all top-level replies.
+
    pub fn replies(&self) -> impl Iterator<Item = (&CommentId, &thread::Comment<CodeLocation>)> {
+
        self.discussion.comments()
+
    }
+

    /// Reviews of this revision's changes (one per actor).
    pub fn reviews(&self) -> impl DoubleEndedIterator<Item = (&PublicKey, &Review)> {
        self.reviews