Skip to content

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

Go

feat(issues): add multi_text and multi_url custom property types (MUL-7496) (#8559)

b0o0wenbb14e8763ced
diff --git a/apps/docs/content/docs/cli.ja.mdx b/apps/docs/content/docs/cli.ja.mdx
index 3fc0fd3838..599538c4ca 100644
--- a/apps/docs/content/docs/cli.ja.mdx
+++ b/apps/docs/content/docs/cli.ja.mdx
@@ -250,7 +250,7 @@ CLI の設定ファイルには、あなたとして Multica にアクセスで
| | `status <id> <status>` | プロジェクトのステータスを変更 | |
| | `resource list/add/update/remove` | プロジェクトの追加リソースを管理 | `--type`、`--url`、`--local-path`、`--daemon-id`、`--execution-mode`(ローカルディレクトリの `in_place` / `worktree`) |
| `label` | `list/get/create/update/delete` | ワークスペースのラベルを管理 | `list`: `--resource-type`(`issue` または `skill`)、`--full-id`;`create`: `--name`、`--color`、`--resource-type`(`issue` または `skill`)、`--description` |
-| `property` | `list/get/create/update/archive/unarchive` | ワークスペースのカスタムプロパティを管理 | `create`: `--name`、`--type`(`text`、`number`、`select`、`multi_select`、`date`、`checkbox`、`url`、`actor`、`multi_actor`)、`--option`(繰り返し可、select 系のみ);`list`: `--include-archived`;タイプは作成後に変更できません |
+| `property` | `list/get/create/update/archive/unarchive` | ワークスペースのカスタムプロパティを管理 | `create`: `--name`、`--type`(`text`、`number`、`select`、`multi_select`、`date`、`checkbox`、`url`、`actor`、`multi_actor`、`multi_text`、`multi_url`)、`--option`(繰り返し可、select 系のみ);`list`: `--include-archived`;タイプは作成後に変更できません |
| `agent` | `list/get/create/update/archive/restore` | エージェントを管理 | `--name`、`--runtime-id`(`create` では必須)、`--instructions`、`--conversation-starters`、`--model`、`--thinking-level`、`--mcp-config`、`--permission-mode`、`--max-concurrent-tasks` |
| | `copy <agent-id>` | 新しいエージェントとして複製。元のエージェントは変更されません | `--name`(デフォルトは元の名前 + ` (copy)`)、`--runtime-id`(別のランタイムへ複製する場合は `--model` の同時指定が必須)、`--no-skills`;`custom_env`、`mcp_config`、`runtime_config` などの機密設定は複製されないため、`create` と同じフラグで再指定してください |
| | `tasks <id>` | エージェントの実行を表示 | |
diff --git a/apps/docs/content/docs/cli.ko.mdx b/apps/docs/content/docs/cli.ko.mdx
index dee41d0fe0..872d47884b 100644
--- a/apps/docs/content/docs/cli.ko.mdx
+++ b/apps/docs/content/docs/cli.ko.mdx
@@ -250,7 +250,7 @@ CLI 설정 파일에는 사용자를 대신해 Multica에 접근할 수 있는 t
| | `status <id> <status>` | 프로젝트 상태 변경 | |
| | `resource list/add/update/remove` | 프로젝트 추가 리소스 관리 | `--type`, `--url`, `--local-path`, `--daemon-id`, `--execution-mode`(로컬 디렉터리의 `in_place` / `worktree`) |
| `label` | `list/get/create/update/delete` | 워크스페이스 라벨 관리 | `list`: `--resource-type`(`issue` 또는 `skill`), `--full-id`; `create`: `--name`, `--color`, `--resource-type`(`issue` 또는 `skill`), `--description` |
-| `property` | `list/get/create/update/archive/unarchive` | 워크스페이스 사용자 지정 속성 관리 | `create`: `--name`, `--type`(`text`, `number`, `select`, `multi_select`, `date`, `checkbox`, `url`, `actor`, `multi_actor`), `--option`(반복 가능, select 유형만). `list`: `--include-archived`. 유형은 생성 후 변경 불가 |
+| `property` | `list/get/create/update/archive/unarchive` | 워크스페이스 사용자 지정 속성 관리 | `create`: `--name`, `--type`(`text`, `number`, `select`, `multi_select`, `date`, `checkbox`, `url`, `actor`, `multi_actor`, `multi_text`, `multi_url`), `--option`(반복 가능, select 유형만). `list`: `--include-archived`. 유형은 생성 후 변경 불가 |
| `agent` | `list/get/create/update/archive/restore` | 에이전트 관리 | `--name`, `--runtime-id`(`create`에서 필수), `--instructions`, `--conversation-starters`, `--model`, `--thinking-level`, `--mcp-config`, `--permission-mode`, `--max-concurrent-tasks` |
| | `copy <agent-id>` | 원래 에이전트에 영향 없이 새 에이전트로 복사 | `--name`(기본값은 원래 이름 + ` (copy)`), `--runtime-id`(다른 런타임으로 복사할 때 `--model`도 필수), `--no-skills`. `custom_env`, `mcp_config`, `runtime_config` 같은 기밀 설정은 복사되지 않으며 `create`와 같은 flag로 다시 제공해야 함 |
| | `tasks <id>` | 에이전트 실행 확인 | |
diff --git a/apps/docs/content/docs/cli.mdx b/apps/docs/content/docs/cli.mdx
index fae681ab27..a5af845337 100644
--- a/apps/docs/content/docs/cli.mdx
+++ b/apps/docs/content/docs/cli.mdx
@@ -273,7 +273,7 @@ The tables below cover every current top-level command, grouped the way the CLI
| | `status <id> <status>` | Change project status | |
| | `resource list/add/update/remove` | Manage project resources | `--type`, `--url`, `--local-path`, `--daemon-id`, `--execution-mode` (`in_place` / `worktree` for a local directory) |
| `label` | `list/get/create/update/delete` | Manage workspace labels | `list`: `--resource-type` (`issue` or `skill`), `--full-id`; `create`: `--name`, `--color`, `--resource-type` (`issue` or `skill`), `--description` |
-| `property` | `list/get/create/update/archive/unarchive` | Manage workspace custom properties | `create`: `--name`, `--type` (`text`, `number`, `select`, `multi_select`, `date`, `checkbox`, `url`, `actor`, `multi_actor`), `--option` (repeatable, select types only); `list`: `--include-archived`; the type cannot be changed after creation |
+| `property` | `list/get/create/update/archive/unarchive` | Manage workspace custom properties | `create`: `--name`, `--type` (`text`, `number`, `select`, `multi_select`, `date`, `checkbox`, `url`, `actor`, `multi_actor`, `multi_text`, `multi_url`), `--option` (repeatable, select types only); `list`: `--include-archived`; the type cannot be changed after creation |
| `agent` | `list/get/create/update/archive/restore` | Manage agents | `--name`, `--runtime-id` (required for `create`), `--instructions`, `--conversation-starters`, `--model`, `--thinking-level`, `--mcp-config`, `--permission-mode`, `--max-concurrent-tasks` |
| | `copy <agent-id>` | Copy into a new agent; the original is untouched | `--name` (defaults to the original name plus ` (copy)`), `--runtime-id` (copying to another runtime also requires `--model`), `--no-skills`; secret configuration such as `custom_env`, `mcp_config`, and `runtime_config` is not copied — re-provide it with the same flags as `create` |
| | `tasks <id>` | View an agent's runs | |
diff --git a/apps/docs/content/docs/cli.zh.mdx b/apps/docs/content/docs/cli.zh.mdx
index 65eb81c567..0aedabad6f 100644
--- a/apps/docs/content/docs/cli.zh.mdx
+++ b/apps/docs/content/docs/cli.zh.mdx
@@ -250,7 +250,7 @@ CLI 配置文件包含可代表你访问 Multica 的令牌。不要提交到仓
| | `status <id> <status>` | 修改项目状态 | |
| | `resource list/add/update/remove` | 管理项目附加资源 | `--type`、`--url`、`--local-path`、`--daemon-id`、`--execution-mode`(本地目录的 `in_place` / `worktree`) |
| `label` | `list/get/create/update/delete` | 管理工作区标签 | `list`:`--resource-type`(`issue` 或 `skill`)、`--full-id`;`create`:`--name`、`--color`、`--resource-type`(`issue` 或 `skill`)、`--description` |
-| `property` | `list/get/create/update/archive/unarchive` | 管理工作区自定义属性 | `create`:`--name`、`--type`(`text`、`number`、`select`、`multi_select`、`date`、`checkbox`、`url`、`actor`、`multi_actor`)、`--option`(可重复,仅 select 类型);`list`:`--include-archived`;类型创建后不可修改 |
+| `property` | `list/get/create/update/archive/unarchive` | 管理工作区自定义属性 | `create`:`--name`、`--type`(`text`、`number`、`select`、`multi_select`、`date`、`checkbox`、`url`、`actor`、`multi_actor`、`multi_text`、`multi_url`)、`--option`(可重复,仅 select 类型);`list`:`--include-archived`;类型创建后不可修改 |
| `agent` | `list/get/create/update/archive/restore` | 管理智能体 | `--name`、`--runtime-id`(`create` 必填)、`--instructions`、`--conversation-starters`、`--model`、`--thinking-level`、`--mcp-config`、`--permission-mode`、`--max-concurrent-tasks` |
| | `copy <agent-id>` | 复制为新智能体,原智能体不受影响 | `--name`(默认为原名加 ` (copy)`)、`--runtime-id`(复制到其他运行时时必须同时指定 `--model`)、`--no-skills`;`custom_env`、`mcp_config`、`runtime_config` 等机密配置不会复制,需用与 `create` 相同的 flag 重新提供 |
| | `tasks <id>` | 查看智能体的运行 | |
diff --git a/packages/core/types/index.ts b/packages/core/types/index.ts
index 9e67ddad4f..de65f707fc 100644
--- a/packages/core/types/index.ts
+++ b/packages/core/types/index.ts
@@ -120,8 +120,8 @@ export type { InboxItem, InboxSeverity, InboxItemType, InboxWorkspaceUnread, Arc
export type { NotificationGroupKey, NotificationGroupValue, NotificationPreferences, NotificationPreferenceResponse } from "./notification-preference";
export type { Comment, CommentType, CommentAuthorType, CommentSupplementReceipt, CommentSupplementStatus, CommentTriggerPreview, CommentTriggerPreviewAgent, CommentTriggerSource, CommentTriggerOutcome, CommentTriggerStatus, Reaction } from "./comment";
export type { Label, LabelResourceType, CreateLabelRequest, UpdateLabelRequest, ListLabelsResponse, IssueLabelsResponse, ResourceLabelsResponse } from "./label";
-export type { IssueProperty, IssuePropertyType, ScalarIssuePropertyType, IssuePropertyOption, IssuePropertyConfig, IssuePropertyValue, IssuePropertyValues, CreatePropertyRequest, UpdatePropertyRequest, ListPropertiesResponse, IssuePropertiesResponse, IssuePropertyActorKind, IssuePropertyActorRef, PropertyFilterOp, PropertyOperatorFilter, PropertyFilterValue } from "./property";
-export { ISSUE_PROPERTY_TYPES, isKnownPropertyType, ISSUE_PROPERTY_ACTOR_KINDS, MAX_ISSUE_PROPERTY_ACTOR_VALUES, isActorPropertyType, isFilterablePropertyType, isScalarPropertyType, formatActorRef, parseActorRef, actorRefsFromValue, actorRefValuesFromValue, hasUnknownActorRef, isPropertyOperatorFilter, isKnownPropertyFilterOp, propertyFilterValueKey, PROPERTY_FILTER_OP_SYMBOLS, PROPERTY_FILTER_OPS_BY_TYPE } from "./property";
+export type { IssueProperty, IssuePropertyType, ScalarIssuePropertyType, ListIssuePropertyType, IssuePropertyOption, IssuePropertyConfig, IssuePropertyValue, IssuePropertyValues, CreatePropertyRequest, UpdatePropertyRequest, ListPropertiesResponse, IssuePropertiesResponse, IssuePropertyActorKind, IssuePropertyActorRef, PropertyFilterOp, PropertyOperatorFilter, PropertyFilterValue } from "./property";
+export { ISSUE_PROPERTY_TYPES, isKnownPropertyType, ISSUE_PROPERTY_ACTOR_KINDS, MAX_ISSUE_PROPERTY_ACTOR_VALUES, isActorPropertyType, isFilterablePropertyType, isScalarPropertyType, isListPropertyType, formatActorRef, parseActorRef, actorRefsFromValue, actorRefValuesFromValue, hasUnknownActorRef, isPropertyOperatorFilter, isKnownPropertyFilterOp, propertyFilterValueKey, PROPERTY_FILTER_OP_SYMBOLS, PROPERTY_FILTER_OPS_BY_TYPE } from "./property";
export type {
QuickAction,
QuickActionVisibility,
diff --git a/packages/core/types/property.test.ts b/packages/core/types/property.test.ts
index 0e9789b643..4c0e27643e 100644
--- a/packages/core/types/property.test.ts
+++ b/packages/core/types/property.test.ts
@@ -8,6 +8,7 @@ import {
isActorPropertyType,
isFilterablePropertyType,
isKnownPropertyType,
+ isListPropertyType,
isScalarPropertyType,
parseActorRef,
} from "./property";
@@ -48,6 +49,8 @@ describe("isFilterablePropertyType", () => {
"url",
"actor",
"multi_actor",
+ "multi_text",
+ "multi_url",
]) {
expect(isFilterablePropertyType(type)).toBe(true);
}
@@ -69,6 +72,16 @@ describe("isScalarPropertyType", () => {
});
});
+describe("isListPropertyType", () => {
+ it("covers both list types and nothing else", () => {
+ expect(isListPropertyType("multi_text")).toBe(true);
+ expect(isListPropertyType("multi_url")).toBe(true);
+ expect(isListPropertyType("text")).toBe(false);
+ expect(isListPropertyType("url")).toBe(false);
+ expect(isListPropertyType("multi_select")).toBe(false);
+ });
+});
+
describe("parseActorRef", () => {
it("parses member references", () => {
expect(parseActorRef(`member:${MEMBER}`)).toEqual({ kind: "member", id: MEMBER });
diff --git a/packages/core/types/property.ts b/packages/core/types/property.ts
index 7931706b09..22b7e7c4dd 100644
--- a/packages/core/types/property.ts
+++ b/packages/core/types/property.ts
@@ -7,7 +7,8 @@
* Values are typed per definition: select stores an option id, multi_select
* an array of option ids (config order), date a "YYYY-MM-DD" string, checkbox
* a boolean, number a number, text/url strings, actor a "member:<user_id>"
- * reference string, multi_actor an array of them (insertion order).
+ * reference string, multi_actor an array of them (insertion order), and
+ * multi_text/multi_url arrays of free-form strings (insertion order).
*/
export type IssuePropertyType =
| "text"
@@ -18,7 +19,9 @@ export type IssuePropertyType =
| "checkbox"
| "url"
| "actor"
- | "multi_actor";
+ | "multi_actor"
+ | "multi_text"
+ | "multi_url";
export const ISSUE_PROPERTY_TYPES: IssuePropertyType[] = [
"text",
@@ -30,6 +33,8 @@ export const ISSUE_PROPERTY_TYPES: IssuePropertyType[] = [
"url",
"actor",
"multi_actor",
+ "multi_text",
+ "multi_url",
];
export function isKnownPropertyType(type: string): type is IssuePropertyType {
@@ -74,7 +79,8 @@ export function isFilterablePropertyType(type: string): boolean {
type === "multi_select" ||
type === "checkbox" ||
isScalarPropertyType(type) ||
- isActorPropertyType(type)
+ isActorPropertyType(type) ||
+ isListPropertyType(type)
);
}
@@ -85,6 +91,16 @@ export function isScalarPropertyType(type: string): type is ScalarIssuePropertyT
return type === "text" || type === "url" || type === "number" || type === "date";
}
+/**
+ * Free-form list properties: multi_text / multi_url. Values are string arrays
+ * in insertion order; filtering matches any single element exactly.
+ */
+export type ListIssuePropertyType = Extract<IssuePropertyType, "multi_text" | "multi_url">;
+
+export function isListPropertyType(type: string): type is ListIssuePropertyType {
+ return type === "multi_text" || type === "multi_url";
+}
+
export function formatActorRef(kind: IssuePropertyActorKind, id: string): string {
return `${kind}:${id}`;
}
@@ -267,6 +283,8 @@ export const PROPERTY_FILTER_OPS_BY_TYPE: Record<IssuePropertyType, readonly Pro
url: ["contains"],
actor: [],
multi_actor: [],
+ multi_text: [],
+ multi_url: [],
};
export interface CreatePropertyRequest {
diff --git a/packages/views/issues/components/filter-chips-bar.tsx b/packages/views/issues/components/filter-chips-bar.tsx
index 191f6f10f9..a396efd944 100644
--- a/packages/views/issues/components/filter-chips-bar.tsx
+++ b/packages/views/issues/components/filter-chips-bar.tsx
@@ -23,7 +23,7 @@ import { projectListOptions } from "@multica/core/projects/queries";
import { PROJECT_STATUS_CONFIG } from "@multica/core/projects/config";
import { labelListOptions } from "@multica/core/labels/queries";
import { propertyListOptions } from "@multica/core/properties";
-import { isActorPropertyType, isScalarPropertyType, parseActorRef, propertyFilterValueKey, PROPERTY_FILTER_OP_SYMBOLS, type PropertyFilterValue } from "@multica/core/types";
+import { isActorPropertyType, isListPropertyType, isScalarPropertyType, parseActorRef, propertyFilterValueKey, PROPERTY_FILTER_OP_SYMBOLS, type PropertyFilterValue } from "@multica/core/types";
import {
type ActorFilterValue,
type FilterDimension,
@@ -531,8 +531,9 @@ function useFilterChips(
? t(($) => $.pickers.custom_property.true_label)
: t(($) => $.pickers.custom_property.false_label);
}
- // Scalar properties have no option list — the filter value IS the label.
- if (isScalarPropertyType(definition.type)) {
+ // Scalar and list properties have no option list — the filter value IS
+ // the label (for lists it is one matched element).
+ if (isScalarPropertyType(definition.type) || isListPropertyType(definition.type)) {
return member;
}
return definition.config.options?.find((o) => o.id === member)?.name;
diff --git a/packages/views/issues/components/issues-header.tsx b/packages/views/issues/components/issues-header.tsx
index c080ac5cf1..3da45a9ebc 100644
--- a/packages/views/issues/components/issues-header.tsx
+++ b/packages/views/issues/components/issues-header.tsx
@@ -76,7 +76,7 @@ import type {
ProjectStatus,
WorkingAgentSummary,
} from "@multica/core/types";
-import { formatActorRef, isActorPropertyType, isFilterablePropertyType, isScalarPropertyType, propertyFilterValueKey, PROPERTY_FILTER_OP_SYMBOLS, PROPERTY_FILTER_OPS_BY_TYPE, type PropertyFilterOp, type PropertyFilterValue } from "@multica/core/types";
+import { formatActorRef, isActorPropertyType, isFilterablePropertyType, isListPropertyType, isScalarPropertyType, propertyFilterValueKey, PROPERTY_FILTER_OP_SYMBOLS, PROPERTY_FILTER_OPS_BY_TYPE, type PropertyFilterOp, type PropertyFilterValue } from "@multica/core/types";
import { ProjectIcon } from "../../projects/components/project-icon";
import { useProjectStatusLabels } from "../../projects/components/labels";
import { ActorAvatar } from "../../common/actor-avatar";
@@ -785,10 +785,11 @@ function PropertyFilterOptions({
actorId: undefined as string | undefined,
};
// Scalar value state lives at the top level so the hooks stay unconditional
- // (Rules of Hooks): it is only rendered for text / number / date / url, but
- // must be declared regardless of which branch runs. The draft syncs to the
- // committed scalar member whenever that changes, so a filter cleared or
- // rewritten elsewhere cannot be written back from a stale input.
+ // (Rules of Hooks): it is only rendered for text / number / date / url and
+ // the list types (equality-only input), but must be declared regardless of
+ // which branch runs. The draft syncs to the committed scalar member whenever
+ // that changes, so a filter cleared or rewritten elsewhere cannot be written
+ // back from a stale input.
const committedMember = selected.find((member) => member !== NO_PROPERTY_VALUE);
const committedScalar =
typeof committedMember === "object" ? committedMember.value : (committedMember ?? "");
@@ -833,9 +834,9 @@ function PropertyFilterOptions({
noValueOption,
];
- if (isScalarPropertyType(property.type)) {
+ if (isScalarPropertyType(property.type) || isListPropertyType(property.type)) {
const placeholder =
- property.type === "url"
+ property.type === "url" || property.type === "multi_url"
? t(($) => $.pickers.custom_property.url_placeholder)
: property.type === "number"
? t(($) => $.pickers.custom_property.number_placeholder)
@@ -855,6 +856,12 @@ function PropertyFilterOptions({
if (op === "after") return t(($) => $.pickers.custom_property.op_after);
return PROPERTY_FILTER_OP_SYMBOLS[op] ?? op;
};
+ // List types are equality-only: their PROPERTY_FILTER_OPS_BY_TYPE entry is
+ // empty by design, and looking it up needs the scalar narrowing anyway
+ // (IssueProperty.type is a lenient string).
+ const scalarOps = isScalarPropertyType(property.type)
+ ? (PROPERTY_FILTER_OPS_BY_TYPE[property.type] ?? [])
+ : [];
const opButtons: { op: PropertyFilterOp | "is"; label: string }[] = [
{
op: "is",
@@ -863,7 +870,7 @@ function PropertyFilterOptions({
? "="
: t(($) => $.pickers.custom_property.op_is),
},
- ...(PROPERTY_FILTER_OPS_BY_TYPE[property.type] ?? []).map((op) => ({
+ ...scalarOps.map((op) => ({
op,
label: scalarOperatorLabel(op),
})),
diff --git a/packages/views/issues/components/pickers/custom-property-picker.list.test.tsx b/packages/views/issues/components/pickers/custom-property-picker.list.test.tsx
new file mode 100644
index 0000000000..7c9dbdb517
--- /dev/null
+++ b/packages/views/issues/components/pickers/custom-property-picker.list.test.tsx
@@ -0,0 +1,179 @@
+import { act, fireEvent, render, screen, waitFor } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+import { api } from "@multica/core/api";
+import { I18nProvider } from "@multica/core/i18n/react";
+import type { Issue, IssueProperty } from "@multica/core/types";
+import enIssues from "../../../locales/en/issues.json";
+import { CustomPropertyValueEditor, CustomPropertyValueInput } from "./custom-property-picker";
+
+vi.mock("@multica/core/api", () => ({
+ api: { setIssueProperty: vi.fn(), unsetIssueProperty: vi.fn() },
+}));
+vi.mock("@multica/core/hooks", () => ({ useWorkspaceId: () => "ws-1" }));
+
+const property: IssueProperty = {
+ id: "p-1", workspace_id: "ws-1", name: "Related links", type: "multi_url",
+ config: {}, position: 1, archived: false,
+ created_at: "2026-01-01T00:00:00Z", updated_at: "2026-01-01T00:00:00Z",
+};
+const issue: Issue = {
+ id: "issue-1", workspace_id: "ws-1", number: 1, identifier: "MUL-1",
+ title: "Related links", description: null, status: "todo", priority: "none",
+ assignee_type: null, assignee_id: null, creator_type: "member", creator_id: "member-1",
+ parent_issue_id: null, project_id: null, position: 1, stage: null,
+ start_date: null, due_date: null, labels: [], metadata: {},
+ properties: { [property.id]: ["https://existing.example"] },
+ created_at: "2026-01-01T00:00:00Z", updated_at: "2026-01-01T00:00:00Z",
+};
+
+function renderEditor() {
+ const client = new QueryClient({ defaultOptions: { mutations: { retry: false } } });
+ const editor = (currentIssue: Issue, currentProperty = property) => (
+ <QueryClientProvider client={client}>
+ <I18nProvider locale="en" resources={{ en: { issues: enIssues } }}>
+ <CustomPropertyValueEditor issue={currentIssue} property={currentProperty} defaultOpen />
+ </I18nProvider>
+ </QueryClientProvider>
+ );
+ const view = render(editor(issue));
+ return {
+ ...view,
+ showIssue: (next: Issue, nextProperty = property) => view.rerender(editor(next, nextProperty)),
+ };
+}
+
+describe("list property editing", () => {
+ beforeEach(() => vi.resetAllMocks());
+
+ it("explains a missing URL scheme and keeps the draft editable", async () => {
+ const user = userEvent.setup();
+ renderEditor();
+ const input = await screen.findByPlaceholderText("https://…");
+ await user.type(input, "example.com{Enter}");
+
+ expect(await screen.findByRole("alert")).toHaveTextContent("http:// or https://");
+ expect(input).toHaveValue("example.com");
+ expect(input).toHaveAttribute("aria-invalid", "true");
+ expect(api.setIssueProperty).not.toHaveBeenCalled();
+
+ await user.clear(input);
+ await user.type(input, "https://example.com");
+ expect(screen.queryByRole("alert")).not.toBeInTheDocument();
+ });
+
+ it("retains a server-rejected URL and clears it only after a successful retry", async () => {
+ const user = userEvent.setup();
+ vi.mocked(api.setIssueProperty).mockRejectedValueOnce(new Error("URL must have a host"));
+ renderEditor();
+ const input = await screen.findByPlaceholderText("https://…");
+ await user.type(input, "https://{Enter}");
+
+ expect(await screen.findByRole("alert")).toHaveTextContent("URL must have a host");
+ expect(input).toHaveValue("https://");
+ expect(api.setIssueProperty).toHaveBeenCalledWith(issue.id, property.id, [
+ "https://existing.example", "https://",
+ ]);
+
+ vi.mocked(api.setIssueProperty).mockResolvedValueOnce({
+ properties: { [property.id]: ["https://existing.example", "https://example.com"] },
+ issue_revision: 2,
+ });
+ await user.type(input, "example.com{Enter}");
+ await waitFor(() => expect(input).toHaveValue(""));
+ expect(screen.queryByRole("alert")).not.toBeInTheDocument();
+ });
+
+ it("keeps the draft but clears the old error when reopened", async () => {
+ const user = userEvent.setup();
+ renderEditor();
+ await user.type(await screen.findByRole("textbox", { name: property.name }), "example.com{Enter}");
+ expect(await screen.findByRole("alert")).toBeInTheDocument();
+
+ await user.keyboard("{Escape}");
+ await user.click(screen.getByRole("button", { name: "https://existing.example" }));
+
+ const input = await screen.findByRole("textbox", { name: property.name });
+ expect(input).toHaveValue("example.com");
+ expect(screen.queryByRole("alert")).not.toBeInTheDocument();
+ expect(input).toHaveAttribute("aria-invalid", "false");
+ expect(input).not.toHaveAttribute("aria-describedby");
+ });
+
+ it.each(["issue", "property"])("resets the draft and error when switching %s in the same editor", async (target) => {
+ const user = userEvent.setup();
+ const { showIssue } = renderEditor();
+ await user.type(await screen.findByRole("textbox", { name: property.name }), "example.com{Enter}");
+ expect(await screen.findByRole("alert")).toBeInTheDocument();
+
+ const nextProperty = target === "property" ? { ...property, id: "p-2" } : property;
+ showIssue({
+ ...issue,
+ id: target === "issue" ? "issue-2" : issue.id,
+ properties: { [nextProperty.id]: ["https://next.example"] },
+ }, nextProperty);
+
+ expect(await screen.findByRole("textbox", { name: property.name })).toHaveValue("");
+ expect(screen.queryByRole("alert")).not.toBeInTheDocument();
+ expect(screen.getByRole("button", { name: "Remove https://next.example" })).toBeEnabled();
+ });
+
+ it("does not carry an in-flight failure into another issue's draft", async () => {
+ const user = userEvent.setup();
+ let fail!: (error: Error) => void;
+ vi.mocked(api.setIssueProperty).mockImplementationOnce(() => new Promise((_resolve, reject) => {
+ fail = reject;
+ }));
+ const { showIssue } = renderEditor();
+ await user.type(await screen.findByRole("textbox", { name: property.name }), "https://old.example{Enter}");
+ await waitFor(() => expect(api.setIssueProperty).toHaveBeenCalledTimes(1));
+
+ showIssue({ ...issue, id: "issue-2" });
+ const input = await screen.findByRole("textbox", { name: property.name });
+ expect(input).toHaveValue("");
+ expect(input).not.toHaveAttribute("readonly");
+ await user.type(input, "https://new.example");
+
+ await act(async () => fail(new Error("Previous issue write failed")));
+ expect(input).toHaveValue("https://new.example");
+ expect(screen.queryByRole("alert")).not.toBeInTheDocument();
+ });
+
+ it("keeps the draft and prevents overlapping add/remove requests while saving", async () => {
+ const user = userEvent.setup();
+ let finish!: () => void;
+ vi.mocked(api.setIssueProperty).mockImplementationOnce(() => new Promise((resolve) => {
+ finish = () => resolve({ properties: {}, issue_revision: 2 });
+ }));
+ renderEditor();
+ const input = await screen.findByPlaceholderText("https://…");
+ await user.type(input, "https://example.com{Enter}");
+ await waitFor(() => expect(api.setIssueProperty).toHaveBeenCalledTimes(1));
+
+ expect(input).toHaveValue("https://example.com");
+ expect(screen.getByRole("button", { name: "Remove https://existing.example" })).toBeDisabled();
+ fireEvent.submit(input.closest("form")!);
+ expect(api.setIssueProperty).toHaveBeenCalledTimes(1);
+
+ await act(async () => finish());
+ await waitFor(() => expect(input).toHaveValue(""));
+ });
+
+ it("still appends and clears a synchronous issue-creation draft", async () => {
+ const user = userEvent.setup();
+ const onChange = vi.fn();
+ render(
+ <I18nProvider locale="en" resources={{ en: { issues: enIssues } }}>
+ <CustomPropertyValueInput
+ property={{ ...property, type: "multi_text" }} value={["alpha"]}
+ onChange={onChange} defaultOpen
+ />
+ </I18nProvider>,
+ );
+ const input = await screen.findByPlaceholderText("Enter value…");
+ await user.type(input, "Smith, John{Enter}");
+ expect(onChange).toHaveBeenCalledWith(["alpha", "Smith, John"]);
+ await waitFor(() => expect(input).toHaveValue(""));
+ });
+});
diff --git a/packages/views/issues/components/pickers/custom-property-picker.test.ts b/packages/views/issues/components/pickers/custom-property-picker.test.ts
index c224848b19..60ac76468f 100644
--- a/packages/views/issues/components/pickers/custom-property-picker.test.ts
+++ b/packages/views/issues/components/pickers/custom-property-picker.test.ts
@@ -49,4 +49,9 @@ describe("isCustomPropertyReadOnly", () => {
expect(isCustomPropertyReadOnly(multi, [MEMBER, AGENT])).toBe(false);
expect(isCustomPropertyReadOnly(multi, [AGENT])).toBe(false);
});
+
+ it("keeps multi_text and multi_url editable", () => {
+ expect(isCustomPropertyReadOnly(property({ type: "multi_text" }), ["alpha"])).toBe(false);
+ expect(isCustomPropertyReadOnly(property({ type: "multi_url" }), undefined)).toBe(false);
+ });
});
diff --git a/packages/views/issues/components/pickers/custom-property-picker.tsx b/packages/views/issues/components/pickers/custom-property-picker.tsx
index 17a5236912..792a2b0194 100644
--- a/packages/views/issues/components/pickers/custom-property-picker.tsx
+++ b/packages/views/issues/components/pickers/custom-property-picker.tsx
@@ -1,10 +1,10 @@
"use client";
-import { useEffect, useState } from "react";
-import { CalendarDays, Check, ExternalLink } from "lucide-react";
+import { useEffect, useId, useRef, useState } from "react";
+import { CalendarDays, Check, ExternalLink, X } from "lucide-react";
import { toast } from "sonner";
import type { Issue, IssueProperty, IssuePropertyValue } from "@multica/core/types";
-import { hasUnknownActorRef } from "@multica/core/types";
+import { hasUnknownActorRef, isListPropertyType } from "@multica/core/types";
import {
useSetIssueProperty,
useUnsetIssueProperty,
@@ -36,6 +36,8 @@ const EDITABLE_PROPERTY_TYPES = [
"url",
"actor",
"multi_actor",
+ "multi_text",
+ "multi_url",
];
/**
@@ -71,6 +73,7 @@ export function isCustomPropertyReadOnly(
* actor → member picker (commits and closes)
* multi_actor → member picker with toggling items (stays open)
* text/number/url → popover with an input, Enter commits
+ * multi_text/multi_url → popover with removable rows + an appending input
*
* Archived definitions render read-only: the popover only offers Clear
* (the server rejects new values on archived properties but always allows
@@ -97,20 +100,28 @@ export function CustomPropertyValueEditor({
return (
<CustomPropertyValueInput
+ key={`${issue.id}:${property.id}`}
property={property}
value={value}
defaultOpen={defaultOpen}
open={open}
onOpenChange={onOpenChange}
onChange={(next) => {
+ // List editors await the write and show failures beside the draft.
+ if (isListPropertyType(property.type) && !isCustomPropertyReadOnly(property, value)) {
+ const variables = { issueId: issue.id, propertyId: property.id };
+ return (next === undefined
+ ? unsetProperty.mutateAsync(variables)
+ : setProperty.mutateAsync({ ...variables, value: next })
+ ).then(() => {});
+ }
if (next === undefined) {
- unsetProperty.mutate(
+ return unsetProperty.mutate(
{ issueId: issue.id, propertyId: property.id },
{ onError },
);
- return;
}
- setProperty.mutate(
+ return setProperty.mutate(
{ issueId: issue.id, propertyId: property.id, value: next },
{ onError },
);
@@ -122,7 +133,7 @@ export function CustomPropertyValueEditor({
/**
* Mutation-free custom-property editor. Create flows use this while an issue
* still exists only as a draft; issue detail wraps it above with the normal
- * optimistic mutations.
+ * optimistic mutations. List editors await onChange before clearing the draft.
*/
export function CustomPropertyValueInput({
property,
@@ -136,7 +147,7 @@ export function CustomPropertyValueInput({
}: {
property: IssueProperty;
value: IssuePropertyValue | undefined;
- onChange: (value: IssuePropertyValue | undefined) => void;
+ onChange: (value: IssuePropertyValue | undefined) => void | Promise<void>;
defaultOpen?: boolean;
open?: boolean;
onOpenChange?: (open: boolean) => void;
@@ -274,6 +285,20 @@ export function CustomPropertyValueInput({
emptyRow={emptyRow}
/>
);
+ case "multi_text":
+ case "multi_url":
+ return (
+ <ListPropertyEditor
+ property={property}
+ value={value}
+ open={open}
+ onOpenChange={setOpen}
+ onCommit={commit}
+ onClear={clear}
+ trigger={valueTrigger}
+ triggerRender={triggerRender}
+ />
+ );
case "date": {
const date = typeof value === "string" ? dateOnlyToLocalDate(value) : undefined;
return (
@@ -459,6 +484,153 @@ function TextishPropertyEditor({
);
}
+/**
+ * List editor for multi_text / multi_url: current entries as removable rows
+ * above an input that appends on Enter. The popover stays open across
+ * additions (multi-select interaction); each add/remove commits the whole
+ * array, and removing the last entry clears the property.
+ */
+function ListPropertyEditor({
+ property,
+ value,
+ open,
+ onOpenChange,
+ onCommit,
+ onClear,
+ trigger,
+ triggerRender,
+}: {
+ property: IssueProperty;
+ value: IssuePropertyValue | undefined;
+ open: boolean;
+ onOpenChange: (v: boolean) => void;
+ onCommit: (next: IssuePropertyValue) => void | Promise<void>;
+ onClear: () => void | Promise<void>;
+ trigger?: React.ReactNode;
+ triggerRender?: React.ReactElement<Record<string, unknown>>;
+}) {
+ const { t } = useT("issues");
+ const [draft, setDraft] = useState("");
+ const [error, setError] = useState<string | null>(null);
+ const [saving, setSaving] = useState(false);
+ const savingRef = useRef(false);
+ const errorId = useId();
+
+ useEffect(() => {
+ if (open) setError(null);
+ }, [open]);
+
+ const items = Array.isArray(value) ? value : [];
+ const placeholder =
+ property.type === "multi_url"
+ ? t(($) => $.pickers.custom_property.url_placeholder)
+ : t(($) => $.pickers.custom_property.value_placeholder);
+
+ const save = async (next: string[], clearDraft = false) => {
+ if (savingRef.current) return;
+ savingRef.current = true;
+ setSaving(true);
+ setError(null);
+ try {
+ if (next.length === 0) await onClear();
+ else await onCommit(next);
+ if (clearDraft) setDraft("");
+ } catch (error) {
+ setError(error instanceof Error ? error.message : String(error));
+ } finally {
+ savingRef.current = false;
+ setSaving(false);
+ }
+ };
+
+ const add = () => {
+ if (savingRef.current) return;
+ const trimmed = draft.trim();
+ if (!trimmed) return;
+ if (property.type === "multi_url" && !/^https?:\/\//i.test(trimmed)) {
+ setError(t(($) => $.pickers.custom_property.url_scheme_required));
+ return;
+ }
+ if (items.includes(trimmed)) {
+ setDraft("");
+ setError(null);
+ return;
+ }
+ void save([...items, trimmed], true);
+ };
+
+ return (
+ <Popover open={open} onOpenChange={onOpenChange}>
+ <PopoverTrigger
+ className={triggerRender ? undefined : "flex items-center gap-1.5 cursor-pointer rounded-xs px-1 -mx-1 hover:bg-accent/30 transition-colors overflow-hidden"}
+ render={triggerRender}
+ >
+ {trigger}
+ </PopoverTrigger>
+ <PopoverContent className="w-64 p-2" align="start">
+ {items.length > 0 && (
+ <ul className="mb-2 max-h-48 overflow-y-auto">
+ {items.map((item) => (
+ <li key={item} className="flex min-w-0 items-center gap-1 rounded-sm px-1 py-0.5 hover:bg-accent/40">
+ <span className="min-w-0 flex-1 truncate text-body">{item}</span>
+ {property.type === "multi_url" && (
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon-sm"
+ aria-label={t(($) => $.pickers.custom_property.open_link)}
+ onClick={() => window.open(item, "_blank", "noopener,noreferrer")}
+ >
+ <ExternalLink className="size-3.5" />
+ </Button>
+ )}
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon-sm"
+ aria-label={t(($) => $.pickers.custom_property.remove_item, { value: item })}
+ disabled={saving}
+ onClick={() => void save(items.filter((entry) => entry !== item))}
+ >
+ <X className="size-3.5" />
+ </Button>
+ </li>
+ ))}
+ </ul>
+ )}
+ <form
+ onSubmit={(event) => {
+ event.preventDefault();
+ add();
+ }}
+ className="flex items-center gap-2"
+ aria-busy={saving}
+ >
+ <Input
+ autoFocus
+ value={draft}
+ readOnly={saving}
+ aria-label={property.name}
+ aria-invalid={error !== null}
+ aria-describedby={error ? errorId : undefined}
+ onChange={(event) => {
+ setDraft(event.target.value);
+ setError(null);
+ }}
+ placeholder={placeholder}
+ className="h-8"
+ />
+ </form>
+ {error && (
+ <p id={errorId} role="alert" className="text-caption text-destructive">
+ {error}
+ </p>
+ )}
+ </PopoverContent>
+ </Popover>
+ );
+}
+
/**
* Read view of a custom property value, shared by row triggers everywhere
* (sidebar rows now; cards/filters later). Option ids resolve to named,
@@ -535,6 +707,32 @@ export function CustomPropertyValueDisplay({
}
/>
);
+ case "multi_text":
+ case "multi_url": {
+ const items = Array.isArray(value) ? value : [];
+ if (items.length === 0) {
+ return (
+ <span className="text-muted-foreground">
+ {t(($) => $.pickers.custom_property.empty)}
+ </span>
+ );
+ }
+ return (
+ <span className="flex min-w-0 flex-wrap items-center gap-1">
+ {items.map((item) => (
+ <span
+ key={item}
+ className="inline-flex max-w-48 items-center gap-1 rounded-full border border-surface-border px-1.5 py-px text-micro"
+ >
+ {property.type === "multi_url" && (
+ <ExternalLink className="size-2.5 shrink-0 text-muted-foreground" />
+ )}
+ <span className="truncate">{item}</span>
+ </span>
+ ))}
+ </span>
+ );
+ }
case "date":
return (
<span className="flex items-center gap-1.5">
diff --git a/packages/views/issues/components/table-view.tsx b/packages/views/issues/components/table-view.tsx
index 3badfbc229..fa51d5cd8b 100644
--- a/packages/views/issues/components/table-view.tsx
+++ b/packages/views/issues/components/table-view.tsx
@@ -921,6 +921,9 @@ function propertyDisplayValue(
.map((option) => option.name)
.join(", ");
}
+ if (property.type === "multi_text" || property.type === "multi_url") {
+ return Array.isArray(value) ? value.join(", ") : String(value);
+ }
if (isActorPropertyType(property.type)) {
return actorRefsFromValue(value)
.map((ref) => (getActorName ? getActorName(ref.kind, ref.id) : formatActorRef(ref.kind, ref.id)))
@@ -1076,7 +1079,7 @@ function IssueTableHeaderCell({
const property = propertyId ? meta.propertyById.get(propertyId) : undefined;
const staticSort = propertyId
? property &&
- !["multi_select", "checkbox", "actor", "multi_actor"].includes(property.type)
+ !["multi_select", "checkbox", "actor", "multi_actor", "multi_text", "multi_url"].includes(property.type)
? (`property:${propertyId}` as SortField)
: undefined
: SORTABLE_COLUMNS[key as TableSystemColumnKey];
diff --git a/packages/views/issues/utils/filter.test.ts b/packages/views/issues/utils/filter.test.ts
index 8b15f2e860..f32a03344e 100644
--- a/packages/views/issues/utils/filter.test.ts
+++ b/packages/views/issues/utils/filter.test.ts
@@ -500,6 +500,17 @@ describe("property filters", () => {
expect(result.map((i) => i.id)).toEqual(["P2"]);
});
+ it("multi_text/multi_url match any single element exactly", () => {
+ const aliasId = "prop-aliases";
+ const withAlpha = makeIssue({ id: "L1", properties: { [aliasId]: ["beta", "alpha"] } });
+ const without = makeIssue({ id: "L2", properties: { [aliasId]: ["beta"] } });
+ const result = filterIssues([withAlpha, without], {
+ ...NO_FILTER,
+ propertyFilters: { [aliasId]: ["alpha"] },
+ });
+ expect(result.map((i) => i.id)).toEqual(["L1"]);
+ });
+
it("checkbox values match the true/false pseudo-options", () => {
const result = filterIssues([checked, unset], {
...NO_FILTER,
diff --git a/packages/views/locales/en/issues.json b/packages/views/locales/en/issues.json
index c3fee3c8df..b61648c300 100644
--- a/packages/views/locales/en/issues.json
+++ b/packages/views/locales/en/issues.json
@@ -872,9 +872,11 @@
"false_label": "No",
"value_placeholder": "Enter value…",
"url_placeholder": "https://…",
+ "url_scheme_required": "Start the URL with http:// or https://.",
"number_placeholder": "0",
"actor_search_placeholder": "Search members…",
"open_link": "Open link",
+ "remove_item": "Remove {{value}}",
"archived_hint": "Archived property — value is read-only",
"unknown_value": "Unavailable",
"unknown_value_hint": "This value was set by a newer version of Multica and can't be edited here — update the app, or clear it"
diff --git a/packages/views/locales/en/settings.json b/packages/views/locales/en/settings.json
index 136349db31..4e37ee3db2 100644
--- a/packages/views/locales/en/settings.json
+++ b/packages/views/locales/en/settings.json
@@ -544,7 +544,9 @@
"checkbox": "Checkbox",
"url": "URL",
"actor": "Member",
- "multi_actor": "Members"
+ "multi_actor": "Members",
+ "multi_text": "Text list",
+ "multi_url": "URL list"
},
"actions": {
"open": "Actions for {{name}}",
diff --git a/packages/views/locales/fr/issues.json b/packages/views/locales/fr/issues.json
index 9033f26735..3528dc1632 100644
--- a/packages/views/locales/fr/issues.json
+++ b/packages/views/locales/fr/issues.json
@@ -872,9 +872,11 @@
"false_label": "Non",
"value_placeholder": "Saisir une valeur…",
"url_placeholder": "https://…",
+ "url_scheme_required": "L’URL doit commencer par http:// ou https://.",
"number_placeholder": "0",
"actor_search_placeholder": "Rechercher des membres…",
"open_link": "Ouvrir le lien",
+ "remove_item": "Retirer {{value}}",
"archived_hint": "Propriété archivée — la valeur est en lecture seule",
"unknown_value": "Indisponible",
"unknown_value_hint": "Cette valeur a été définie par une version plus récente de Multica et ne peut pas être modifiée ici — mettez l'application à jour, ou effacez-la"
diff --git a/packages/views/locales/fr/settings.json b/packages/views/locales/fr/settings.json
index 7659b9c036..36764c3f27 100644
--- a/packages/views/locales/fr/settings.json
+++ b/packages/views/locales/fr/settings.json
@@ -544,7 +544,9 @@
"checkbox": "Case à cocher",
"url": "URL",
"actor": "Membre",
- "multi_actor": "Membres"
+ "multi_actor": "Membres",
+ "multi_text": "Liste de textes",
+ "multi_url": "Liste d'URL"
},
"actions": {
"open": "Actions pour {{name}}",
diff --git a/packages/views/locales/ja/issues.json b/packages/views/locales/ja/issues.json
index 54758ab5ee..b7d546a85f 100644
--- a/packages/views/locales/ja/issues.json
+++ b/packages/views/locales/ja/issues.json
@@ -833,9 +833,11 @@
"false_label": "いいえ",
"value_placeholder": "値を入力…",
"url_placeholder": "https://…",
+ "url_scheme_required": "URL は http:// または https:// で始めてください。",
"number_placeholder": "0",
"actor_search_placeholder": "メンバーを検索…",
"open_link": "リンクを開く",
+ "remove_item": "{{value}} を削除",
"archived_hint": "アーカイブ済みプロパティ — 値は読み取り専用です",
"unknown_value": "表示できません",
"unknown_value_hint": "この値は新しいバージョンの Multica で設定されており、ここでは編集できません。アプリを更新するか、値をクリアしてください"
diff --git a/packages/views/locales/ja/settings.json b/packages/views/locales/ja/settings.json
index 09f9af4ed4..26d33572c7 100644
--- a/packages/views/locales/ja/settings.json
+++ b/packages/views/locales/ja/settings.json
@@ -540,7 +540,9 @@
"checkbox": "チェックボックス",
"url": "URL",
"actor": "メンバー",
- "multi_actor": "メンバー(複数選択)"
+ "multi_actor": "メンバー(複数選択)",
+ "multi_text": "テキストリスト",
+ "multi_url": "URLリスト"
},
"actions": {
"open": "{{name}} の操作",
diff --git a/packages/views/locales/ko/issues.json b/packages/views/locales/ko/issues.json
index 651e2f7594..b737da945f 100644
--- a/packages/views/locales/ko/issues.json
+++ b/packages/views/locales/ko/issues.json
@@ -833,9 +833,11 @@
"false_label": "아니요",
"value_placeholder": "값 입력…",
"url_placeholder": "https://…",
+ "url_scheme_required": "URL은 http:// 또는 https://로 시작해야 합니다.",
"number_placeholder": "0",
"actor_search_placeholder": "멤버 검색…",
"open_link": "링크 열기",
+ "remove_item": "{{value}} 제거",
"archived_hint": "보관된 속성 — 값은 읽기 전용입니다",
"unknown_value": "표시할 수 없음",
"unknown_value_hint": "이 값은 최신 버전의 Multica에서 설정되어 여기서는 편집할 수 없습니다. 앱을 업데이트하거나 값을 지우세요"
diff --git a/packages/views/locales/ko/settings.json b/packages/views/locales/ko/settings.json
index c9c848ce7e..56dbe60529 100644
--- a/packages/views/locales/ko/settings.json
+++ b/packages/views/locales/ko/settings.json
@@ -540,7 +540,9 @@
"checkbox": "체크박스",
"url": "URL",
"actor": "멤버",
- "multi_actor": "멤버(다중 선택)"
+ "multi_actor": "멤버(다중 선택)",
+ "multi_text": "텍스트 목록",
+ "multi_url": "URL 목록"
},
"actions": {
"open": "{{name}} 작업",
diff --git a/packages/views/locales/zh-Hans/issues.json b/packages/views/locales/zh-Hans/issues.json
index cfc309dba7..61877ceb6f 100644
--- a/packages/views/locales/zh-Hans/issues.json
+++ b/packages/views/locales/zh-Hans/issues.json
@@ -827,9 +827,11 @@
"false_label": "否",
"value_placeholder": "输入值…",
"url_placeholder": "https://…",
+ "url_scheme_required": "URL 必须以 http:// 或 https:// 开头。",
"number_placeholder": "0",
"actor_search_placeholder": "搜索成员…",
"open_link": "打开链接",
+ "remove_item": "移除 {{value}}",
"archived_hint": "已归档属性——值为只读",
"unknown_value": "无法显示",
"unknown_value_hint": "该值由更新版本的 Multica 设置,当前版本无法编辑——请更新应用,或清除该值",
diff --git a/packages/views/locales/zh-Hans/settings.json b/packages/views/locales/zh-Hans/settings.json
index f92c7a0cae..9076af0977 100644
--- a/packages/views/locales/zh-Hans/settings.json
+++ b/packages/views/locales/zh-Hans/settings.json
@@ -540,7 +540,9 @@
"checkbox": "勾选",
"url": "链接",
"actor": "成员",
- "multi_actor": "成员(多选)"
+ "multi_actor": "成员(多选)",
+ "multi_text": "文本列表",
+ "multi_url": "链接列表"
},
"actions": {
"open": "{{name}} 的操作",
diff --git a/packages/views/settings/components/properties-tab.tsx b/packages/views/settings/components/properties-tab.tsx
index 9d0605a9c0..247dd0456c 100644
--- a/packages/views/settings/components/properties-tab.tsx
+++ b/packages/views/settings/components/properties-tab.tsx
@@ -353,6 +353,10 @@ export function PropertyTypeLabel({ type }: { type: string }) {
return <>{t(($) => $.properties.types.actor)}</>;
case "multi_actor":
return <>{t(($) => $.properties.types.multi_actor)}</>;
+ case "multi_text":
+ return <>{t(($) => $.properties.types.multi_text)}</>;
+ case "multi_url":
+ return <>{t(($) => $.properties.types.multi_url)}</>;
default:
// Forward compat: newer servers may ship types this build doesn't know.
return <>{type}</>;
diff --git a/server/cmd/multica/cmd_issue.go b/server/cmd/multica/cmd_issue.go
index 0b9dfee3b1..5af1550d16 100644
--- a/server/cmd/multica/cmd_issue.go
+++ b/server/cmd/multica/cmd_issue.go
@@ -255,7 +255,13 @@ var issueChildrenCmd = &cobra.Command{
var issueCreateCmd = &cobra.Command{
Use: "create",
Short: "Create a new issue",
- RunE: runIssueCreate,
+ Long: `Create a new issue. Use --property "Name=Value" to set a custom property
+atomically with creation (repeatable, one distinct property per flag).
+For multi_text / multi_url, use a JSON array of strings when entries contain
+commas or the value starts with "["; simple entries can use comma-separated values:
+ multica issue create --title "Review specs" --property 'Aliases=["Smith, John","[draft] spec"]'
+ multica issue create --title "Read docs" --property 'Related links=["https://en.wikipedia.org/wiki/Washington,_D.C."]'`,
+ RunE: runIssueCreate,
}
var issueUpdateCmd = &cobra.Command{
@@ -632,7 +638,7 @@ func init() {
issueCreateCmd.Flags().String("output", "json", "Output format: table or json")
issueCreateCmd.Flags().StringSlice("attachment", nil, "File path(s) to attach (can be specified multiple times). Each file is uploaded and its markdown reference is appended to the description, which is what makes it render on the issue page")
issueCreateCmd.Flags().StringSlice("attachment-id", nil, "Existing attachment UUID(s) to bind to the created issue (can be specified multiple times)")
- issueCreateCmd.Flags().StringArray("property", nil, `Set a custom property atomically with creation as "Name=Value" (repeatable, one distinct property per flag). Multi-value properties use comma-separated values inside one flag. Property and option/member names are case-insensitive; UUIDs are accepted. Filter-only __none__, >=, <=, and != forms are rejected.`)
+ issueCreateCmd.Flags().StringArray("property", nil, `Set a custom property atomically with creation as "Name=Value" (repeatable, one distinct property per flag). Multi-value properties use comma-separated values; multi_text/multi_url also accept JSON arrays (required for commas in entries or values starting with "["). Property and option/member names are case-insensitive; UUIDs are accepted. Filter-only __none__, >=, <=, and != forms are rejected.`)
// issue update
issueUpdateCmd.Flags().String("title", "", "New title")
diff --git a/server/cmd/multica/cmd_issue_property_filter_test.go b/server/cmd/multica/cmd_issue_property_filter_test.go
index fff043972a..0aacf9fea6 100644
--- a/server/cmd/multica/cmd_issue_property_filter_test.go
+++ b/server/cmd/multica/cmd_issue_property_filter_test.go
@@ -358,3 +358,47 @@ func TestRunIssueListFetchesCatalogOnce(t *testing.T) {
t.Fatalf("expected one /api/issues request, got %d", len(*queries))
}
}
+
+func TestEncodeIssuePropertyListValues(t *testing.T) {
+ // Both write paths — `issue property set --value` and
+ // `issue create --property` — go through encodeIssuePropertyValue, so this
+ // covers the list-value forms for both commands.
+ multiText := propertyDTO{ID: "p-text", Name: "Aliases", Type: "multi_text"}
+ multiURL := propertyDTO{ID: "p-url", Name: "Related docs", Type: "multi_url"}
+ encode := func(property propertyDTO, raw string) ([]byte, error) {
+ return encodeIssuePropertyValue(t.Context(), nil, &memberDirectory{}, property, raw)
+ }
+
+ cases := []struct {
+ name string
+ property propertyDTO
+ raw string
+ want string
+ wantErr string
+ }{
+ {"comma form keeps simple entries", multiText, "alpha,beta", `["alpha","beta"]`, ""},
+ {"comma form skips empty tokens", multiText, "alpha, ,beta", `["alpha","beta"]`, ""},
+ {"JSON form preserves a comma in text", multiText, `["Smith, John","Doe, Jane"]`, `["Smith, John","Doe, Jane"]`, ""},
+ {"JSON form preserves a comma in a URL", multiURL, `["https://en.wikipedia.org/wiki/Washington,_D.C."]`, `["https://en.wikipedia.org/wiki/Washington,_D.C."]`, ""},
+ {"JSON form mixes both list types", multiURL, `["https://a.example/x?q=1,2","https://b.example"]`, `["https://a.example/x?q=1,2","https://b.example"]`, ""},
+ {"malformed JSON array is rejected", multiText, `["Smith, John", 7]`, "", "JSON array of strings"},
+ {"empty value is rejected", multiText, "", "", "at least one entry"},
+ }
+ for _, tc := range cases {
+ t.Run(tc.name, func(t *testing.T) {
+ got, err := encode(tc.property, tc.raw)
+ if tc.wantErr != "" {
+ if err == nil || !strings.Contains(err.Error(), tc.wantErr) {
+ t.Fatalf("encode(%q) error = %v, want containing %q", tc.raw, err, tc.wantErr)
+ }
+ return
+ }
+ if err != nil {
+ t.Fatalf("encode(%q): %v", tc.raw, err)
+ }
+ if string(got) != tc.want {
+ t.Fatalf("encode(%q) = %s, want %s", tc.raw, got, tc.want)
+ }
+ })
+ }
+}
diff --git a/server/cmd/multica/cmd_property.go b/server/cmd/multica/cmd_property.go
index fb7fb3f851..a8b911eb01 100644
--- a/server/cmd/multica/cmd_property.go
+++ b/server/cmd/multica/cmd_property.go
@@ -24,7 +24,7 @@ import (
// multica property {list|get|create|update|archive|unarchive} — workspace
// custom property definitions, and multica issue property {list|set|unset} —
// typed values on a single issue. See server/internal/handler/property.go
-// for the validation contract (9 types, 20 active definitions/workspace,
+// for the validation contract (11 types, 20 active definitions/workspace,
// owner/admin-only definition management, agents rejected on definition
// writes).
//
@@ -77,14 +77,23 @@ var propertyCreateCmd = &cobra.Command{
Use: "create",
Short: "Create a property definition (workspace owner/admin only)",
Long: `Create a property definition. Types: text, number, select, multi_select,
-date, checkbox, url, actor, multi_actor. Select types take repeatable --option
-flags:
+date, checkbox, url, actor, multi_actor, multi_text, multi_url. Select types
+take repeatable --option flags:
multica property create --name Severity --type select \
--option "Critical:#ef4444" --option "Major:#f59e0b" --option "Minor:#6b7280"
The ":#rrggbb" color suffix is optional.
The actor types hold workspace members; they take no options:
- multica property create --name Reviewer --type actor`,
+ multica property create --name Reviewer --type actor
+
+multi_text / multi_url hold free-form lists without options:
+ multica property create --name "Related links" --type multi_url
+Set their values with issue property set --value or issue create --property.
+Use comma-separated values for simple entries, or a JSON array of strings.
+JSON is required for entries containing commas or input starting with "[":
+ multica issue property set <issue-id> --name "Related links" \
+ --value '["https://en.wikipedia.org/wiki/Washington,_D.C."]'
+ multica issue property set <issue-id> --name Aliases --value '["[draft] spec"]'`,
Args: exactArgs(0),
RunE: runPropertyCreate,
}
@@ -136,7 +145,14 @@ var issuePropertySetCmd = &cobra.Command{
checkbox --value true|false
number --value 3.5
date --value 2026-07-13
- text / url --value "any string"`,
+ text / url --value "any string"
+ multi_text --value "alpha,beta" (comma-separated strings)
+ multi_url --value "https://a.example,https://b.example"
+For multi_text / multi_url, entries containing commas or input starting with
+"[" must use a JSON array of strings instead:
+ multi_url --value '["https://en.wikipedia.org/wiki/Washington,_D.C."]'
+ multi_text --value '["Smith, John","Doe, Jane"]'
+ multi_text --value '["[draft] spec"]'`,
Args: exactArgs(1),
RunE: runIssuePropertySet,
}
@@ -161,7 +177,7 @@ func init() {
propertyGetCmd.Flags().String("output", "json", "Output format: table or json")
propertyCreateCmd.Flags().String("output", "table", "Output format: table or json")
propertyCreateCmd.Flags().String("name", "", "Property name (required)")
- propertyCreateCmd.Flags().String("type", "", "Property type: text, number, select, multi_select, date, checkbox, url, actor, multi_actor (required)")
+ propertyCreateCmd.Flags().String("type", "", "Property type: text, number, select, multi_select, date, checkbox, url, actor, multi_actor, multi_text, multi_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)`)
@@ -574,6 +590,29 @@ func encodeIssuePropertyValue(ctx context.Context, client *cli.APIClient, direct
return nil, fmt.Errorf("--value must list at least one member")
}
return json.Marshal(refs)
+ case "multi_text", "multi_url":
+ // JSON array form first: it round-trips every entry the API accepts,
+ // including ones that contain commas ("Smith, John",
+ // "https://en.wikipedia.org/wiki/Washington,_D.C."), which the comma
+ // form below would split. Comma form stays for simple entries.
+ if strings.HasPrefix(raw, "[") {
+ var items []string
+ if err := json.Unmarshal([]byte(raw), &items); err != nil {
+ return nil, fmt.Errorf("--value must be a JSON array of strings (or a comma-separated list for entries without commas)")
+ }
+ return json.Marshal(items)
+ }
+ parts := strings.Split(raw, ",")
+ items := make([]string, 0, len(parts))
+ for _, part := range parts {
+ if trimmed := strings.TrimSpace(part); trimmed != "" {
+ items = append(items, trimmed)
+ }
+ }
+ if len(items) == 0 {
+ return nil, fmt.Errorf("--value must list at least one entry")
+ }
+ return json.Marshal(items)
case "number":
if _, err := strconv.ParseFloat(raw, 64); err != nil {
return nil, fmt.Errorf("value %q is not a valid number", raw)
@@ -660,12 +699,15 @@ func actorPropertyName(actorNames map[string]string, ref string) string {
return ref
}
-// issuePropertyDisplayValues resolves each item of a multi_select or
-// multi_actor value to its display name. The result stays index-parallel
-// with the stored array (a non-string item renders as JSON rather than being
-// dropped) and is nil for every other type or a non-array value.
+// issuePropertyDisplayValues resolves each item of a multi-value property to
+// its display string: option ids to names (multi_select), actor references to
+// member names (multi_actor), elements as-is (multi_text / multi_url). The
+// result stays index-parallel with the stored array (a non-string item renders
+// as JSON rather than being dropped) and is nil for every other type or a
+// non-array value.
func issuePropertyDisplayValues(property propertyDTO, value any, actorNames map[string]string) []string {
- if property.Type != "multi_select" && property.Type != "multi_actor" {
+ if property.Type != "multi_select" && property.Type != "multi_actor" &&
+ property.Type != "multi_text" && property.Type != "multi_url" {
return nil
}
items, ok := value.([]any)
@@ -1106,7 +1148,8 @@ func resolvePropertyFilterValue(ctx context.Context, client *cli.APIClient, dire
return "", fmt.Errorf("--property %s: value %q is not a date in YYYY-MM-DD form", property.Name, trimmed)
}
return trimmed, nil
- case "url":
+ case "url", "multi_url":
+ // One --value token matches one element exactly.
if len(trimmed) > maxPropertyURLValueLen {
return "", fmt.Errorf("--property %s: value must be %d characters or fewer", property.Name, maxPropertyURLValueLen)
}
@@ -1114,7 +1157,7 @@ func resolvePropertyFilterValue(ctx context.Context, client *cli.APIClient, dire
return "", fmt.Errorf("--property %s: value %q is not an http(s) URL", property.Name, trimmed)
}
return trimmed, nil
- case "text":
+ case "text", "multi_text":
if utf8.RuneCountInString(raw) > maxPropertyTextValueLen {
return "", fmt.Errorf("--property %s: value must be %d characters or fewer", property.Name, maxPropertyTextValueLen)
}
diff --git a/server/internal/handler/issue_table_facets.go b/server/internal/handler/issue_table_facets.go
index 58b4a1f47f..0b0481dc31 100644
--- a/server/internal/handler/issue_table_facets.go
+++ b/server/internal/handler/issue_table_facets.go
@@ -265,13 +265,15 @@ GROUP BY r.agent_id`, len(compiled.args)+1, compiled.where)
// Unset issues count under the "__none__" bucket so the filter menu's
// "No value" option carries a real count (issues without the key).
query = fmt.Sprintf(`SELECT COALESCE(i.properties ->> %s, '__none__'), COUNT(*)::bigint FROM issue i WHERE %s AND (jsonb_typeof(i.properties -> %s) = 'string' OR NOT (i.properties ? %s)) GROUP BY 1`, propertyKey, compiled.where, propertyKey, propertyKey)
- case "text", "url", "date", "number":
- // Scalar values are free-form, so grouping by distinct value would
- // return one row per observed value with no bound. The filter menu
- // only reads the "__none__" bucket for these types, so compute just
- // the two bounded buckets instead of pulling the whole value space.
- // Key existence is exact for "no value": stored values can never be
- // null or empty, so a present key is always a set value.
+ case "text", "url", "date", "number", "multi_text", "multi_url":
+ // Scalar and free-form-list values are unbounded distinct-value
+ // spaces (multi_text/multi_url enumerate arbitrary user strings),
+ // so grouping by distinct value would return one row per observed
+ // value with no bound. The filter menu only reads the "__none__"
+ // bucket for these types, so compute just the two bounded buckets
+ // instead of pulling the whole value space. Key existence is exact
+ // for "no value": stored values can never be null or empty, so a
+ // present key is always a set value.
query = fmt.Sprintf(`SELECT CASE WHEN i.properties ? %s THEN '__set__' ELSE '__none__' END, COUNT(*)::bigint FROM issue i WHERE %s GROUP BY 1`, propertyKey, compiled.where)
case "multi_select", "multi_actor":
query = fmt.Sprintf(`SELECT COALESCE(property_value.value, '__none__'), COUNT(DISTINCT i.id)::bigint FROM issue i JOIN LATERAL (SELECT jsonb_array_elements_text(CASE WHEN jsonb_typeof(i.properties -> %s) = 'array' THEN i.properties -> %s ELSE '[]'::jsonb END) AS value UNION ALL SELECT NULL WHERE NOT (i.properties ? %s)) property_value(value) ON TRUE WHERE %s GROUP BY 1`, propertyKey, propertyKey, propertyKey, compiled.where)
diff --git a/server/internal/handler/property.go b/server/internal/handler/property.go
index bbd506fcdc..d237899397 100644
--- a/server/internal/handler/property.go
+++ b/server/internal/handler/property.go
@@ -52,7 +52,7 @@ const (
maxPropertyActorValues = 20
)
-var validPropertyTypes = []string{"text", "number", "select", "multi_select", "date", "checkbox", "url", "actor", "multi_actor"}
+var validPropertyTypes = []string{"text", "number", "select", "multi_select", "date", "checkbox", "url", "actor", "multi_actor", "multi_text", "multi_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
diff --git a/server/internal/handler/property_test.go b/server/internal/handler/property_test.go
index a73d7cd9ae..137b2383cc 100644
--- a/server/internal/handler/property_test.go
+++ b/server/internal/handler/property_test.go
@@ -15,6 +15,7 @@ import (
"github.com/go-chi/chi/v5"
"github.com/google/uuid"
+ "github.com/multica-ai/multica/server/internal/issueproperty"
"github.com/multica-ai/multica/server/internal/testutil"
db "github.com/multica-ai/multica/server/pkg/db/generated"
)
@@ -313,6 +314,30 @@ func TestIssuePropertyValues(t *testing.T) {
t.Fatalf("good number: expected 200, got %d: %s", w.Code, w.Body.String())
}
+ // multi_text: duplicates dropped, caller order kept.
+ listText := createTestProperty(t, map[string]any{"name": "Aliases" + uuid.NewString()[:8], "type": "multi_text"})
+ wl := setIssuePropertyRaw(t, issueID, listText.ID, []string{"beta", "alpha", "beta"})
+ if wl.Code != http.StatusOK {
+ t.Fatalf("multi_text set: expected 200, got %d: %s", wl.Code, wl.Body.String())
+ }
+ var listResp struct {
+ Properties map[string]any `json:"properties"`
+ }
+ json.NewDecoder(wl.Body).Decode(&listResp)
+ storedList, _ := listResp.Properties[listText.ID].([]any)
+ if len(storedList) != 2 || storedList[0] != "beta" || storedList[1] != "alpha" {
+ t.Fatalf("multi_text not stored in caller order: %v", storedList)
+ }
+
+ // multi_url: entry-level http(s) validation.
+ listURL := createTestProperty(t, map[string]any{"name": "Links" + uuid.NewString()[:8], "type": "multi_url"})
+ if w := setIssuePropertyRaw(t, issueID, listURL.ID, []string{"https://example.com/a", "https://example.com/b"}); w.Code != http.StatusOK {
+ t.Fatalf("good multi_url: expected 200, got %d: %s", w.Code, w.Body.String())
+ }
+ if w := setIssuePropertyRaw(t, issueID, listURL.ID, []string{"https://example.com/a", "ftp://example.com"}); w.Code != http.StatusBadRequest {
+ t.Fatalf("non-http(s) multi_url entry: expected 400, got %d", w.Code)
+ }
+
// Archived definitions reject new values but allow unset.
warch := httptest.NewRecorder()
req := newRequest("PATCH", "/api/properties/"+sel.ID, map[string]any{"archived": true})
@@ -362,6 +387,52 @@ func TestValidatePropertyValueUnit(t *testing.T) {
}
}
+func TestValidatePropertyListValuesUnit(t *testing.T) {
+ validate := func(def db.IssueProperty, raw string) ([]byte, error) {
+ return issueproperty.ValidateValue(def, json.RawMessage(raw))
+ }
+ textList := makePropertyDef("multi_text", nil)
+ if _, err := validate(textList, `[]`); err == nil {
+ t.Fatalf("empty multi_text array accepted")
+ }
+ if _, err := validate(textList, `"alpha"`); err == nil {
+ t.Fatalf("bare string into multi_text accepted")
+ }
+ if _, err := validate(textList, `["alpha", 3]`); err == nil {
+ t.Fatalf("non-string multi_text entry accepted")
+ }
+ if _, err := validate(textList, `["alpha", " "]`); err == nil {
+ t.Fatalf("blank multi_text entry accepted")
+ }
+ stored, err := validate(textList, `["alpha", "beta", "alpha"]`)
+ if err != nil {
+ t.Fatalf("valid multi_text rejected: %v", err)
+ }
+ if string(stored) != `["alpha","beta"]` {
+ t.Fatalf("multi_text not deduped in caller order: %s", stored)
+ }
+ over := make([]string, issueproperty.MaxListValues+1)
+ for i := range over {
+ over[i] = fmt.Sprintf("v%d", i)
+ }
+ overRaw, _ := json.Marshal(over)
+ if _, err := validate(textList, string(overRaw)); err == nil {
+ t.Fatalf("over-cap multi_text accepted")
+ }
+
+ urlList := makePropertyDef("multi_url", nil)
+ if _, err := validate(urlList, `["https://a.example", "javascript:alert(1)"]`); err == nil {
+ t.Fatalf("non-http(s) multi_url entry accepted")
+ }
+ stored, err = validate(urlList, `[" https://a.example/x ", "https://b.example", "https://a.example/x"]`)
+ if err != nil {
+ t.Fatalf("valid multi_url rejected: %v", err)
+ }
+ if string(stored) != `["https://a.example/x","https://b.example"]` {
+ t.Fatalf("multi_url not trimmed and deduped: %s", stored)
+ }
+}
+
func TestValidatePropertyNameReserved(t *testing.T) {
for _, name := range []string{"status", "Priority", "due date", "Due_Date", "START DATE", "labels"} {
if _, err := validatePropertyName(name); err == nil {
diff --git a/server/internal/issueproperty/value.go b/server/internal/issueproperty/value.go
index 1fc3bc3b28..42dc6d6af2 100644
--- a/server/internal/issueproperty/value.go
+++ b/server/internal/issueproperty/value.go
@@ -25,6 +25,10 @@ const (
// MaxActorValues is exported so the handler's existing focused tests can
// continue to pin the public multi-actor limit after validation moved here.
MaxActorValues = 20
+ // Free-form list values (multi_text / multi_url) are capped the same way:
+ // the whole properties bag shares one 16KB row budget, and URL entries can
+ // individually reach 2048 bytes.
+ MaxListValues = 20
)
var actorKinds = []string{"member"}
@@ -160,6 +164,63 @@ func optionsHint(config propertyConfig) string {
return strings.Join(parts, ", ")
}
+// textItem validates one text value - a single `text` value or one
+// `multi_text` element. Text keeps interior spacing as written.
+func textItem(s string) (string, error) {
+ if strings.TrimSpace(s) == "" {
+ return "", errors.New("value cannot be empty (use DELETE to unset a property)")
+ }
+ if utf8.RuneCountInString(s) > maxTextValueLen {
+ return "", fmt.Errorf("value must be %d characters or fewer", maxTextValueLen)
+ }
+ return util.SanitizeTextForPostgres(s), nil
+}
+
+// urlItem validates and canonicalizes one http(s) URL value - a single `url`
+// value or one `multi_url` element.
+func urlItem(s string) (string, error) {
+ s = strings.TrimSpace(s)
+ if len(s) > maxURLValueLen {
+ return "", fmt.Errorf("value must be %d characters or fewer", maxURLValueLen)
+ }
+ parsed, err := url.Parse(s)
+ if err != nil || (parsed.Scheme != "http" && parsed.Scheme != "https") || parsed.Host == "" {
+ return "", errors.New("value must be an http(s) URL")
+ }
+ return s, nil
+}
+
+// validateStringList validates a multi_text / multi_url value: a non-empty
+// array whose every element passes the item validator. Duplicates are dropped
+// and the caller's order preserved, mirroring multi_actor.
+func validateStringList(value any, itemValidator func(string) (string, error)) ([]byte, error) {
+ items, ok := value.([]any)
+ if !ok || len(items) == 0 {
+ return nil, errors.New("value must be a non-empty array of strings")
+ }
+ if len(items) > MaxListValues {
+ return nil, fmt.Errorf("value cannot list more than %d entries", MaxListValues)
+ }
+ seen := make(map[string]struct{}, len(items))
+ out := make([]string, 0, len(items))
+ for _, item := range items {
+ text, ok := item.(string)
+ if !ok {
+ return nil, errors.New("value must be a non-empty array of strings")
+ }
+ canonical, err := itemValidator(text)
+ if err != nil {
+ return nil, err
+ }
+ if _, duplicate := seen[canonical]; duplicate {
+ continue
+ }
+ seen[canonical] = struct{}{}
+ out = append(out, canonical)
+ }
+ return json.Marshal(out)
+}
+
// ValidateValue checks a raw JSON value against the definition's type and
// returns the canonical JSON stored by every issue-property write path.
func ValidateValue(def db.IssueProperty, raw json.RawMessage) ([]byte, error) {
@@ -181,27 +242,25 @@ func ValidateValue(def db.IssueProperty, raw json.RawMessage) ([]byte, error) {
if !ok {
return nil, errors.New("value must be a string")
}
- if strings.TrimSpace(text) == "" {
- return nil, errors.New("value cannot be empty (use DELETE to unset a property)")
- }
- if utf8.RuneCountInString(text) > maxTextValueLen {
- return nil, fmt.Errorf("value must be %d characters or fewer", maxTextValueLen)
+ item, err := textItem(text)
+ if err != nil {
+ return nil, err
}
- return json.Marshal(util.SanitizeTextForPostgres(text))
+ return json.Marshal(item)
+ case "multi_text":
+ return validateStringList(value, textItem)
case "url":
text, ok := value.(string)
if !ok {
return nil, errors.New("value must be a URL string")
}
- text = strings.TrimSpace(text)
- if len(text) > maxURLValueLen {
- return nil, fmt.Errorf("value must be %d characters or fewer", maxURLValueLen)
- }
- parsed, err := url.Parse(text)
- if err != nil || (parsed.Scheme != "http" && parsed.Scheme != "https") || parsed.Host == "" {
- return nil, errors.New("value must be an http(s) URL")
+ item, err := urlItem(text)
+ if err != nil {
+ return nil, err
}
- return json.Marshal(text)
+ return json.Marshal(item)
+ case "multi_url":
+ return validateStringList(value, urlItem)
case "number":
if _, ok := value.(float64); !ok {
return nil, errors.New("value must be a number")
diff --git a/server/internal/service/builtin_skills/multica-platform/references/issues.md b/server/internal/service/builtin_skills/multica-platform/references/issues.md
index 29a40ceab6..d460e3bcfd 100644
--- a/server/internal/service/builtin_skills/multica-platform/references/issues.md
+++ b/server/internal/service/builtin_skills/multica-platform/references/issues.md
@@ -128,8 +128,8 @@ concurrent edits. There is no CLI bulk-export or `--all` mode.
Workspaces may define custom issue properties (Severity, Environment, QA
Status, Reviewer, ...). They are the place for durable, typed issue state:
values are validated against the definition (select options, date format,
-http(s) URL, member reference), visible in the issue sidebar, and addressed
-by name.
+http(s) URL, member reference, free-form text/URL lists), visible in the
+issue sidebar, and addressed by name.
- Read what exists before writing: `multica property list` shows the catalog;
`multica issue property list <issue-id>` shows values set on the issue.
@@ -147,6 +147,14 @@ multica issue property unset <issue-id> --name Environment
workspace members only. `--value` takes a member name, email, UUID, short id,
or an explicit `member:<uuid>`; `multi_actor` takes a comma-separated list
(duplicates dropped, order kept, max 20).
+- `multi_text` / `multi_url` properties hold free-form lists: `--value` is a
+ comma-separated list of strings / http(s) URLs (empty entries skipped,
+ duplicates dropped, order kept, max 20). They take no options. An entry that
+ itself contains a comma cannot survive that form — pass a JSON array instead:
+ `--value '["Smith, John","https://en.wikipedia.org/wiki/Washington,_D.C."]'`.
+ The array form is always safe; use it whenever any entry has a comma or the
+ input starts with `[`, for example `--value '["[draft] spec"]'`. The same
+ forms work during creation: `--property 'Aliases=["Smith, John","[draft] spec"]'`.
- 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).
@@ -166,7 +174,8 @@ multica issue list --sort property:Impact --direction desc --output json
matches ANY of its values; different properties must ALL match. Values are
option names or ids (select types), `true`/`false` (checkbox), a member
name/email/id (actor types), or the value itself for text, url, number,
- and date (`YYYY-MM-DD`). The reserved value `__none__` matches
+ and date (`YYYY-MM-DD`); for `multi_text` / `multi_url` the value matches
+ any single element of the list exactly. The reserved value `__none__` matches
issues where the property is unset (works for every type; it is not
index-backed, so use it for targeted audits rather than as a default
listing filter). Only `=` is supported today; the `>=`, `<=` and `!=`
@@ -175,7 +184,7 @@ multica issue list --sort property:Impact --direction desc --output json
an ordinal scale (Low < Medium < High) sorts by meaning — and number/date/
text/url by value; issues without the property sort last either way.
Archived properties and types without an order (multi_select, checkbox,
- actor kinds) are rejected up front.
+ actor kinds, list types) are rejected up front.
- `issue list` and `issue get` return `properties` as a map of definition id
to stored value. Add `--resolve-properties` in JSON mode to get the rows
`issue property list` prints instead (name, type, stored value, display
@@ -187,8 +196,9 @@ multica issue list --status in_progress --output json --resolve-properties
multica issue get <issue-id> --resolve-properties
```
- Read `display` for a single value and `display_values` for a multi_select
- or multi_actor value; `value` keeps the stored ids.
+ Read `display` for a single value and `display_values` for a multi-value
+ property (multi_select, multi_actor, multi_text, multi_url); `value` keeps
+ the stored ids / strings.
## Status changes have server side effects
diff --git a/server/migrations/564_issue_property_list_types.down.sql b/server/migrations/564_issue_property_list_types.down.sql
new file mode 100644
index 0000000000..f05cb4ab9a
--- /dev/null
+++ b/server/migrations/564_issue_property_list_types.down.sql
@@ -0,0 +1,26 @@
+-- Restore the pre-list type allowlist.
+--
+-- Fails closed when any multi_text / multi_url definition still exists, the
+-- same stance as 341's down: rewriting or deleting those rows would destroy
+-- user data keyed by definition id. Archived definitions count too; their
+-- values stay resolvable. Convert the definitions (and the issue values keyed
+-- to them) to a pre-list type before rolling back.
+DO $$
+DECLARE
+ list_defs BIGINT;
+BEGIN
+ SELECT count(*) INTO list_defs
+ FROM issue_property
+ WHERE type IN ('multi_text', 'multi_url');
+
+ IF list_defs > 0 THEN
+ RAISE EXCEPTION 'cannot roll back 564: % multi_text/multi_url property definition(s) still exist', list_defs
+ USING HINT = 'Convert those definitions and the issue values keyed to them to a pre-list type first; this migration will not delete user data.';
+ END IF;
+END
+$$;
+
+ALTER TABLE issue_property DROP CONSTRAINT IF EXISTS issue_property_type_check;
+ALTER TABLE issue_property ADD CONSTRAINT issue_property_type_check
+ CHECK (type IN ('text', 'number', 'select', 'multi_select', 'date', 'checkbox', 'url', 'actor', 'multi_actor')) NOT VALID;
+ALTER TABLE issue_property VALIDATE CONSTRAINT issue_property_type_check;
diff --git a/server/migrations/564_issue_property_list_types.up.sql b/server/migrations/564_issue_property_list_types.up.sql
new file mode 100644
index 0000000000..8aa37cac26
--- /dev/null
+++ b/server/migrations/564_issue_property_list_types.up.sql
@@ -0,0 +1,18 @@
+-- Custom issue property list types: multi_text / multi_url.
+--
+-- Adds 'multi_text' and 'multi_url' to the type allowlist. Both store an
+-- array of free-form strings (text entries or http(s) URLs) in insertion
+-- order; validation, dedup, and the entry cap live in the handler, which is
+-- also where each element is validated exactly like a single text / url
+-- value. This constraint is only the outer guard.
+--
+-- Like the actor types (341), the values ride the existing properties jsonb
+-- bag: the @> containment filter for element-equality, the jsonb_path_ops GIN
+-- index, and the client value schema all keep working unchanged.
+--
+-- NOT VALID + VALIDATE keeps the ACCESS EXCLUSIVE lock instantaneous;
+-- existing rows cannot carry the new types, so validation is a formality.
+ALTER TABLE issue_property DROP CONSTRAINT IF EXISTS issue_property_type_check;
+ALTER TABLE issue_property ADD CONSTRAINT issue_property_type_check
+ CHECK (type IN ('text', 'number', 'select', 'multi_select', 'date', 'checkbox', 'url', 'actor', 'multi_actor', 'multi_text', 'multi_url')) NOT VALID;
+ALTER TABLE issue_property VALIDATE CONSTRAINT issue_property_type_check;
diff --git a/server/pkg/agent/zeroclaw_test.go b/server/pkg/agent/zeroclaw_test.go
index b8d7d98077..16db5852ce 100644
--- a/server/pkg/agent/zeroclaw_test.go
+++ b/server/pkg/agent/zeroclaw_test.go
@@ -73,9 +73,7 @@ func writeFakeZeroclawScript(t *testing.T, script string) string {
t.Helper()
dir := t.TempDir()
bin := filepath.Join(dir, "zeroclaw")
- if err := os.WriteFile(bin, []byte(script), 0755); err != nil {
- t.Fatalf("write fake zeroclaw: %v", err)
- }
+ writeTestExecutable(t, bin, []byte(script))
return bin
}