hive-forge: surface comment/issue attachments in comments/view/comment-show/issue

This commit is contained in:
damocles 2026-08-11 16:18:44 +02:00 committed by mara
commit 6f3ac755e0
5 changed files with 93 additions and 2 deletions

View file

@ -7,6 +7,7 @@ use forgejo_api::structs::{IssueGetCommentsQuery, StateType};
use crate::client::{Client, index};
use crate::notify;
use crate::verbs::attachment_line;
#[derive(ClapArgs)]
pub struct Args {
@ -47,6 +48,11 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
println!();
println!("{body}");
}
for a in issue.assets.as_deref().unwrap_or_default() {
if let Some(line) = attachment_line(a) {
println!("{line}");
}
}
let (_, comments) = client
.api()
.issue_get_comments(
@ -70,6 +76,11 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
.unwrap_or("?");
let cb = c.body.as_deref().unwrap_or("");
println!("**{cu}**: {cb}");
for a in c.assets.as_deref().unwrap_or_default() {
if let Some(line) = attachment_line(a) {
println!("{line}");
}
}
println!();
}
}