Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
feat(labels): remove agent labels from the product (MUL-5600) (#6245)
Jiayuan Zhang3cab03cc3613
diff --git a/packages/views/agents/components/agent-detail-inspector.labels.test.tsx b/packages/views/agents/components/agent-detail-inspector.labels.test.tsxnew file mode 100644index 0000000000..28ca1dc5b5--- /dev/null+++ b/packages/views/agents/components/agent-detail-inspector.labels.test.tsx@@ -0,0 +1,72 @@+import { afterEach, describe, expect, it, vi } from "vitest";+import { cleanup, screen } from "@testing-library/react";+import type { Agent } from "@multica/core/types";+import { renderWithI18n } from "../../test/i18n";+import { AgentDetailInspector } from "./agent-detail-inspector";++vi.mock("@tanstack/react-query", async (importOriginal) => ({+ ...(await importOriginal<typeof import("@tanstack/react-query")>()),+ useQuery: () => ({ data: undefined, isSuccess: false }),+}));++// The picker is the only way agent labels ever reached the agent settings+// form. Mocking it means the assertion below fails loudly if the row is+// re-added, instead of passing because a real picker rendered nothing.+vi.mock("../../labels/resource-label-picker", () => ({+ ResourceLabelPicker: () => <div data-testid="resource-label-picker" />,+}));++vi.mock("../../common/avatar-upload-control", () => ({+ AvatarUploadControl: () => <div data-testid="avatar-upload" />,+}));++vi.mock("./inspector/model-picker", () => ({+ ModelPicker: () => <div data-testid="model-picker" />,+}));++vi.mock("./inspector/runtime-picker", () => ({+ RuntimePicker: () => <div data-testid="runtime-picker" />,+}));++vi.mock("./inspector/thinking-prop-row", () => ({+ ThinkingSettingField: () => <div data-testid="thinking-field" />,+}));++vi.mock("./inspector/service-tier-setting-field", () => ({+ ServiceTierSettingField: () => <div data-testid="service-tier-field" />,+}));++const agent = {+ id: "agent-1",+ workspace_id: "workspace-1",+ name: "Lambda",+ description: "Test agent",+ runtime_id: "runtime-1",+} as Agent;++describe("AgentDetailInspector labels", () => {+ afterEach(cleanup);++ // Agent labels were removed from the product (MUL-5600). Label Settings no+ // longer manages an agent catalog, so an attach-only picker here would be a+ // dead end pointing at a catalog the user cannot populate.+ it("does not offer a label picker", () => {+ renderWithI18n(+ <AgentDetailInspector+ agent={agent}+ runtime={null}+ runtimes={[]}+ members={[]}+ currentUserId="user-1"+ canEdit+ onUpdate={vi.fn(async () => {})}+ />,+ );++ // Sanity check: the profile card actually rendered.+ expect(screen.getByLabelText("Name")).toBeInTheDocument();++ expect(screen.queryByTestId("resource-label-picker")).toBeNull();+ expect(screen.queryByText("Labels")).toBeNull();+ });+});diff --git a/packages/views/agents/components/agent-detail-inspector.tsx b/packages/views/agents/components/agent-detail-inspector.tsxindex 2d27d9d322..0c9f9d968c 100644--- a/packages/views/agents/components/agent-detail-inspector.tsx+++ b/packages/views/agents/components/agent-detail-inspector.tsx@@ -26,7 +26,6 @@ import {import { useAutoSave } from "../../settings/components/use-auto-save";import { useT } from "../../i18n";import { CharCounter } from "./char-counter";-import { ResourceLabelPicker } from "../../labels/resource-label-picker";import { ModelPicker } from "./inspector/model-picker";import {buildModelChangeUpdate,@@ -228,18 +227,6 @@ export function AgentDetailInspector({/></div></SettingsRow>- <SettingsRow- label={t(($) => $.inspector.labels_label)}- description={t(($) => $.inspector.labels_hint)}- size="text"- align="start"- >- <ResourceLabelPicker- resourceType="agent"- resourceId={agent.id}- canEdit={canEdit}- />- </SettingsRow></SettingsCard></SettingsSection>diff --git a/packages/views/locales/en/agents.json b/packages/views/locales/en/agents.jsonindex a7671ec851..d4620b1b8e 100644--- a/packages/views/locales/en/agents.json+++ b/packages/views/locales/en/agents.json@@ -183,8 +183,6 @@"avatar_hint": "Shown in assignments, activity, and chat.","name_label": "Name","description_label": "Description",- "labels_label": "Labels",- "labels_hint": "Workspace labels used to classify this agent.","change_avatar_aria": "Change avatar","avatar_updated_toast": "Avatar updated","avatar_upload_failed_toast": "Failed to upload avatar",diff --git a/packages/views/locales/en/settings.json b/packages/views/locales/en/settings.jsonindex 345d440efe..c495bbc6c4 100644--- a/packages/views/locales/en/settings.json+++ b/packages/views/locales/en/settings.json@@ -254,10 +254,9 @@},"labels": {"title": "Labels",- "description": "Manage the separate label catalogs used to organize issues, agents, and skills in this workspace.",+ "description": "Manage the separate label catalogs used to organize issues and skills in this workspace.","scopes": {"issue": "Issues",- "agent": "Agents","skill": "Skills"},"search_placeholder": "Filter by name or description...",diff --git a/packages/views/locales/ja/agents.json b/packages/views/locales/ja/agents.jsonindex 2c548600cd..7037310dc6 100644--- a/packages/views/locales/ja/agents.json+++ b/packages/views/locales/ja/agents.json@@ -167,8 +167,6 @@"avatar_hint": "割り当て、アクティビティ、チャットに表示されます。","name_label": "名前","description_label": "説明",- "labels_label": "ラベル",- "labels_hint": "このエージェントを分類するワークスペースラベルです。","change_avatar_aria": "アバターを変更","avatar_updated_toast": "アバターを更新しました","avatar_upload_failed_toast": "アバターをアップロードできませんでした",diff --git a/packages/views/locales/ja/settings.json b/packages/views/locales/ja/settings.jsonindex 77f614b22e..4fe33472c0 100644--- a/packages/views/locales/ja/settings.json+++ b/packages/views/locales/ja/settings.json@@ -253,10 +253,9 @@},"labels": {"title": "ラベル",- "description": "このワークスペースの Issue、エージェント、Skill 用ラベルを個別に管理します。",+ "description": "このワークスペースの Issue、Skill 用ラベルを個別に管理します。","scopes": {"issue": "Issue",- "agent": "エージェント","skill": "Skill"},"search_placeholder": "名前または説明で絞り込み...",diff --git a/packages/views/locales/ko/agents.json b/packages/views/locales/ko/agents.jsonindex e98031d0f6..3e326754d0 100644--- a/packages/views/locales/ko/agents.json+++ b/packages/views/locales/ko/agents.json@@ -175,8 +175,6 @@"avatar_hint": "할당, 활동 및 채팅에 표시됩니다.","name_label": "이름","description_label": "설명",- "labels_label": "레이블",- "labels_hint": "이 에이전트를 분류하는 워크스페이스 레이블입니다.","change_avatar_aria": "아바타 변경","avatar_updated_toast": "아바타를 업데이트했습니다","avatar_upload_failed_toast": "아바타를 업로드하지 못했습니다",diff --git a/packages/views/locales/ko/settings.json b/packages/views/locales/ko/settings.jsonindex 299745b22e..9b9f46ade8 100644--- a/packages/views/locales/ko/settings.json+++ b/packages/views/locales/ko/settings.json@@ -253,10 +253,9 @@},"labels": {"title": "레이블",- "description": "이 워크스페이스의 이슈, 에이전트, 스킬 레이블을 각각 관리합니다.",+ "description": "이 워크스페이스의 이슈, 스킬 레이블을 각각 관리합니다.","scopes": {"issue": "이슈",- "agent": "에이전트","skill": "스킬"},"search_placeholder": "이름 또는 설명으로 필터링...",diff --git a/packages/views/locales/zh-Hans/agents.json b/packages/views/locales/zh-Hans/agents.jsonindex c5691724d7..a96650a6e8 100644--- a/packages/views/locales/zh-Hans/agents.json+++ b/packages/views/locales/zh-Hans/agents.json@@ -175,8 +175,6 @@"avatar_hint": "显示在任务分配、动态和聊天中。","name_label": "名称","description_label": "描述",- "labels_label": "标签",- "labels_hint": "用于分类这个智能体的工作区标签。","change_avatar_aria": "更换头像","avatar_updated_toast": "已更新头像","avatar_upload_failed_toast": "头像上传失败",diff --git a/packages/views/locales/zh-Hans/settings.json b/packages/views/locales/zh-Hans/settings.jsonindex 3985f807cb..d460f5e56b 100644--- a/packages/views/locales/zh-Hans/settings.json+++ b/packages/views/locales/zh-Hans/settings.json@@ -253,10 +253,9 @@},"labels": {"title": "标签",- "description": "分别管理工作区中用于整理 issue、智能体和 skill 的标签。三类标签相互独立。",+ "description": "分别管理工作区中用于整理 issue 和 skill 的标签。两类标签相互独立。","scopes": {"issue": "Issue",- "agent": "智能体","skill": "Skill"},"search_placeholder": "按名称或描述筛选...",diff --git a/packages/views/settings/components/labels-tab.test.tsx b/packages/views/settings/components/labels-tab.test.tsxnew file mode 100644index 0000000000..2ab255d04a--- /dev/null+++ b/packages/views/settings/components/labels-tab.test.tsx@@ -0,0 +1,42 @@+import { afterEach, describe, expect, it, vi } from "vitest";+import { cleanup, screen } from "@testing-library/react";+import { renderWithI18n } from "../../test/i18n";+import { LabelsTab } from "./labels-tab";++vi.mock("@multica/core/hooks", () => ({+ useWorkspaceId: () => "workspace-1",+}));++vi.mock("@tanstack/react-query", () => ({+ useQuery: () => ({ data: [], isLoading: false }),+}));++vi.mock("@multica/core/labels", () => ({+ labelListOptions: (wsId: string, resourceType: string) => ({+ queryKey: ["labels", wsId, "list", resourceType],+ }),+ useCreateLabel: () => ({ mutate: vi.fn(), isPending: false }),+ useUpdateLabel: () => ({ mutate: vi.fn(), isPending: false }),+ useDeleteLabel: () => ({ mutate: vi.fn(), isPending: false }),+}));++describe("LabelsTab scopes", () => {+ afterEach(cleanup);++ // Agent labels were removed from the product (MUL-5600). The backend still+ // models the `agent` resource type, so the guard here is that the settings+ // UI never offers it as a manageable catalog again.+ it("offers only the issue and skill catalogs", () => {+ renderWithI18n(<LabelsTab />);++ expect(screen.getByRole("button", { name: /Issues/ })).toBeInTheDocument();+ expect(screen.getByRole("button", { name: /Skills/ })).toBeInTheDocument();+ expect(screen.queryByRole("button", { name: /Agents/ })).toBeNull();+ });++ it("describes the tab without promising an agent catalog", () => {+ renderWithI18n(<LabelsTab />);++ expect(screen.getByText(/organize issues and skills/i)).toBeInTheDocument();+ });+});diff --git a/packages/views/settings/components/labels-tab.tsx b/packages/views/settings/components/labels-tab.tsxindex 29276283b1..55383901a0 100644--- a/packages/views/settings/components/labels-tab.tsx+++ b/packages/views/settings/components/labels-tab.tsx@@ -45,7 +45,14 @@ import { ColorPicker, COLOR_PICKER_PRESETS } from "../../common/color-picker";import { useT } from "../../i18n";import { SettingsTab } from "./settings-layout";-const RESOURCE_TYPES: LabelResourceType[] = ["issue", "agent", "skill"];+/**+ * Label scopes this settings tab manages. Narrower than `LabelResourceType`:+ * the backend still models agent labels, but the product no longer exposes+ * any way to create, apply, or view them, so they are not manageable here.+ */+type LabelScope = Extract<LabelResourceType, "issue" | "skill">;++const RESOURCE_TYPES: LabelScope[] = ["issue", "skill"];interface LabelDraft {name: string;@@ -63,7 +70,7 @@ export function LabelsTab() {const { t } = useT("settings");const wsId = useWorkspaceId();- const [resourceType, setResourceType] = useState<LabelResourceType>("issue");+ const [resourceType, setResourceType] = useState<LabelScope>("issue");const [query, setQuery] = useState("");const [editing, setEditing] = useState<Label | null>(null);const [createOpen, setCreateOpen] = useState(false);@@ -236,7 +243,7 @@ function LabelEditorDialog({}: {open: boolean;onOpenChange: (open: boolean) => void;- resourceType: LabelResourceType;+ resourceType: LabelScope;label?: Label | null;}) {const { t } = useT("settings");