···
println!("No issues found (showing only issues you created)");
println!("RKEY\tTITLE\tREPO");
87
+
// Build cache of repo AT-URIs to formatted names
88
+
let mut repo_cache: std::collections::HashMap<String, String> = std::collections::HashMap::new();
87
-
println!("{}\t{}\t{}", it.rkey, it.issue.title, it.issue.repo);
91
+
let repo_display = if let Some(cached) = repo_cache.get(&it.issue.repo) {
93
+
} else if let Some((repo_did, repo_rkey)) = parse_repo_at_uri(&it.issue.repo) {
94
+
// Fetch and format repo info
95
+
let formatted = match client
96
+
.get_repo_by_rkey(&repo_did, &repo_rkey, Some(session.access_jwt.as_str()))
100
+
let handle = client
101
+
.resolve_did_to_handle(&repo_did, Some(session.access_jwt.as_str()))
103
+
.unwrap_or(repo_did.clone());
104
+
format!("{}/{}", handle, repo.name)
106
+
Err(_) => it.issue.repo.clone(),
108
+
repo_cache.insert(it.issue.repo.clone(), formatted.clone());
111
+
it.issue.repo.clone()
113
+
println!("{}\t{}\t{}", it.rkey, it.issue.title, repo_display);
119
+
fn parse_repo_at_uri(at_uri: &str) -> Option<(String, String)> {
120
+
// Parse at://did/sh.tangled.repo/rkey
121
+
let without_prefix = at_uri.strip_prefix("at://")?;
122
+
let parts: Vec<&str> = without_prefix.split('/').collect();
123
+
if parts.len() >= 3 && parts[1] == "sh.tangled.repo" {
124
+
Some((parts[0].to_string(), parts[2].to_string()))
async fn create(args: IssueCreateArgs) -> Result<()> {