From eb0ee1672c981a3ab165b8d5b42b30b9eabfa8fa Mon Sep 17 00:00:00 2001 From: Duyet Le Date: Fri, 23 Oct 2026 15:32:26 +0700 Subject: [PATCH 1/2] feat(apps): say whether a visibility change waits for review or is listed Co-Authored-By: Claude Opus 5.5 Co-authored-by: Duyet Le Co-authored-by: duyetbot --- src/publish.rs | 16 +++++++++++++++- tests/publish.rs | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/src/publish.rs b/src/publish.rs index 06bf722..9e3961d 100644 --- a/src/publish.rs +++ b/src/publish.rs @@ -127,6 +127,18 @@ fn visibility_arg(v: &str) -> Result<&str, String> { } /// Server message for a failed call, plus the exit code it maps to. +/// What the new visibility means, from the server's `status`. +fn visibility_note(visibility: &str, status: Option<&str>) -> &'static str { + match (visibility, status) { + ("public", Some("pending_review")) => ": pending review before it is listed publicly", + ("public", Some("accepted")) => ": listed publicly", + ("public", Some("rejected")) => ": rejected in review, so it is not listed", + ("unlisted", _) => ": anyone with the link can open it; not listed", + ("private", _) => ": only you can open it", + _ => "", + } +} + fn failure(status: u16, text: &str, what: &str) -> (String, i32) { let v: Value = serde_json::from_str(text).unwrap_or(Value::Null); let msg = v @@ -458,7 +470,9 @@ fn apps_inner(parsed: &ParsedArgs, env: &BTreeMap) -> Result Date: Fri, 23 Oct 2026 16:01:16 +0700 Subject: [PATCH 2/2] docs(apps): keep the failure doc comment on failure Co-Authored-By: Claude Opus 5.5 Co-authored-by: Duyet Le Co-authored-by: duyetbot --- src/publish.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/publish.rs b/src/publish.rs index 9e3961d..564e8d3 100644 --- a/src/publish.rs +++ b/src/publish.rs @@ -126,7 +126,6 @@ fn visibility_arg(v: &str) -> Result<&str, String> { }) } -/// Server message for a failed call, plus the exit code it maps to. /// What the new visibility means, from the server's `status`. fn visibility_note(visibility: &str, status: Option<&str>) -> &'static str { match (visibility, status) { @@ -139,6 +138,7 @@ fn visibility_note(visibility: &str, status: Option<&str>) -> &'static str { } } +/// Server message for a failed call, plus the exit code it maps to. fn failure(status: u16, text: &str, what: &str) -> (String, i32) { let v: Value = serde_json::from_str(text).unwrap_or(Value::Null); let msg = v