From 984494f5561543b1b1474e4e730b0add4ee07112 Mon Sep 17 00:00:00 2001 From: nandithebull Date: Thu, 26 Nov 2026 23:59:10 -0800 Subject: [PATCH] Skip nested channel namespaces in orbit search A repo such as example/greet under main is another channel's package, and its name is not a valid package name, so search no longer lists it under main. Co-Authored-By: Claude Haiku 5.5 --- src/main/ops.mbt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/ops.mbt b/src/main/ops.mbt index e8db354..f51baa0 100644 --- a/src/main/ops.mbt +++ b/src/main/ops.mbt @@ -801,7 +801,9 @@ async fn cmd_search(ctx : Ctx, term : String) -> Unit raise OrbitError { listed = listed + 1 let candidates : Array[String] = [] for r in lines(out) { - if contains_str(r, term) { + // A name with "/" is a nested channel namespace (e.g. example/greet under + // main), not a package name that `orbit install` could use. + if valid_name(r) && contains_str(r, term) { candidates.push(r) } } @@ -879,6 +881,12 @@ test "search info comes from OCI annotations" { assert_eq(bare.description, "") } +///| +test "search skips nested channel namespaces" { + assert_true(valid_name("greet")) + assert_true(!valid_name("example/greet")) +} + ///| test "table columns line up" { assert_eq(pad_right("ab", 4), "ab ")