Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

feat(squads): allow multiline descriptions when creating a squad (#11609)

Eric Yum3752f1c4438c
diff --git a/packages/views/modals/create-squad.test.tsx b/packages/views/modals/create-squad.test.tsx
index 239fe12d29..ffcd8ff13f 100644
--- a/packages/views/modals/create-squad.test.tsx
+++ b/packages/views/modals/create-squad.test.tsx
@@ -3,6 +3,7 @@
import type { ReactNode } from "react";
import { describe, it, expect, vi, beforeEach } from "vitest";
import { render, screen, fireEvent, waitFor } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
import { I18nProvider } from "@multica/core/i18n/react";
import type { Agent, MemberWithUser, Squad } from "@multica/core/types";
import enCommon from "../locales/en/common.json";
@@ -304,17 +305,21 @@ describe("CreateSquadModal", () => {
}
});
- it("binds the name and description inputs in the identity row", () => {
+ it("accepts multiline descriptions without submitting on Enter", async () => {
+ const user = userEvent.setup();
renderModal();
const name = screen.getByPlaceholderText(/e\.g\. Frontend Team/i) as HTMLInputElement;
fireEvent.change(name, { target: { value: "Platform Team" } });
expect(name.value).toBe("Platform Team");
- const desc = screen.getByPlaceholderText(/Describe what this squad/i) as HTMLInputElement;
- fireEvent.change(desc, { target: { value: "We own infra" } });
- expect(desc.value).toBe("We own infra");
- // Char counter reflects the typed length.
- expect(screen.getByTestId("char-counter").textContent).toMatch(/^12\//);
+ fireEvent.click(firstMatch("MineAgentOne"));
+ expect(getSubmitButton()).toBeEnabled();
+ const desc = screen.getByPlaceholderText(/Describe what this squad/i);
+ expect(desc).toHaveAttribute("rows", "3");
+ await user.type(desc, "Build{Enter}Ship");
+ expect(desc).toHaveValue("Build\nShip");
+ expect(screen.getByTestId("char-counter").textContent).toMatch(/^10\//);
+ expect(mocks.createSquad).not.toHaveBeenCalled();
});
it("renders the leader picker with 'My Agents' before 'Workspace Agents'", () => {
diff --git a/packages/views/modals/create-squad.tsx b/packages/views/modals/create-squad.tsx
index 20d4e9c3ca..08bf10d7d3 100644
--- a/packages/views/modals/create-squad.tsx
+++ b/packages/views/modals/create-squad.tsx
@@ -28,6 +28,7 @@ import {
} from "@multica/ui/components/ui/popover";
import { Button } from "@multica/ui/components/ui/button";
import { Input } from "@multica/ui/components/ui/input";
+import { Textarea } from "@multica/ui/components/ui/textarea";
import { Label } from "@multica/ui/components/ui/label";
import { TooltipHint } from "@multica/ui/components/common/tooltip-hint";
import { toast } from "sonner";
@@ -196,13 +197,13 @@ export function CreateSquadModal({
<Label className="text-caption text-muted-foreground">
{t(($) => $.create_squad.description_label)}
</Label>
- <Input
- type="text"
+ <Textarea
+ rows={3}
value={description}
onChange={(e) => setDescription(e.target.value)}
placeholder={t(($) => $.create_squad.description_placeholder)}
maxLength={AGENT_DESCRIPTION_MAX_LENGTH}
- className="mt-1"
+ className="mt-1 field-sizing-fixed resize-y"
/>
<div className="mt-1">
<CharCounter