Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
MUL-4820: support custom property icons (#5468)
Jiayuan Zhangea8511340e69
diff --git a/e2e/property-icons.spec.ts b/e2e/property-icons.spec.tsnew file mode 100644index 0000000000..5287fbec22--- /dev/null+++ b/e2e/property-icons.spec.ts@@ -0,0 +1,40 @@+import { expect, test } from "@playwright/test";+import { loginAsDefault, waitForPageText } from "./helpers";++test("creates, persists, and clears a custom property icon", async ({ page }) => {+ const workspaceSlug = await loginAsDefault(page);+ const propertyName = `Icon ${Date.now().toString(36)}`;++ await page.goto(`/${workspaceSlug}/settings?tab=properties`, {+ waitUntil: "domcontentloaded",+ });+ await waitForPageText(page, "Properties");+ await page.getByRole("button", { name: "New property" }).click();+ const createDialog = page.getByRole("dialog", { name: "New property" });+ await expect(createDialog).toBeVisible();++ await createDialog.getByRole("button", { name: "Choose icon" }).click();+ await page.getByRole("button", { name: "Flag", exact: true }).click();+ await createDialog.getByLabel("Name").fill(propertyName);+ await createDialog.getByPlaceholder("Option name").fill("Critical");+ await createDialog.getByRole("button", { name: "Save property" }).click();++ await expect(createDialog).not.toBeVisible();+ const propertyNameCell = page.getByText(propertyName, { exact: true }).locator("..");+ await expect(propertyNameCell).toBeVisible();+ await expect(propertyNameCell.locator('[data-property-icon="flag"]')).toBeVisible();++ await page.getByRole("button", { name: `Actions for ${propertyName}` }).click();+ await page.getByRole("menuitem", { name: "Edit" }).click();+ const editDialog = page.getByRole("dialog", { name: "Edit property" });+ await expect(editDialog).toBeVisible();+ await expect(+ editDialog.locator('[data-property-icon="flag"]'),+ ).toBeVisible();++ await editDialog.getByRole("button", { name: "Choose icon" }).click();+ await page.getByRole("button", { name: "Remove icon" }).click();+ await editDialog.getByRole("button", { name: "Save property" }).click();+ await expect(editDialog).not.toBeVisible();+ await expect(propertyNameCell.locator("[data-property-icon]")).toHaveCount(0);+});diff --git a/packages/core/api/schemas.test.ts b/packages/core/api/schemas.test.tsindex 046ab176ee..66be38cc00 100644--- a/packages/core/api/schemas.test.ts+++ b/packages/core/api/schemas.test.ts@@ -153,6 +153,7 @@ describe("IssuePropertySchema (via ListPropertiesResponseSchema)", () => {name: "Severity",type: "select",description: "",+ icon: "flag",config: { options: [{ id: "opt-1", name: "Critical", color: "#ef4444" }] },position: 1,archived: false,@@ -165,6 +166,7 @@ describe("IssuePropertySchema (via ListPropertiesResponseSchema)", () => {it("parses a full definition", () => {const parsed = ListPropertiesResponseSchema.parse({ properties: [baseProperty], total: 1 });expect(parsed.properties[0]?.config.options?.[0]?.name).toBe("Critical");+ expect(parsed.properties[0]?.icon).toBe("flag");});it("survives a malformed response by defaulting the list", () => {@@ -186,6 +188,12 @@ describe("IssuePropertySchema (via ListPropertiesResponseSchema)", () => {const parsed = ListPropertiesResponseSchema.parse({ properties: [withoutConfig], total: 1 });expect(parsed.properties[0]?.config).toEqual({});});++ it("defaults icon for an older server response", () => {+ const { icon: _omit, ...withoutIcon } = baseProperty;+ const parsed = ListPropertiesResponseSchema.parse({ properties: [withoutIcon], total: 1 });+ expect(parsed.properties[0]?.icon).toBe("");+ });});// POST /api/issues/preview-trigger feeds this schema through parseWithFallbackdiff --git a/packages/core/api/schemas.ts b/packages/core/api/schemas.tsindex 58fe66d9f0..4a8eb135de 100644--- a/packages/core/api/schemas.ts+++ b/packages/core/api/schemas.ts@@ -91,6 +91,7 @@ export const IssuePropertySchema = z.object({name: z.string(),type: z.string(),description: z.string().optional().default(""),+ icon: z.string().optional().default(""),config: z.object({options: z.array(z.object({id: z.string(),@@ -112,6 +113,7 @@ export const EMPTY_ISSUE_PROPERTY: IssueProperty = {name: "",type: "text",description: "",+ icon: "",config: {},position: 0,archived: false,diff --git a/packages/core/types/property.ts b/packages/core/types/property.tsindex 2b45b5a08f..a5aec67bb6 100644--- a/packages/core/types/property.ts+++ b/packages/core/types/property.ts@@ -49,6 +49,8 @@ export interface IssueProperty {/** Lenient string: newer servers may ship types this client doesn't know. */type: string;description?: string;+ /** Optional catalog icon key; absent on backends predating icon support. */+ icon?: string;config: IssuePropertyConfig;position: number;archived: boolean;@@ -65,12 +67,15 @@ export interface CreatePropertyRequest {name: string;type: IssuePropertyType;description?: string;+ icon?: string;config?: IssuePropertyConfig;}export interface UpdatePropertyRequest {name?: string;description?: string;+ /** Empty string clears the icon. */+ icon?: string;config?: IssuePropertyConfig;archived?: boolean;}diff --git a/packages/views/common/prop-row.tsx b/packages/views/common/prop-row.tsxindex c01e31a227..56c2e224a5 100644--- a/packages/views/common/prop-row.tsx+++ b/packages/views/common/prop-row.tsx@@ -33,7 +33,7 @@ export function PropRow({children,interactive = true,}: {- label: string;+ label: ReactNode;children: ReactNode;interactive?: boolean;}) {@@ -43,7 +43,9 @@ export function PropRow({interactive ? "transition-colors hover:bg-accent/50" : ""}`}>- <span className="text-xs text-muted-foreground">{label}</span>+ <span className="flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground">+ {label}+ </span><div className="flex min-w-0 items-center gap-1.5 truncate text-xs">{children}</div>diff --git a/packages/views/common/property-icon.tsx b/packages/views/common/property-icon.tsxnew file mode 100644index 0000000000..34e19c1412--- /dev/null+++ b/packages/views/common/property-icon.tsx@@ -0,0 +1,191 @@+"use client";++import type { IssueProperty } from "@multica/core/types";+import { Button } from "@multica/ui/components/ui/button";+import { cn } from "@multica/ui/lib/utils";+import {+ Bookmark,+ BriefcaseBusiness,+ Bug,+ CalendarDays,+ CircleAlert,+ CircleCheck,+ CircleDot,+ Clock3,+ Code2,+ Database,+ Flag,+ FolderKanban,+ Gauge,+ Globe2,+ Hash,+ Heart,+ Layers3,+ Lightbulb,+ Link,+ ListChecks,+ LockKeyhole,+ MapPin,+ Megaphone,+ Milestone,+ Package,+ Palette,+ Rocket,+ Shapes,+ Shield,+ SignalHigh,+ Sparkles,+ Star,+ Tag,+ Target,+ UserRound,+ Wrench,+ X,+ Zap,+ type LucideIcon,+} from "lucide-react";++interface PropertyIconOption {+ value: string;+ label: string;+ Icon: LucideIcon;+}++/**+ * A deliberately small Lucide catalog that starts with the same symbols used+ * by built-in issue properties. Persist stable keys rather than SVG data or+ * component names so the visual implementation can evolve independently.+ */+export const PROPERTY_ICON_OPTIONS = [+ { value: "circle-dot", label: "Status", Icon: CircleDot },+ { value: "signal-high", label: "Priority", Icon: SignalHigh },+ { value: "user-round", label: "Assignee", Icon: UserRound },+ { value: "folder-kanban", label: "Project", Icon: FolderKanban },+ { value: "calendar-days", label: "Date", Icon: CalendarDays },+ { value: "tag", label: "Label", Icon: Tag },+ { value: "milestone", label: "Milestone", Icon: Milestone },+ { value: "flag", label: "Flag", Icon: Flag },+ { value: "bookmark", label: "Bookmark", Icon: Bookmark },+ { value: "star", label: "Star", Icon: Star },+ { value: "target", label: "Target", Icon: Target },+ { value: "shield", label: "Shield", Icon: Shield },+ { value: "bug", label: "Bug", Icon: Bug },+ { value: "zap", label: "Lightning", Icon: Zap },+ { value: "rocket", label: "Rocket", Icon: Rocket },+ { value: "sparkles", label: "Sparkles", Icon: Sparkles },+ { value: "lightbulb", label: "Idea", Icon: Lightbulb },+ { value: "globe-2", label: "Globe", Icon: Globe2 },+ { value: "link", label: "Link", Icon: Link },+ { value: "hash", label: "Number", Icon: Hash },+ { value: "list-checks", label: "Checklist", Icon: ListChecks },+ { value: "circle-check", label: "Complete", Icon: CircleCheck },+ { value: "clock-3", label: "Time", Icon: Clock3 },+ { value: "briefcase-business", label: "Work", Icon: BriefcaseBusiness },+ { value: "layers-3", label: "Layers", Icon: Layers3 },+ { value: "gauge", label: "Gauge", Icon: Gauge },+ { value: "database", label: "Database", Icon: Database },+ { value: "code-2", label: "Code", Icon: Code2 },+ { value: "palette", label: "Design", Icon: Palette },+ { value: "megaphone", label: "Announcement", Icon: Megaphone },+ { value: "map-pin", label: "Location", Icon: MapPin },+ { value: "package", label: "Package", Icon: Package },+ { value: "wrench", label: "Tools", Icon: Wrench },+ { value: "heart", label: "Favorite", Icon: Heart },+ { value: "circle-alert", label: "Alert", Icon: CircleAlert },+ { value: "lock-keyhole", label: "Private", Icon: LockKeyhole },+] satisfies PropertyIconOption[];++function findPropertyIcon(value: string | undefined) {+ return PROPERTY_ICON_OPTIONS.find((option) => option.value === value);+}++export function PropertyIconGlyph({+ icon,+ className,+}: {+ icon: string;+ className?: string;+}) {+ const Glyph = findPropertyIcon(icon)?.Icon ?? Shapes;++ return (+ <Glyph+ aria-hidden="true"+ data-property-icon={icon}+ className={cn("size-4 shrink-0", className)}+ />+ );+}++export function PropertyIcon({+ property,+ className,+}: {+ property?: Pick<IssueProperty, "icon"> | null;+ className?: string;+}) {+ if (!property?.icon) return null;+ return <PropertyIconGlyph icon={property.icon} className={className} />;+}++export function PropertyIconPicker({+ value,+ label,+ removeLabel,+ onSelect,+ onRemove,+}: {+ value: string;+ label: string;+ removeLabel: string;+ onSelect: (value: string) => void;+ onRemove: () => void;+}) {+ return (+ <div className="w-64">+ <div className="flex items-center justify-between px-1 pb-2">+ <span className="text-xs font-medium text-foreground">{label}</span>+ {value && (+ <span className="truncate pl-3 text-[11px] text-muted-foreground">+ {findPropertyIcon(value)?.label}+ </span>+ )}+ </div>+ <div className="grid grid-cols-6 gap-1" aria-label={label}>+ {PROPERTY_ICON_OPTIONS.map((option) => {+ const selected = option.value === value;+ return (+ <button+ key={option.value}+ type="button"+ aria-label={option.label}+ aria-pressed={selected}+ title={option.label}+ className={cn(+ "flex size-9 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",+ selected && "bg-brand/10 text-brand ring-1 ring-inset ring-brand/25",+ )}+ onClick={() => onSelect(option.value)}+ >+ <option.Icon className="size-4" />+ </button>+ );+ })}+ </div>+ {value && (+ <div className="mt-2 border-t border-surface-border pt-1.5">+ <Button+ type="button"+ variant="ghost"+ size="sm"+ className="w-full justify-start text-muted-foreground"+ onClick={onRemove}+ >+ <X className="size-4" />+ {removeLabel}+ </Button>+ </div>+ )}+ </div>+ );+}diff --git a/packages/views/issues/components/board-card.tsx b/packages/views/issues/components/board-card.tsxindex 45942b7987..f2c2b606b7 100644--- a/packages/views/issues/components/board-card.tsx+++ b/packages/views/issues/components/board-card.tsx@@ -13,6 +13,7 @@ import { CustomPropertyValueDisplay } from "./pickers/custom-property-picker";import { formatDateOnly, isPastDateOnly } from "@multica/core/issues/date";import { CalendarClock, CalendarDays } from "lucide-react";import { ActorAvatar } from "../../common/actor-avatar";+import { PropertyIcon } from "../../common/property-icon";import { useWorkspacePaths } from "@multica/core/paths";import { useActorName } from "@multica/core/workspace/hooks";import { useTimeAgo } from "../../i18n";@@ -216,8 +217,9 @@ export const BoardCardContent = memo(function BoardCardContent({{cardCustomProperties.map((property) => (<spankey={property.id}- className="inline-flex max-w-[160px] items-center rounded-full bg-muted/60 px-1.5 py-0.5 text-[11px] text-muted-foreground"+ className="inline-flex max-w-[160px] items-center gap-1 rounded-full bg-muted/60 px-1.5 py-0.5 text-[11px] text-muted-foreground">+ <PropertyIcon property={property} className="size-3 text-[11px]" /><CustomPropertyValueDisplay property={property} value={issue.properties?.[property.id]} /></span>))}diff --git a/packages/views/issues/components/issue-detail.tsx b/packages/views/issues/components/issue-detail.tsxindex 2b5b3e3775..9348182d14 100644--- a/packages/views/issues/components/issue-detail.tsx+++ b/packages/views/issues/components/issue-detail.tsx@@ -45,6 +45,7 @@ import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, Commandimport { AvatarGroup, AvatarGroupCount } from "@multica/ui/components/ui/avatar";import { ActorAvatar } from "../../common/actor-avatar";import { PropRow } from "../../common/prop-row";+import { PropertyIcon } from "../../common/property-icon";import type { Attachment, Issue, IssueStatus, IssuePriority, TimelineEntry, UpdateIssueRequest } from "@multica/core/types";import { contentReferencesAttachment } from "@multica/core/types";import { STATUS_CONFIG, PRIORITY_CONFIG } from "@multica/core/issues/config";@@ -1629,7 +1630,15 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr(!p.archived && visibleCustomProps.has(p.id)),).map((p) => (- <PropRow key={p.id} label={p.name}>+ <PropRow+ key={p.id}+ label={+ <>+ <PropertyIcon property={p} className="size-3.5 text-xs" />+ <span className="truncate">{p.name}</span>+ </>+ }+ ><CustomPropertyValueEditorissue={issue}property={p}@@ -1706,7 +1715,11 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tronClick={() => addCustomProp(p.id)}className="flex w-full items-center gap-2 rounded-md px-2 py-1 text-xs text-foreground/90 transition-colors hover:bg-accent focus-visible:bg-accent focus-visible:outline-none">- <SlidersHorizontal className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />+ {p.icon ? (+ <PropertyIcon property={p} className="size-3.5 text-xs" />+ ) : (+ <SlidersHorizontal className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />+ )}<span className="truncate">{p.name}</span></button>))}diff --git a/packages/views/issues/components/issues-header.tsx b/packages/views/issues/components/issues-header.tsxindex fbdd0c76eb..79a4498520 100644--- a/packages/views/issues/components/issues-header.tsx+++ b/packages/views/issues/components/issues-header.tsx@@ -61,6 +61,7 @@ import { propertyIdFromViewKey } from "@multica/core/issues/stores/view-store";import type { IssueProperty } from "@multica/core/types";import { ProjectIcon } from "../../projects/components/project-icon";import { ActorAvatar } from "../../common/actor-avatar";+import { PropertyIcon } from "../../common/property-icon";import { LabelChip } from "../../labels/label-chip";import {SORT_OPTIONS,@@ -1233,7 +1234,11 @@ export function IssueDisplayControls({return (<DropdownMenuSub key={property.id}><DropdownMenuSubTrigger>- <SlidersHorizontal className="size-3.5" />+ {property.icon ? (+ <PropertyIcon property={property} className="size-3.5 text-xs" />+ ) : (+ <SlidersHorizontal className="size-3.5" />+ )}<span className="flex-1 truncate">{property.name}</span>{selected.length > 0 && (<span className="text-xs text-primary font-medium">@@ -1322,7 +1327,8 @@ export function IssueDisplayControls({))}{groupableProperties.map((property) => (<DropdownMenuRadioItem key={property.id} value={`property:${property.id}`}>- {property.name}+ <PropertyIcon property={property} className="size-3.5 text-xs" />+ <span>{property.name}</span></DropdownMenuRadioItem>))}</DropdownMenuRadioGroup>@@ -1394,7 +1400,8 @@ export function IssueDisplayControls({))}{sortableProperties.map((property) => (<DropdownMenuRadioItem key={property.id} value={`property:${property.id}`}>- {property.name}+ <PropertyIcon property={property} className="size-3.5 text-xs" />+ <span>{property.name}</span></DropdownMenuRadioItem>))}</DropdownMenuRadioGroup>@@ -1451,7 +1458,10 @@ export function IssueDisplayControls({key={property.id}className="flex cursor-pointer items-center justify-between">- <span className="truncate text-sm">{property.name}</span>+ <span className="flex min-w-0 items-center gap-1.5 truncate text-sm">+ <PropertyIcon property={property} className="size-3.5 text-xs" />+ <span className="truncate">{property.name}</span>+ </span><Switchsize="sm"checked={cardPropertyIds.includes(property.id)}diff --git a/packages/views/issues/components/list-row.tsx b/packages/views/issues/components/list-row.tsxindex 293b98226c..1b883194ee 100644--- a/packages/views/issues/components/list-row.tsx+++ b/packages/views/issues/components/list-row.tsx@@ -10,6 +10,7 @@ import type { Issue, Project,} from "@multica/core/types";import { formatDateOnly } from "@multica/core/issues/date";import { ActorAvatar } from "../../common/actor-avatar";+import { PropertyIcon } from "../../common/property-icon";import { useWorkspacePaths } from "@multica/core/paths";import { useQuery } from "@tanstack/react-query";import { useViewStore } from "@multica/core/issues/stores/view-store-context";@@ -137,8 +138,9 @@ function ListRowContent({{cardCustomProperties.slice(0, 3).map((property) => (<spankey={property.id}- className="inline-flex max-w-[120px] items-center rounded-full bg-muted/60 px-1.5 py-0.5 text-[11px] text-muted-foreground"+ className="inline-flex max-w-[120px] items-center gap-1 rounded-full bg-muted/60 px-1.5 py-0.5 text-[11px] text-muted-foreground">+ <PropertyIcon property={property} className="size-3 text-[11px]" /><CustomPropertyValueDisplay property={property} value={issue.properties?.[property.id]} /></span>))}diff --git a/packages/views/locales/en/settings.json b/packages/views/locales/en/settings.jsonindex 69b5082be0..48517731b0 100644--- a/packages/views/locales/en/settings.json+++ b/packages/views/locales/en/settings.json@@ -161,6 +161,9 @@"create_title": "New property","edit_title": "Edit property","admin_hint": "Only workspace owners and admins can manage property definitions.",+ "icon": "Icon",+ "choose_icon": "Choose icon",+ "remove_icon": "Remove icon","name": "Name","name_placeholder": "e.g. Severity","type": "Type",diff --git a/packages/views/locales/ja/settings.json b/packages/views/locales/ja/settings.jsonindex 59ccffa469..80e0644337 100644--- a/packages/views/locales/ja/settings.json+++ b/packages/views/locales/ja/settings.json@@ -157,6 +157,9 @@"create_title": "新規プロパティ","edit_title": "プロパティを編集","admin_hint": "プロパティ定義を管理できるのはワークスペースのオーナーと管理者のみです。",+ "icon": "アイコン",+ "choose_icon": "アイコンを選択",+ "remove_icon": "アイコンを削除","name": "名前","name_placeholder": "例: Severity","type": "タイプ",diff --git a/packages/views/locales/ko/settings.json b/packages/views/locales/ko/settings.jsonindex df4187a20b..2ee8038f50 100644--- a/packages/views/locales/ko/settings.json+++ b/packages/views/locales/ko/settings.json@@ -157,6 +157,9 @@"create_title": "새 속성","edit_title": "속성 편집","admin_hint": "워크스페이스 소유자와 관리자만 속성 정의를 관리할 수 있습니다.",+ "icon": "아이콘",+ "choose_icon": "아이콘 선택",+ "remove_icon": "아이콘 제거","name": "이름","name_placeholder": "예: Severity","type": "유형",diff --git a/packages/views/locales/zh-Hans/settings.json b/packages/views/locales/zh-Hans/settings.jsonindex 89092c213b..7259723ce2 100644--- a/packages/views/locales/zh-Hans/settings.json+++ b/packages/views/locales/zh-Hans/settings.json@@ -160,6 +160,9 @@"create_title": "新建属性","edit_title": "编辑属性","admin_hint": "仅工作区 Owner 和 Admin 可以管理属性定义。",+ "icon": "图标",+ "choose_icon": "选择图标",+ "remove_icon": "移除图标","name": "名称","name_placeholder": "例如 Severity","type": "类型",diff --git a/packages/views/settings/components/properties-tab.tsx b/packages/views/settings/components/properties-tab.tsxindex 0f5fa77085..c59dbe6446 100644--- a/packages/views/settings/components/properties-tab.tsx+++ b/packages/views/settings/components/properties-tab.tsx@@ -65,7 +65,17 @@ import {DropdownMenuItem,DropdownMenuTrigger,} from "@multica/ui/components/ui/dropdown-menu";+import {+ Popover,+ PopoverContent,+ PopoverTrigger,+} from "@multica/ui/components/ui/popover";import { ColorPicker, COLOR_PICKER_PRESETS } from "../../common/color-picker";+import {+ PropertyIcon,+ PropertyIconGlyph,+ PropertyIconPicker,+} from "../../common/property-icon";import { useT } from "../../i18n";import { SettingsTab } from "./settings-layout";@@ -81,6 +91,7 @@ interface PropertyDraft {name: string;type: IssuePropertyType;description: string;+ icon: string;options: OptionDraft[];}@@ -88,6 +99,7 @@ const EMPTY_DRAFT: PropertyDraft = {name: "",type: "select",description: "",+ icon: "",options: [{ name: "", color: COLOR_PICKER_PRESETS[6] }],};@@ -206,6 +218,7 @@ export function PropertiesTab() {className="grid gap-2 px-4 py-3 md:grid-cols-[minmax(10rem,1fr)_6rem_minmax(10rem,1.4fr)_6rem_7rem_2rem] md:items-center md:gap-4"><div className="flex min-w-0 items-center gap-2">+ <PropertyIcon property={property} /><span className="truncate text-sm font-medium">{property.name}</span>{property.archived && (<Badge variant="outline" className="shrink-0 text-[10px]">@@ -352,15 +365,18 @@ function PropertyEditorDialog({const create = useCreateProperty();const update = useUpdateProperty();const [draft, setDraft] = useState<PropertyDraft>(EMPTY_DRAFT);+ const [iconPickerOpen, setIconPickerOpen] = useState(false);useEffect(() => {if (!open) return;+ setIconPickerOpen(false);setDraft(property? {name: property.name,type: (property.type as IssuePropertyType) ?? "text",description: property.description ?? "",+ icon: property.icon ?? "",options: (property.config.options ?? []).map((option: IssuePropertyOption) => ({id: option.id,name: option.name,@@ -401,6 +417,7 @@ function PropertyEditorDialog({id: property.id,name: draft.name.trim(),description: draft.description.trim(),+ icon: draft.icon,...(config ? { config } : {}),},{ onSuccess: () => onOpenChange(false), onError },@@ -412,6 +429,7 @@ function PropertyEditorDialog({name: draft.name.trim(),type: draft.type,description: draft.description.trim(),+ icon: draft.icon,...(config ? { config } : {}),},{ onSuccess: () => onOpenChange(false), onError },@@ -441,7 +459,43 @@ function PropertyEditorDialog({</DialogDescription></DialogHeader><div className="space-y-5 py-2">- <div className="grid grid-cols-[1fr_10rem] gap-3">+ <div className="grid grid-cols-[4.25rem_minmax(0,1fr)_10rem] gap-3">+ <div className="space-y-2">+ <FieldLabel>{t(($) => $.properties.editor.icon)}</FieldLabel>+ <Popover open={iconPickerOpen} onOpenChange={setIconPickerOpen}>+ <PopoverTrigger+ render={+ <Button+ type="button"+ variant="outline"+ className="w-full px-0 text-lg"+ aria-label={t(($) => $.properties.editor.choose_icon)}+ >+ {draft.icon ? (+ <PropertyIconGlyph icon={draft.icon} />+ ) : (+ <SlidersHorizontal className="size-4 text-muted-foreground" />+ )}+ </Button>+ }+ />+ <PopoverContent align="start" className="w-auto p-2">+ <PropertyIconPicker+ value={draft.icon}+ label={t(($) => $.properties.editor.choose_icon)}+ removeLabel={t(($) => $.properties.editor.remove_icon)}+ onSelect={(icon) => {+ setDraft((current) => ({ ...current, icon }));+ setIconPickerOpen(false);+ }}+ onRemove={() => {+ setDraft((current) => ({ ...current, icon: "" }));+ setIconPickerOpen(false);+ }}+ />+ </PopoverContent>+ </Popover>+ </div><div className="space-y-2"><FieldLabel htmlFor="property-name">{t(($) => $.properties.editor.name)}diff --git a/server/cmd/multica/cmd_property.go b/server/cmd/multica/cmd_property.goindex e39444c7f3..7cd5759b9d 100644--- a/server/cmd/multica/cmd_property.go+++ b/server/cmd/multica/cmd_property.go@@ -35,6 +35,7 @@ type propertyDTO struct {Name string `json:"name"`Type string `json:"type"`Description string `json:"description"`+ Icon string `json:"icon"`Config struct {Options []propertyOptionDTO `json:"options"`} `json:"config"`@@ -148,10 +149,12 @@ func init() {propertyCreateCmd.Flags().String("name", "", "Property name (required)")propertyCreateCmd.Flags().String("type", "", "Property type: text, number, select, multi_select, date, checkbox, url (required)")propertyCreateCmd.Flags().String("description", "", "Property description")+ propertyCreateCmd.Flags().String("icon", "", "Property icon key from the Web picker (for example, flag, tag, or shield)")propertyCreateCmd.Flags().StringArray("option", nil, `Select option as "Name" or "Name:#rrggbb" (repeatable; select types only)`)propertyUpdateCmd.Flags().String("output", "table", "Output format: table or json")propertyUpdateCmd.Flags().String("name", "", "New property name")propertyUpdateCmd.Flags().String("description", "", "New property description")+ propertyUpdateCmd.Flags().String("icon", "", "New property icon key from the Web picker; pass an empty value to clear")propertyUpdateCmd.Flags().StringArray("option", nil, `Replacement option list as "Name" or "Name:#rrggbb" (repeatable)`)propertyArchiveCmd.Flags().String("output", "table", "Output format: table or json")propertyUnarchiveCmd.Flags().String("output", "table", "Output format: table or json")@@ -233,7 +236,7 @@ func parseOptionFlags(flags []string, existing []propertyOptionDTO) []map[string}func printPropertyTable(properties []propertyDTO) {- headers := []string{"ID", "NAME", "TYPE", "OPTIONS", "USED", "ARCHIVED"}+ headers := []string{"ID", "ICON", "NAME", "TYPE", "OPTIONS", "USED", "ARCHIVED"}rows := make([][]string, 0, len(properties))for _, p := range properties {names := make([]string, len(p.Config.Options))@@ -244,7 +247,7 @@ func printPropertyTable(properties []propertyDTO) {if p.Archived {archived = "yes"}- rows = append(rows, []string{p.ID, p.Name, p.Type, strings.Join(names, ", "), strconv.FormatInt(p.UsageCount, 10), archived})+ rows = append(rows, []string{p.ID, p.Icon, p.Name, p.Type, strings.Join(names, ", "), strconv.FormatInt(p.UsageCount, 10), archived})}cli.PrintTable(os.Stdout, headers, rows)}@@ -310,9 +313,10 @@ func runPropertyCreate(cmd *cobra.Command, _ []string) error {return fmt.Errorf("--type is required")}description, _ := cmd.Flags().GetString("description")+ icon, _ := cmd.Flags().GetString("icon")optionFlags, _ := cmd.Flags().GetStringArray("option")- body := map[string]any{"name": name, "type": propType, "description": description}+ body := map[string]any{"name": name, "type": propType, "description": description, "icon": icon}if len(optionFlags) > 0 {body["config"] = map[string]any{"options": parseOptionFlags(optionFlags, nil)}}@@ -363,12 +367,16 @@ func runPropertyUpdate(cmd *cobra.Command, args []string) error {description, _ := cmd.Flags().GetString("description")body["description"] = description}+ if cmd.Flags().Changed("icon") {+ icon, _ := cmd.Flags().GetString("icon")+ body["icon"] = icon+ }if cmd.Flags().Changed("option") {optionFlags, _ := cmd.Flags().GetStringArray("option")body["config"] = map[string]any{"options": parseOptionFlags(optionFlags, property.Config.Options)}}if len(body) == 0 {- return fmt.Errorf("nothing to update; pass --name, --description, or --option")+ return fmt.Errorf("nothing to update; pass --name, --description, --icon, or --option")}var updated propertyDTOdiff --git a/server/internal/handler/property.go b/server/internal/handler/property.goindex 42d985030e..c1240a8f65 100644--- a/server/internal/handler/property.go+++ b/server/internal/handler/property.go@@ -40,6 +40,7 @@ const (maxActivePropertiesPerWorkspace = 20maxPropertySelectOptions = 50maxPropertyNameLen = 32+ maxPropertyIconLen = 32maxPropertyDescriptionLen = 500maxPropertyTextValueLen = 2000maxPropertyURLValueLen = 2048@@ -47,6 +48,20 @@ const (var validPropertyTypes = []string{"text", "number", "select", "multi_select", "date", "checkbox", "url"}+// Property icons use stable catalog keys that the Web client maps to Lucide+// glyphs. Keeping this allowlist at the API boundary prevents arbitrary text+// (including emoji) from leaking into every issue surface that renders icons.+var validPropertyIcons = map[string]struct{}{+ "circle-dot": {}, "signal-high": {}, "user-round": {}, "folder-kanban": {},+ "calendar-days": {}, "tag": {}, "milestone": {}, "flag": {}, "bookmark": {},+ "star": {}, "target": {}, "shield": {}, "bug": {}, "zap": {}, "rocket": {},+ "sparkles": {}, "lightbulb": {}, "globe-2": {}, "link": {}, "hash": {},+ "list-checks": {}, "circle-check": {}, "clock-3": {}, "briefcase-business": {},+ "layers-3": {}, "gauge": {}, "database": {}, "code-2": {}, "palette": {},+ "megaphone": {}, "map-pin": {}, "package": {}, "wrench": {}, "heart": {},+ "circle-alert": {}, "lock-keyhole": {},+}+// errClientRejected marks lock-closure failures already translated to an// HTTP status by the caller-side fail() capture.var errClientRejected = errors.New("client rejected")@@ -82,6 +97,7 @@ type PropertyResponse struct {Name string `json:"name"`Type string `json:"type"`Description string `json:"description"`+ Icon string `json:"icon"`Config PropertyConfig `json:"config"`Position float64 `json:"position"`Archived bool `json:"archived"`@@ -109,6 +125,7 @@ func propertyToResponse(p db.IssueProperty, usageCount int64) PropertyResponse {Name: p.Name,Type: p.Type,Description: p.Description,+ Icon: p.Icon,Config: parsePropertyConfig(p.Config),Position: p.Position,Archived: p.ArchivedAt.Valid,@@ -130,6 +147,7 @@ func propertyListRowToResponse(row db.ListIssuePropertiesRow) PropertyResponse {Name: row.Name,Type: row.Type,Description: row.Description,+ Icon: row.Icon,Config: row.Config,Position: row.Position,ArchivedAt: row.ArchivedAt,@@ -142,12 +160,14 @@ type CreatePropertyRequest struct {Name string `json:"name"`Type string `json:"type"`Description string `json:"description"`+ Icon string `json:"icon"`Config *PropertyConfig `json:"config"`}type UpdatePropertyRequest struct {Name *string `json:"name"`Description *string `json:"description"`+ Icon *string `json:"icon"`Config *PropertyConfig `json:"config"`Archived *bool `json:"archived"`}@@ -179,6 +199,25 @@ func validatePropertyName(raw string) (string, error) {return name, nil}+func validatePropertyIcon(raw string) (string, error) {+ for _, r := range raw {+ if unicode.IsControl(r) {+ return "", errors.New("icon cannot contain tabs, newlines, or control characters")+ }+ }+ icon := strings.TrimSpace(raw)+ if utf8.RuneCountInString(icon) > maxPropertyIconLen {+ return "", fmt.Errorf("icon must be %d characters or fewer", maxPropertyIconLen)+ }+ if icon == "" {+ return "", nil+ }+ if _, ok := validPropertyIcons[icon]; !ok {+ return "", errors.New("icon must be a supported icon key")+ }+ return icon, nil+}+func validatePropertyType(t string) error {for _, v := range validPropertyTypes {if t == v {@@ -499,6 +538,11 @@ func (h *Handler) CreateProperty(w http.ResponseWriter, r *http.Request) {writeError(w, http.StatusBadRequest, fmt.Sprintf("description must be %d characters or fewer", maxPropertyDescriptionLen))return}+ icon, err := validatePropertyIcon(req.Icon)+ if err != nil {+ writeError(w, http.StatusBadRequest, err.Error())+ return+ }configJSON, err := validatePropertyConfig(req.Type, req.Config)if err != nil {writeError(w, http.StatusBadRequest, err.Error())@@ -525,6 +569,7 @@ func (h *Handler) CreateProperty(w http.ResponseWriter, r *http.Request) {Name: name,Type: req.Type,Description: sanitizeNullBytes(strings.TrimSpace(req.Description)),+ Icon: icon,Config: configJSON,})return err@@ -602,6 +647,13 @@ func (h *Handler) UpdateProperty(w http.ResponseWriter, r *http.Request) {}params.Description = pgtype.Text{String: sanitizeNullBytes(strings.TrimSpace(*req.Description)), Valid: true}}+ if req.Icon != nil {+ icon, err := validatePropertyIcon(*req.Icon)+ if err != nil {+ return fail(http.StatusBadRequest, err.Error())+ }+ params.Icon = pgtype.Text{String: icon, Valid: true}+ }if req.Config != nil {configJSON, err := validatePropertyConfig(existing.Type, req.Config)if err != nil {diff --git a/server/internal/handler/property_test.go b/server/internal/handler/property_test.goindex 907867f9f0..3d4efeba87 100644--- a/server/internal/handler/property_test.go+++ b/server/internal/handler/property_test.go@@ -86,12 +86,13 @@ func TestPropertyDefinitionCRUD(t *testing.T) {"name": "Severity","type": "select","description": "How bad it is",+ "icon": "flag","config": map[string]any{"options": []map[string]any{{"name": "Critical", "color": "EF4444"},{"name": "Minor", "color": "#6b7280"},}},})- if created.Type != "select" || len(created.Config.Options) != 2 {+ if created.Type != "select" || created.Icon != "flag" || len(created.Config.Options) != 2 {t.Fatalf("unexpected created property: %+v", created)}// Server assigns option ids and normalizes colors to lowercase #rrggbb.@@ -118,6 +119,7 @@ func TestPropertyDefinitionCRUD(t *testing.T) {w = httptest.NewRecorder()req = newRequest("PATCH", "/api/properties/"+created.ID, map[string]any{"name": "Sev",+ "icon": "shield","config": map[string]any{"options": []map[string]any{{"id": keepID, "name": "Blocker", "color": "#ef4444"},{"name": "Trivial", "color": "#a1a1aa"},@@ -130,10 +132,23 @@ func TestPropertyDefinitionCRUD(t *testing.T) {}var updated PropertyResponsejson.NewDecoder(w.Body).Decode(&updated)- if updated.Name != "Sev" || updated.Config.Options[0].ID != keepID || updated.Config.Options[0].Name != "Blocker" {+ if updated.Name != "Sev" || updated.Icon != "shield" || updated.Config.Options[0].ID != keepID || updated.Config.Options[0].Name != "Blocker" {t.Fatalf("option id not preserved on update: %+v", updated.Config.Options)}+ // Empty string clears the optional icon without changing the definition.+ w = httptest.NewRecorder()+ req = newRequest("PATCH", "/api/properties/"+created.ID, map[string]any{"icon": ""})+ req = withURLParam(req, "id", created.ID)+ testHandler.UpdateProperty(w, req)+ if w.Code != http.StatusOK {+ t.Fatalf("clear icon: expected 200, got %d: %s", w.Code, w.Body.String())+ }+ json.NewDecoder(w.Body).Decode(&updated)+ if updated.Icon != "" {+ t.Fatalf("icon not cleared: %q", updated.Icon)+ }+// Archive → default list hides it, include_archived shows it.w = httptest.NewRecorder()req = newRequest("PATCH", "/api/properties/"+created.ID, map[string]any{"archived": true})@@ -179,6 +194,10 @@ func TestPropertyDefinitionValidation(t *testing.T) {}{{"reserved name", map[string]any{"name": "Due Date", "type": "text"}, "reserved"},{"invalid type", map[string]any{"name": "X" + uuid.NewString()[:8], "type": "formula"}, "invalid type"},+ {"icon too long", map[string]any{"name": "X" + uuid.NewString()[:8], "type": "text", "icon": strings.Repeat("x", maxPropertyIconLen+1)}, "icon must be"},+ {"icon control character", map[string]any{"name": "X" + uuid.NewString()[:8], "type": "text", "icon": "\t"}, "icon cannot contain"},+ {"emoji icon", map[string]any{"name": "X" + uuid.NewString()[:8], "type": "text", "icon": "🚨"}, "supported icon key"},+ {"unknown icon", map[string]any{"name": "X" + uuid.NewString()[:8], "type": "text", "icon": "not-an-icon"}, "supported icon key"},{"options on text", map[string]any{"name": "X" + uuid.NewString()[:8], "type": "text","config": map[string]any{"options": []map[string]any{{"name": "a", "color": "#000000"}}}}, "does not accept options"},{"select without options", map[string]any{"name": "X" + uuid.NewString()[:8], "type": "select"}, "at least one option"},diff --git a/server/internal/service/builtin_skills/multica-working-on-issues/SKILL.md b/server/internal/service/builtin_skills/multica-working-on-issues/SKILL.mdindex 50155efb7f..f7241e5771 100644--- a/server/internal/service/builtin_skills/multica-working-on-issues/SKILL.md+++ b/server/internal/service/builtin_skills/multica-working-on-issues/SKILL.md@@ -164,6 +164,8 @@ multica issue property unset <issue-id> --name Environment```- A validation error lists the legal options — fix the value and retry.+- Definitions may include an optional catalog icon for visual identification;+ it does not change the property's type or value validation.- Agents cannot create or edit property definitions (owner/admin humans only).If a needed property does not exist, propose it in a comment instead.- Property vs metadata: if the value is workflow state a human should see anddiff --git a/server/internal/service/builtin_skills/multica-working-on-issues/references/working-on-issues-source-map.md b/server/internal/service/builtin_skills/multica-working-on-issues/references/working-on-issues-source-map.mdindex ef45b98720..4b862f9acd 100644--- a/server/internal/service/builtin_skills/multica-working-on-issues/references/working-on-issues-source-map.md+++ b/server/internal/service/builtin_skills/multica-working-on-issues/references/working-on-issues-source-map.md@@ -166,6 +166,7 @@ wakes the parent assignee. Promoting the next stage's `backlog` sub-issues to| `multica property list/get/create/update/archive/unarchive` | `server/cmd/multica/cmd_property.go` || `multica issue property list/set/unset` (name→id translation) | `server/cmd/multica/cmd_property.go` (`encodeIssuePropertyValue`) || Definition CRUD, admin gate, agent-actor rejection | `server/internal/handler/property.go` (`requirePropertyAdmin`) |+| Optional catalog icon field and allowlist validation | `server/internal/handler/property.go` (`PropertyResponse`, `validatePropertyIcon`) || Per-type value validation (self-correcting errors) | `server/internal/handler/property.go` (`validatePropertyValue`) || API routes (`/api/properties`, PUT/DELETE `/api/issues/{id}/properties/{propertyId}`) | `server/cmd/server/router.go` |diff --git a/server/migrations/196_issue_property_icon.down.sql b/server/migrations/196_issue_property_icon.down.sqlnew file mode 100644index 0000000000..93b9e42362--- /dev/null+++ b/server/migrations/196_issue_property_icon.down.sql@@ -0,0 +1,2 @@+ALTER TABLE issue_property+ DROP COLUMN icon;diff --git a/server/migrations/196_issue_property_icon.up.sql b/server/migrations/196_issue_property_icon.up.sqlnew file mode 100644index 0000000000..8619d9551e--- /dev/null+++ b/server/migrations/196_issue_property_icon.up.sql@@ -0,0 +1,6 @@+-- Optional catalog icon key for workspace custom property definitions. The empty+-- string represents no icon so existing rows and older clients keep their+-- current appearance. PostgreSQL can add this constant default without a+-- table rewrite.+ALTER TABLE issue_property+ ADD COLUMN icon TEXT NOT NULL DEFAULT '';diff --git a/server/pkg/db/generated/issue_property.sql.go b/server/pkg/db/generated/issue_property.sql.goindex 2a20d8c55c..3dac7fb859 100644--- a/server/pkg/db/generated/issue_property.sql.go+++ b/server/pkg/db/generated/issue_property.sql.go@@ -68,14 +68,15 @@ func (q *Queries) CountIssuesUsingPropertyOptions(ctx context.Context, arg Count}const createIssueProperty = `-- name: CreateIssueProperty :one-INSERT INTO issue_property (workspace_id, name, type, description, config, position)+INSERT INTO issue_property (workspace_id, name, type, description, icon, config, position)SELECT $1::uuid,$2::text,$3::text,$4::text,- $5::jsonb,+ $5::text,+ $6::jsonb,COALESCE((SELECT MAX(position) FROM issue_property WHERE workspace_id = $1::uuid), 0) + 1-RETURNING id, workspace_id, name, type, description, config, position, archived_at, created_at, updated_at+RETURNING id, workspace_id, name, type, description, config, position, archived_at, created_at, updated_at, icon`type CreateIssuePropertyParams struct {@@ -83,6 +84,7 @@ type CreateIssuePropertyParams struct {Name string `json:"name"`Type string `json:"type"`Description string `json:"description"`+ Icon string `json:"icon"`Config []byte `json:"config"`}@@ -93,6 +95,7 @@ func (q *Queries) CreateIssueProperty(ctx context.Context, arg CreateIssueProperarg.Name,arg.Type,arg.Description,+ arg.Icon,arg.Config,)var i IssueProperty@@ -107,6 +110,7 @@ func (q *Queries) CreateIssueProperty(ctx context.Context, arg CreateIssueProper&i.ArchivedAt,&i.CreatedAt,&i.UpdatedAt,+ &i.Icon,)return i, err}@@ -160,7 +164,7 @@ func (q *Queries) DeleteIssuePropertyValue(ctx context.Context, arg DeleteIssueP}const getIssueProperty = `-- name: GetIssueProperty :one-SELECT id, workspace_id, name, type, description, config, position, archived_at, created_at, updated_at FROM issue_property+SELECT id, workspace_id, name, type, description, config, position, archived_at, created_at, updated_at, icon FROM issue_propertyWHERE id = $1 AND workspace_id = $2`@@ -183,12 +187,13 @@ func (q *Queries) GetIssueProperty(ctx context.Context, arg GetIssuePropertyPara&i.ArchivedAt,&i.CreatedAt,&i.UpdatedAt,+ &i.Icon,)return i, err}const listIssueProperties = `-- name: ListIssueProperties :many-SELECT p.id, p.workspace_id, p.name, p.type, p.description, p.config, p.position, p.archived_at, p.created_at, p.updated_at,+SELECT p.id, p.workspace_id, p.name, p.type, p.description, p.config, p.position, p.archived_at, p.created_at, p.updated_at, p.icon,(SELECT COUNT(*) FROM issue iWHERE i.workspace_id = p.workspace_id@@ -216,6 +221,7 @@ type ListIssuePropertiesRow struct {ArchivedAt pgtype.Timestamptz `json:"archived_at"`CreatedAt pgtype.Timestamptz `json:"created_at"`UpdatedAt pgtype.Timestamptz `json:"updated_at"`+ Icon string `json:"icon"`UsageCount int64 `json:"usage_count"`}@@ -242,6 +248,7 @@ func (q *Queries) ListIssueProperties(ctx context.Context, arg ListIssueProperti&i.ArchivedAt,&i.CreatedAt,&i.UpdatedAt,+ &i.Icon,&i.UsageCount,); err != nil {return nil, err@@ -314,11 +321,12 @@ const updateIssueProperty = `-- name: UpdateIssueProperty :oneUPDATE issue_property SETname = COALESCE($3, name),description = COALESCE($4, description),- config = COALESCE($5, config),- archived_at = CASE WHEN $6::bool THEN $7 ELSE archived_at END,+ icon = COALESCE($5, icon),+ config = COALESCE($6, config),+ archived_at = CASE WHEN $7::bool THEN $8 ELSE archived_at END,updated_at = now()WHERE id = $1 AND workspace_id = $2-RETURNING id, workspace_id, name, type, description, config, position, archived_at, created_at, updated_at+RETURNING id, workspace_id, name, type, description, config, position, archived_at, created_at, updated_at, icon`type UpdateIssuePropertyParams struct {@@ -326,6 +334,7 @@ type UpdateIssuePropertyParams struct {WorkspaceID pgtype.UUID `json:"workspace_id"`Name pgtype.Text `json:"name"`Description pgtype.Text `json:"description"`+ Icon pgtype.Text `json:"icon"`Config []byte `json:"config"`ArchivedSet bool `json:"archived_set"`ArchivedAt pgtype.Timestamptz `json:"archived_at"`@@ -340,6 +349,7 @@ func (q *Queries) UpdateIssueProperty(ctx context.Context, arg UpdateIssueProperarg.WorkspaceID,arg.Name,arg.Description,+ arg.Icon,arg.Config,arg.ArchivedSet,arg.ArchivedAt,@@ -356,6 +366,7 @@ func (q *Queries) UpdateIssueProperty(ctx context.Context, arg UpdateIssueProper&i.ArchivedAt,&i.CreatedAt,&i.UpdatedAt,+ &i.Icon,)return i, err}diff --git a/server/pkg/db/generated/models.go b/server/pkg/db/generated/models.goindex 92ac469620..b7f277e540 100644--- a/server/pkg/db/generated/models.go+++ b/server/pkg/db/generated/models.go@@ -609,6 +609,7 @@ type IssueProperty struct {ArchivedAt pgtype.Timestamptz `json:"archived_at"`CreatedAt pgtype.Timestamptz `json:"created_at"`UpdatedAt pgtype.Timestamptz `json:"updated_at"`+ Icon string `json:"icon"`}type IssuePullRequest struct {diff --git a/server/pkg/db/queries/issue_property.sql b/server/pkg/db/queries/issue_property.sqlindex 3f8bdb5a23..8afc43b1ab 100644--- a/server/pkg/db/queries/issue_property.sql+++ b/server/pkg/db/queries/issue_property.sql@@ -23,11 +23,12 @@ WHERE workspace_id = $1 AND archived_at IS NULL;-- name: CreateIssueProperty :one-- New definitions append to the end of the catalog: position = max + 1.-INSERT INTO issue_property (workspace_id, name, type, description, config, position)+INSERT INTO issue_property (workspace_id, name, type, description, icon, config, position)SELECT sqlc.arg('workspace_id')::uuid,sqlc.arg('name')::text,sqlc.arg('type')::text,sqlc.arg('description')::text,+ sqlc.arg('icon')::text,sqlc.arg('config')::jsonb,COALESCE((SELECT MAX(position) FROM issue_property WHERE workspace_id = sqlc.arg('workspace_id')::uuid), 0) + 1RETURNING *;@@ -39,6 +40,7 @@ RETURNING *;UPDATE issue_property SETname = COALESCE(sqlc.narg('name'), name),description = COALESCE(sqlc.narg('description'), description),+ icon = COALESCE(sqlc.narg('icon'), icon),config = COALESCE(sqlc.narg('config'), config),archived_at = CASE WHEN sqlc.arg('archived_set')::bool THEN sqlc.narg('archived_at') ELSE archived_at END,updated_at = now()