diff --git a/radicle-cli/examples/rad-inbox.md b/radicle-cli/examples/rad-inbox.md index d48620ff..17c74bf2 100644 --- a/radicle-cli/examples/rad-inbox.md +++ b/radicle-cli/examples/rad-inbox.md @@ -28,17 +28,17 @@ $ rad inbox --sort-by id ``` ~alice $ rad inbox --all --sort-by id +╭──────────────────────────────────────────────────────────╮ +│ radicle-git │ +├──────────────────────────────────────────────────────────┤ +│ 3 ● patch Copyright fixes [ ... ] opened now │ +╰──────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────╮ │ heartwood │ ├──────────────────────────────────────────────────────────────┤ │ 1 ● issue No license file [ .. ] opened now │ │ 2 ● branch Change copyright bob/copy created now │ ╰──────────────────────────────────────────────────────────────╯ -╭──────────────────────────────────────────────────────────╮ -│ radicle-git │ -├──────────────────────────────────────────────────────────┤ -│ 3 ● patch Copyright fixes [ ... ] opened now │ -╰──────────────────────────────────────────────────────────╯ ``` ``` ~alice diff --git a/radicle-cli/src/commands/inbox.rs b/radicle-cli/src/commands/inbox.rs index 08f656cf..e1a2fc6a 100644 --- a/radicle-cli/src/commands/inbox.rs +++ b/radicle-cli/src/commands/inbox.rs @@ -201,12 +201,15 @@ fn list_all<'a>( notifs: ¬ifications::StoreReader, storage: &Storage, ) -> anyhow::Result>> { - let mut repos = Vec::new(); - for repo in storage.repositories()? { - let repo = list_repo(repo.rid, sort_by, notifs, storage)?; - repos.extend(repo.into_iter()); + let mut repos = storage.repositories()?; + repos.sort_by_key(|r| r.rid); + + let mut vstacks = Vec::new(); + for repo in repos { + let vstack = list_repo(repo.rid, sort_by, notifs, storage)?; + vstacks.extend(vstack.into_iter()); } - Ok(repos) + Ok(vstacks) } fn list_repo<'a, R: ReadStorage>(