(null);
const visibilityTouchedRef = React.useRef(false);
@@ -97,7 +94,6 @@ export function useCreateChannelForm({
setTtlSeconds(DEFAULT_EPHEMERAL_TTL_SECONDS);
setErrorMessage(null);
setSelectedTemplateId(null);
- setTypePopoverOpen(false);
visibilityTouchedRef.current = false;
if (!autoFocusName) return;
@@ -211,8 +207,6 @@ export function useCreateChannelForm({
setEphemeral,
ttlSeconds,
setTtlSeconds,
- typePopoverOpen,
- setTypePopoverOpen,
errorMessage,
selectedTemplateId,
handleTemplateChange,
diff --git a/desktop/src/features/sidebar/ui/CreateChannelFormFields.tsx b/desktop/src/features/sidebar/ui/CreateChannelFormFields.tsx
index 01f5af478e5..e3f1c2dd19a 100644
--- a/desktop/src/features/sidebar/ui/CreateChannelFormFields.tsx
+++ b/desktop/src/features/sidebar/ui/CreateChannelFormFields.tsx
@@ -129,13 +129,12 @@ export function CreateChannelFormFields({
-
+
Template
Optional
diff --git a/desktop/src/shared/ui/segmented-control.tsx b/desktop/src/shared/ui/segmented-control.tsx
index 78cd280bae9..b95baaff10a 100644
--- a/desktop/src/shared/ui/segmented-control.tsx
+++ b/desktop/src/shared/ui/segmented-control.tsx
@@ -19,6 +19,7 @@ const SIZE_CLASSES: Record = {
/** A mutually exclusive control with equal-width, optionally scrubbable options. */
export function SegmentedControl({
className,
+ disabled = false,
indicatorTestId,
legend,
onPreviewChange,
@@ -30,6 +31,7 @@ export function SegmentedControl({
value,
}: {
className?: string;
+ disabled?: boolean;
indicatorTestId?: string;
legend: string;
onPreviewChange?: (value: Value | null) => void;
@@ -161,10 +163,12 @@ export function SegmentedControl({
"relative isolate h-8 max-w-full shrink-0 overflow-hidden rounded-md bg-muted/45 p-0.5",
SIZE_CLASSES[size],
onPreviewChange && "touch-none select-none cursor-ew-resize",
+ "disabled:pointer-events-none disabled:opacity-50",
className,
)}
data-slot="segmented-control"
data-testid={testId}
+ disabled={disabled}
onLostPointerCapture={handleLostPointerCapture}
onPointerCancel={handlePointerCancel}
onPointerDown={handlePointerDown}
diff --git a/desktop/tests/e2e/channels.spec.ts b/desktop/tests/e2e/channels.spec.ts
index c05c6cf2358..a42e4fdf5fa 100644
--- a/desktop/tests/e2e/channels.spec.ts
+++ b/desktop/tests/e2e/channels.spec.ts
@@ -1472,10 +1472,9 @@ test("create channel template selector matches the lifecycle controls", async ({
await expect(page.getByTestId("create-channel-description")).toHaveValue(
"Coordinate a new project from planning through launch.",
);
- await expect(page.getByTestId("create-channel-permissions")).toContainText(
- "Private",
- );
- await page.getByTestId("create-channel-permissions").click();
+ await expect(
+ page.getByTestId("create-channel-permissions-option-private"),
+ ).toHaveAttribute("aria-pressed", "true");
await page.getByTestId("create-channel-permissions-option-open").click();
await expect(page.getByTestId("create-channel-template-summary")).toHaveText(
"Open · Canvas included · 1 agent · 1 team",
@@ -1498,6 +1497,12 @@ test("create channel exposes templates when the library is empty", async ({
const templateContainer = page.getByTestId(
"create-channel-template-container",
);
+ await expect(
+ page.getByTestId("create-channel-channel-type").getByRole("button"),
+ ).toHaveText(["Temporary", "Ongoing"]);
+ await expect(
+ page.getByTestId("create-channel-permissions").getByRole("button"),
+ ).toHaveText(["Private", "Public"]);
await expect(templateContainer).toContainText("TemplateOptional");
const typeBox = await typeContainer.boundingBox();
const visibilityBox = await visibilityContainer.boundingBox();
@@ -1539,8 +1544,9 @@ test("create ephemeral stream shows sidebar and header affordances", async ({
await page
.getByTestId("create-channel-description")
.fill("Auto-cleaned test stream");
- await page.getByTestId("create-channel-channel-type").click();
- await page.getByLabel("Temporary channel").click();
+ await page
+ .getByTestId("create-channel-channel-type-option-temporary")
+ .click();
const channelTypeContainer = page.getByTestId(
"create-channel-channel-type-container",
);
@@ -1550,22 +1556,20 @@ test("create ephemeral stream shows sidebar and header affordances", async ({
await expect(
page.getByTestId("create-channel-permissions-container"),
).toBeVisible();
- await expect(page.getByTestId("create-channel-permissions")).toContainText(
- "Public",
- );
- await page.getByTestId("create-channel-permissions").click();
+ await expect(
+ page.getByTestId("create-channel-permissions-option-open"),
+ ).toHaveAttribute("aria-pressed", "true");
await page.getByTestId("create-channel-permissions-option-private").click();
- await expect(page.getByTestId("create-channel-permissions")).toContainText(
- "Private",
- );
await expect(
page.getByTestId("create-channel-permissions-option-private"),
- ).toHaveCount(0);
- await page.getByTestId("create-channel-permissions").click();
+ ).toHaveAttribute("aria-pressed", "true");
await expect(
page.getByTestId("create-channel-permissions-option-open"),
- ).toBeVisible();
+ ).toHaveAttribute("aria-pressed", "false");
await page.getByTestId("create-channel-permissions-option-open").click();
+ await expect(
+ page.getByTestId("create-channel-permissions-option-open"),
+ ).toHaveAttribute("aria-pressed", "true");
await expect(page.getByTestId("create-channel-ttl")).toContainText("7 days");
await page.getByTestId("create-channel-ttl").click();
await page.getByTestId("create-channel-ttl-option-1209600").click();
@@ -1674,8 +1678,9 @@ test("ephemeral countdown refreshes when switching channels after a clock jump",
await page
.getByTestId("create-channel-description")
.fill("Auto-cleaned test stream");
- await page.getByTestId("create-channel-channel-type").click();
- await page.getByLabel("Temporary channel").click();
+ await page
+ .getByTestId("create-channel-channel-type-option-temporary")
+ .click();
await page.getByTestId("create-channel-submit").click();
await expect(page.getByTestId("chat-title")).toContainText(channelName);
}
diff --git a/desktop/tests/e2e/welcome-agent-modal-screenshots.spec.ts b/desktop/tests/e2e/welcome-agent-modal-screenshots.spec.ts
index 0115b608bfa..d15690a8572 100644
--- a/desktop/tests/e2e/welcome-agent-modal-screenshots.spec.ts
+++ b/desktop/tests/e2e/welcome-agent-modal-screenshots.spec.ts
@@ -69,7 +69,6 @@ test.describe("welcome and channel agent entry points", () => {
await page
.getByTestId("create-channel-description")
.fill("A private channel for getting oriented in this workspace.");
- await page.getByTestId("create-channel-permissions").click();
await page.getByTestId("create-channel-permissions-option-private").click();
await page.getByTestId("create-channel-submit").click();
await expect(page.getByTestId("chat-title")).toHaveText("Welcome");
@@ -109,7 +108,6 @@ test.describe("welcome and channel agent entry points", () => {
await page.goto("/", { waitUntil: "domcontentloaded" });
await openCreateChannelDialog(page);
await page.getByTestId("create-channel-name").fill("Welcome");
- await page.getByTestId("create-channel-permissions").click();
await page.getByTestId("create-channel-permissions-option-private").click();
await page.getByTestId("create-channel-submit").click();
await expect(page.getByTestId("chat-title")).toHaveText("Welcome");