From 0736b704d69dde55c137490cd0acf21126099cc3 Mon Sep 17 00:00:00 2001
From: Codex
Date: Tue, 29 Sep 2026 23:02:47 +0000
Subject: [PATCH] Hide quota-blocked hosted Create and simplify native command
checks
Signed-off-by: Codex
---
desktop/src-tauri/src/builderlab.rs | 22 ++++++------
.../ui/HostedCommunitiesSettingsCard.tsx | 35 ++++++++++---------
...d-communities-settings-screenshots.spec.ts | 21 +++++++++++
3 files changed, 49 insertions(+), 29 deletions(-)
diff --git a/desktop/src-tauri/src/builderlab.rs b/desktop/src-tauri/src/builderlab.rs
index e37ea8e31f..f3eea63eae 100644
--- a/desktop/src-tauri/src/builderlab.rs
+++ b/desktop/src-tauri/src/builderlab.rs
@@ -814,11 +814,10 @@ mod tests {
"acknowledgement_version": 1,
})
);
- for path in ["/v1/buzz/communities/delete"] {
- let url = api_url(path).expect("deletion URL");
- assert_eq!(url.origin().ascii_serialization(), BUILDERLAB_ORIGIN);
- assert_eq!(url.path(), format!("/api/goose{path}"));
- }
+ let path = "/v1/buzz/communities/delete";
+ let url = api_url(path).expect("deletion URL");
+ assert_eq!(url.origin().ascii_serialization(), BUILDERLAB_ORIGIN);
+ assert_eq!(url.path(), format!("/api/goose{path}"));
}
#[test]
@@ -836,13 +835,12 @@ mod tests {
#[test]
fn community_deletion_commands_are_registered_on_the_native_boundary() {
let lib = include_str!("lib.rs");
- for command in ["delete_builderlab_community,"] {
- assert_eq!(
- lib.matches(command).count(),
- 1,
- "{command} must be registered exactly once"
- );
- }
+ let command = "delete_builderlab_community,";
+ assert_eq!(
+ lib.matches(command).count(),
+ 1,
+ "{command} must be registered exactly once"
+ );
assert!(!lib.contains("get_builderlab_community_deletion_receipt"));
let source = include_str!("builderlab.rs");
assert!(source.contains(".header(reqwest::header::ORIGIN, BUILDERLAB_ORIGIN)"));
diff --git a/desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx b/desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx
index 1d5924eb52..9615b66493 100644
--- a/desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx
+++ b/desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx
@@ -1106,23 +1106,24 @@ export function HostedCommunitiesSettingsCard() {
That address is available.
) : null}
-
+ {!atCommunityLimit ? (
+
+ ) : null}
>
)}
diff --git a/desktop/tests/e2e/hosted-communities-settings-screenshots.spec.ts b/desktop/tests/e2e/hosted-communities-settings-screenshots.spec.ts
index 17b8a6e47d..f73f92ad3c 100644
--- a/desktop/tests/e2e/hosted-communities-settings-screenshots.spec.ts
+++ b/desktop/tests/e2e/hosted-communities-settings-screenshots.spec.ts
@@ -193,6 +193,27 @@ test("deletion is default-off and identity mismatch preserves the gate", async (
).toHaveCount(0);
});
+test("explicit quota false hides Create and shows the limit copy", async ({
+ page,
+}) => {
+ await openDeletionFixture(page);
+ await page.evaluate(() => {
+ if (window.__BUZZ_E2E__?.mock)
+ window.__BUZZ_E2E__.mock.builderlabQuota = {
+ used: 5,
+ limit: 5,
+ canCreate: false,
+ };
+ });
+ await page.getByRole("button", { name: "Refresh" }).click();
+ await expect(
+ page.getByText(/reached the limit of 5 hosted communities/),
+ ).toBeVisible();
+ await expect(
+ page.getByRole("button", { name: "Create and connect" }),
+ ).toHaveCount(0);
+});
+
test("archived deletion requires exact host and two confirmations, then removes the row", async ({
page,
}) => {