Skip to content

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

Go

fix(settings): share one catalog table across Labels, Properties and Quick Actions (MUL-9309) (#10669)

Jiayuan Zhang8f5c611699ed
diff --git a/packages/views/labels/label-manager.tsx b/packages/views/labels/label-manager.tsx
index afbae9ac07..a8e6ec4f38 100644
--- a/packages/views/labels/label-manager.tsx
+++ b/packages/views/labels/label-manager.tsx
@@ -41,7 +41,14 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
} from "@multica/ui/components/ui/dropdown-menu";
+import { cn } from "@multica/ui/lib/utils";
import { ColorPicker, COLOR_PICKER_PRESETS } from "../common/color-picker";
+import {
+ CatalogHeader,
+ CatalogRow,
+ CatalogRows,
+ CatalogTable,
+} from "../settings/components/catalog-table";
import { useLocale, useT } from "../i18n";
import { paletteColor } from "@multica/core/appearance";
@@ -113,14 +120,13 @@ export function LabelManager({ scope }: { scope: LabelScope }) {
</Button>
</div>
- <div className="overflow-hidden rounded-lg border border-surface-border bg-card">
- <div className="hidden grid-cols-[minmax(11rem,1fr)_minmax(12rem,1.4fr)_6rem_7rem_2rem] gap-4 border-b border-surface-border bg-muted/20 px-4 py-2.5 text-caption font-medium text-muted-foreground md:grid">
+ <CatalogTable columns="minmax(11rem,1fr) minmax(12rem,1.4fr) 6rem 7rem">
+ <CatalogHeader>
<span>{t(($) => $.labels.columns.name)}</span>
<span>{t(($) => $.labels.columns.description)}</span>
<span>{t(($) => $.labels.columns.usage)}</span>
<span>{t(($) => $.labels.columns.updated)}</span>
- <span />
- </div>
+ </CatalogHeader>
{isLoading ? (
<div className="px-4 py-12 text-center text-body text-muted-foreground">
@@ -136,59 +142,72 @@ export function LabelManager({ scope }: { scope: LabelScope }) {
</p>
</div>
) : (
- <div className="divide-y divide-surface-border">
+ <CatalogRows>
{filteredLabels.map((label) => (
- <div
+ <CatalogRow
key={label.id}
- className="grid gap-2 px-4 py-3 md:grid-cols-[minmax(11rem,1fr)_minmax(12rem,1.4fr)_6rem_7rem_2rem] md:items-center md:gap-4"
- >
- <div className="flex min-w-0 items-center gap-3">
- <span
- className="size-2.5 shrink-0 rounded-full"
- style={{ backgroundColor: paletteColor(label.color) }}
- />
- <span className="truncate text-body font-medium">{label.name}</span>
- </div>
- <p className="min-w-0 truncate text-caption text-muted-foreground md:text-body">
- {label.description || "—"}
- </p>
- <span className="text-caption tabular-nums text-muted-foreground md:text-body">
- {t(($) => $.labels.usage_count, { count: label.usage_count ?? 0 })}
- </span>
- <span className="text-caption text-muted-foreground">
- {new Date(label.updated_at).toLocaleDateString(locale)}
- </span>
- <DropdownMenu>
- <DropdownMenuTrigger
- render={
- <IconButton
- variant="ghost"
- size="icon-sm"
- label={t(($) => $.labels.actions.open, { name: label.name })}
- >
- <MoreHorizontal className="size-4" />
- </IconButton>
- }
- />
- <DropdownMenuContent align="end">
- <DropdownMenuItem onClick={() => setEditing(label)}>
- <Pencil className="size-4" />
- {t(($) => $.labels.actions.edit)}
- </DropdownMenuItem>
- <DropdownMenuItem
- variant="destructive"
- onClick={() => setPendingDelete(label)}
+ name={
+ <div className="flex min-w-0 items-center gap-3">
+ <span
+ className="size-2.5 shrink-0 rounded-full"
+ style={{ backgroundColor: paletteColor(label.color) }}
+ />
+ <span className="truncate text-body font-medium">{label.name}</span>
+ </div>
+ }
+ meta={
+ <>
+ {/* The "—" placeholder holds the column when wide; when
+ narrow it would only be noise on the meta line. */}
+ <p
+ className={cn(
+ "min-w-0 max-w-full truncate",
+ !label.description && "hidden @3xl/catalog:block",
+ )}
>
- <Trash2 className="size-4" />
- {t(($) => $.labels.actions.delete)}
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- </div>
+ {label.description || "—"}
+ </p>
+ <span className="tabular-nums">
+ {t(($) => $.labels.usage_count, { count: label.usage_count ?? 0 })}
+ </span>
+ <span className="text-caption">
+ {new Date(label.updated_at).toLocaleDateString(locale)}
+ </span>
+ </>
+ }
+ menu={
+ <DropdownMenu>
+ <DropdownMenuTrigger
+ render={
+ <IconButton
+ variant="ghost"
+ size="icon-sm"
+ label={t(($) => $.labels.actions.open, { name: label.name })}
+ >
+ <MoreHorizontal className="size-4" />
+ </IconButton>
+ }
+ />
+ <DropdownMenuContent align="end">
+ <DropdownMenuItem onClick={() => setEditing(label)}>
+ <Pencil className="size-4" />
+ {t(($) => $.labels.actions.edit)}
+ </DropdownMenuItem>
+ <DropdownMenuItem
+ variant="destructive"
+ onClick={() => setPendingDelete(label)}
+ >
+ <Trash2 className="size-4" />
+ {t(($) => $.labels.actions.delete)}
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ }
+ />
))}
- </div>
+ </CatalogRows>
)}
- </div>
+ </CatalogTable>
</div>
<LabelEditorDialog
diff --git a/packages/views/locales/en/settings.json b/packages/views/locales/en/settings.json
index b05cf150b8..abc450ee5e 100644
--- a/packages/views/locales/en/settings.json
+++ b/packages/views/locales/en/settings.json
@@ -726,6 +726,7 @@
"save_failed": "Couldn't save property",
"limit_hint": "{{count}}/{{max}} active properties",
"archived_badge": "Archived",
+ "options_preview": "Show all options for {{name}}",
"types": {
"text": "Text",
"number": "Number",
diff --git a/packages/views/locales/es/settings.json b/packages/views/locales/es/settings.json
index 77dcc29b59..07b5473c7a 100644
--- a/packages/views/locales/es/settings.json
+++ b/packages/views/locales/es/settings.json
@@ -726,6 +726,7 @@
"save_failed": "No se ha podido guardar la propiedad",
"limit_hint": "{{count}}/{{max}} propiedades activas",
"archived_badge": "Archivada",
+ "options_preview": "Ver todas las opciones de {{name}}",
"types": {
"text": "Texto",
"number": "Número",
diff --git a/packages/views/locales/fr/settings.json b/packages/views/locales/fr/settings.json
index a4f17a241a..a448449cac 100644
--- a/packages/views/locales/fr/settings.json
+++ b/packages/views/locales/fr/settings.json
@@ -726,6 +726,7 @@
"save_failed": "Impossible d'enregistrer la propriété",
"limit_hint": "{{count}}/{{max}} propriétés actives",
"archived_badge": "Archivée",
+ "options_preview": "Voir toutes les options de {{name}}",
"types": {
"text": "Texte",
"number": "Nombre",
diff --git a/packages/views/locales/ja/settings.json b/packages/views/locales/ja/settings.json
index 09a30d75fd..70533fc9e3 100644
--- a/packages/views/locales/ja/settings.json
+++ b/packages/views/locales/ja/settings.json
@@ -717,6 +717,7 @@
"save_failed": "プロパティを保存できませんでした",
"limit_hint": "{{count}}/{{max}} 個の有効なプロパティ",
"archived_badge": "アーカイブ済み",
+ "options_preview": "{{name}} のすべてのオプションを表示",
"types": {
"text": "テキスト",
"number": "数値",
diff --git a/packages/views/locales/ko/settings.json b/packages/views/locales/ko/settings.json
index dfe2d33b0b..6ce978078e 100644
--- a/packages/views/locales/ko/settings.json
+++ b/packages/views/locales/ko/settings.json
@@ -717,6 +717,7 @@
"save_failed": "속성을 저장하지 못했습니다",
"limit_hint": "활성 속성 {{count}}/{{max}}",
"archived_badge": "보관됨",
+ "options_preview": "{{name}}의 모든 옵션 보기",
"types": {
"text": "텍스트",
"number": "숫자",
diff --git a/packages/views/locales/ru/settings.json b/packages/views/locales/ru/settings.json
index ad09f2859e..e80019633d 100644
--- a/packages/views/locales/ru/settings.json
+++ b/packages/views/locales/ru/settings.json
@@ -741,6 +741,7 @@
"save_failed": "Не удалось сохранить свойство",
"limit_hint": "{{count}}/{{max}} активных свойств",
"archived_badge": "В архиве",
+ "options_preview": "Показать все варианты для {{name}}",
"types": {
"text": "Текст",
"number": "Число",
diff --git a/packages/views/locales/zh-Hans/settings.json b/packages/views/locales/zh-Hans/settings.json
index e2a3c67527..7f8240d297 100644
--- a/packages/views/locales/zh-Hans/settings.json
+++ b/packages/views/locales/zh-Hans/settings.json
@@ -717,6 +717,7 @@
"save_failed": "保存属性失败",
"limit_hint": "{{count}}/{{max}} 个启用中属性",
"archived_badge": "已归档",
+ "options_preview": "查看 {{name}} 的全部选项",
"types": {
"text": "文本",
"number": "数字",
diff --git a/packages/views/locales/zh-Hant/settings.json b/packages/views/locales/zh-Hant/settings.json
index ebe09d638d..d3550218a7 100644
--- a/packages/views/locales/zh-Hant/settings.json
+++ b/packages/views/locales/zh-Hant/settings.json
@@ -717,6 +717,7 @@
"save_failed": "儲存屬性失敗",
"limit_hint": "{{count}}/{{max}} 個啟用中屬性",
"archived_badge": "已歸檔",
+ "options_preview": "查看 {{name}} 的全部選項",
"types": {
"text": "文字",
"number": "數字",
diff --git a/packages/views/settings/components/catalog-table.tsx b/packages/views/settings/components/catalog-table.tsx
new file mode 100644
index 0000000000..cc9f55d18b
--- /dev/null
+++ b/packages/views/settings/components/catalog-table.tsx
@@ -0,0 +1,84 @@
+"use client";
+
+import type { CSSProperties, ReactNode } from "react";
+import { cn } from "@multica/ui/lib/utils";
+
+// The table shared by the settings catalogs of small named things: Labels,
+// Properties and Quick Actions. They read as one surface, so the header, the
+// row grid and the narrow fallback live here instead of being copied per tab.
+//
+// The breakpoint is the card's own width (`@3xl/catalog`, 48rem), not the
+// viewport: the settings column is much narrower than the window on tablets
+// and in narrow desktop windows. Below it a row is the name with the `…` menu
+// on the right, over one wrapping line of metadata. Above it the metadata
+// wrapper is `display: contents`, so each field drops into its own column.
+//
+// Cells that need a different size or visibility per layout use the same
+// `@3xl/catalog:` variant. The metadata wrapper is `text-caption` when narrow
+// and `text-body` when wide, and `contents` still passes that down.
+
+/** Track for the trailing `…` menu column, appended to every catalog. */
+const MENU_TRACK = "2rem";
+
+export function CatalogTable({
+ columns,
+ children,
+}: {
+ /** CSS `grid-template-columns` tracks for the wide layout, menu column excluded. */
+ columns: string;
+ children: ReactNode;
+}) {
+ return (
+ <div
+ className="@container/catalog overflow-hidden rounded-lg border border-surface-border bg-card"
+ style={{ "--catalog-columns": `${columns} ${MENU_TRACK}` } as CSSProperties}
+ >
+ {children}
+ </div>
+ );
+}
+
+/** Column titles, shown only in the wide layout. */
+export function CatalogHeader({ children }: { children: ReactNode }) {
+ return (
+ <div className="hidden grid-cols-(--catalog-columns) gap-4 border-b border-surface-border bg-muted/20 px-4 py-2.5 text-caption font-medium text-muted-foreground @3xl/catalog:grid">
+ {children}
+ <span />
+ </div>
+ );
+}
+
+export function CatalogRows({ children }: { children: ReactNode }) {
+ return <div className="divide-y divide-surface-border">{children}</div>;
+}
+
+export function CatalogRow({
+ name,
+ meta,
+ menu,
+ className,
+}: {
+ /** First column; also the first line when narrow. */
+ name: ReactNode;
+ /** One element per remaining column, in column order. */
+ meta: ReactNode;
+ menu?: ReactNode;
+ className?: string;
+}) {
+ return (
+ <div
+ className={cn(
+ "grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-1.5 px-4 py-3 @3xl/catalog:grid-cols-(--catalog-columns) @3xl/catalog:gap-4",
+ className,
+ )}
+ >
+ {name}
+ <div className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-caption text-muted-foreground @3xl/catalog:contents @3xl/catalog:text-body">
+ {meta}
+ </div>
+ <div className="col-[2] row-[1/span_2] @3xl/catalog:col-auto @3xl/catalog:row-auto">
+ {menu}
+ </div>
+ </div>
+ );
+}
diff --git a/packages/views/settings/components/properties-tab.test.tsx b/packages/views/settings/components/properties-tab.test.tsx
new file mode 100644
index 0000000000..c09af156be
--- /dev/null
+++ b/packages/views/settings/components/properties-tab.test.tsx
@@ -0,0 +1,82 @@
+import { afterEach, describe, expect, it, vi } from "vitest";
+import { cleanup, screen, within } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import type { IssueProperty } from "@multica/core/types";
+import { renderWithI18n } from "../../test/i18n";
+import { PropertiesTab } from "./properties-tab";
+
+const OPTION_NAMES = ["Web", "Desktop", "Daemon", "CLI", "Mobile", "Server", "Billing", "Docs"];
+
+const component: IssueProperty = {
+ id: "prop-1",
+ workspace_id: "workspace-1",
+ name: "Component",
+ type: "multi_select",
+ description: "",
+ icon: "",
+ config: {
+ options: OPTION_NAMES.map((name, i) => ({ id: `opt-${i}`, name, color: "#3b82f6" })),
+ },
+ archived: false,
+ usage_count: 0,
+ created_at: "2026-11-15T00:00:00Z",
+ updated_at: "2026-11-15T00:00:00Z",
+} as IssueProperty;
+
+vi.mock("@multica/core/hooks", () => ({
+ useWorkspaceId: () => "workspace-1",
+}));
+
+vi.mock("@multica/core/paths", () => ({
+ useCurrentWorkspace: () => ({ id: "workspace-1", name: "Acme" }),
+}));
+
+vi.mock("@multica/core/auth", () => ({
+ useAuthStore: (select: (s: { user: { id: string } }) => unknown) =>
+ select({ user: { id: "user-1" } }),
+}));
+
+vi.mock("@multica/core/workspace/queries", () => ({
+ memberListOptions: (wsId: string) => ({ queryKey: ["members", wsId] }),
+}));
+
+vi.mock("@multica/core/properties", () => ({
+ propertyListOptions: (wsId: string) => ({ queryKey: ["properties", wsId] }),
+ useCreateProperty: () => ({ mutate: vi.fn(), isPending: false }),
+ useUpdateProperty: () => ({ mutate: vi.fn(), isPending: false }),
+}));
+
+vi.mock("@tanstack/react-query", () => ({
+ queryOptions: <T,>(options: T) => options,
+ useQuery: (options: { queryKey: unknown[] }) => {
+ if (options.queryKey[0] === "members") {
+ return {
+ data: [{ user_id: "user-1", role: "member", name: "Ada" }],
+ isLoading: false,
+ };
+ }
+ return { data: [component], isLoading: false };
+ },
+}));
+
+describe("PropertiesTab options", () => {
+ afterEach(() => cleanup());
+
+ // The row shows only a few chips; the rest must stay reachable for members,
+ // who have no edit menu to open the property.
+ it("lets a member open every option from the keyboard", async () => {
+ const user = userEvent.setup();
+ renderWithI18n(<PropertiesTab />);
+
+ expect(screen.queryByRole("button", { name: "Actions for Component" })).toBeNull();
+
+ const trigger = screen.getByRole("button", { name: "Show all options for Component" });
+ trigger.focus();
+ await user.keyboard("{Enter}");
+
+ const popup = await screen.findByRole("dialog");
+ for (const name of OPTION_NAMES) {
+ expect(within(popup).getByText(name)).toBeInTheDocument();
+ }
+ });
+});
diff --git a/packages/views/settings/components/properties-tab.tsx b/packages/views/settings/components/properties-tab.tsx
index 74e2c5ce2f..6b0b82f1f2 100644
--- a/packages/views/settings/components/properties-tab.tsx
+++ b/packages/views/settings/components/properties-tab.tsx
@@ -1,6 +1,6 @@
"use client";
-import { useEffect, useMemo, useState } from "react";
+import { useEffect, useMemo, useState, type ReactNode } from "react";
import { useQuery } from "@tanstack/react-query";
import {
Archive,
@@ -79,6 +79,8 @@ import {
} from "../../common/property-icon";
import { useLocale, useT } from "../../i18n";
import { SettingsReadOnlyNotice, SettingsTab } from "./settings-layout";
+import { CatalogHeader, CatalogRow, CatalogRows, CatalogTable } from "./catalog-table";
+import { cn } from "@multica/ui/lib/utils";
import { paletteColor } from "@multica/core/appearance";
const MAX_ACTIVE_PROPERTIES = 20;
@@ -186,15 +188,14 @@ export function PropertiesTab() {
</p>
)}
- <div className="@container/properties overflow-hidden rounded-lg border border-surface-border bg-card">
- <div className="hidden grid-cols-[minmax(10rem,1fr)_6rem_minmax(10rem,1.4fr)_6rem_7rem_2rem] gap-4 border-b border-surface-border bg-muted/20 px-4 py-2.5 text-caption font-medium text-muted-foreground @min-[50rem]/properties:grid">
+ <CatalogTable columns="minmax(10rem,1fr) 6rem minmax(10rem,1.4fr) 6rem 7rem">
+ <CatalogHeader>
<span>{t(($) => $.properties.columns.name)}</span>
<span>{t(($) => $.properties.columns.type)}</span>
<span>{t(($) => $.properties.columns.options)}</span>
<span>{t(($) => $.properties.columns.usage)}</span>
<span>{t(($) => $.properties.columns.updated)}</span>
- <span />
- </div>
+ </CatalogHeader>
{isLoading ? (
<div className="px-4 py-12 text-center text-body text-muted-foreground">
@@ -215,108 +216,91 @@ export function PropertiesTab() {
)}
</div>
) : (
- <div className="divide-y divide-surface-border">
+ <CatalogRows>
{visible.map((property) => (
- <div
+ <CatalogRow
key={property.id}
- className="grid gap-2 px-4 py-3 @min-[50rem]/properties:grid-cols-[minmax(10rem,1fr)_6rem_minmax(10rem,1.4fr)_6rem_7rem_2rem] @min-[50rem]/properties:items-center @min-[50rem]/properties:gap-4"
- >
- <div className="flex min-w-0 items-center gap-2">
- <PropertyIcon property={property} />
- <span className="truncate text-body font-medium">{property.name}</span>
- {property.archived && (
- <Badge variant="outline" className="shrink-0 text-micro">
- {t(($) => $.properties.archived_badge)}
- </Badge>
- )}
- </div>
- <span className="text-caption text-muted-foreground @min-[50rem]/properties:text-body">
- <PropertyTypeLabel type={property.type} />
- </span>
- <div className="flex min-w-0 flex-wrap items-center gap-1">
- {(property.config.options ?? []).slice(0, 6).map((option) => (
- <span
- key={option.id}
- className="inline-flex items-center gap-1.5 rounded-full border border-surface-border px-2 py-0.5 text-caption"
- >
- <span
- className="size-2 rounded-full"
- style={{ backgroundColor: paletteColor(option.color) }}
- />
- {option.name}
+ name={
+ <div className="flex min-w-0 items-center gap-2">
+ <PropertyIcon property={property} />
+ <span className="truncate text-body font-medium">{property.name}</span>
+ {property.archived && (
+ <Badge variant="outline" className="shrink-0 text-micro">
+ {t(($) => $.properties.archived_badge)}
+ </Badge>
+ )}
+ </div>
+ }
+ meta={
+ <>
+ <span>
+ <PropertyTypeLabel type={property.type} />
</span>
- ))}
- {(property.config.options?.length ?? 0) > 6 && (
- <span className="text-caption text-muted-foreground">
- +{(property.config.options?.length ?? 0) - 6}
+ <PropertyOptionChips property={property} />
+ <span className="tabular-nums">
+ {t(($) => $.properties.usage_count, { count: property.usage_count ?? 0 })}
</span>
- )}
- {!typeHasOptions(property.type) && (
- <span className="text-caption text-muted-foreground">—</span>
- )}
- </div>
- <span className="text-caption tabular-nums text-muted-foreground @min-[50rem]/properties:text-body">
- {t(($) => $.properties.usage_count, { count: property.usage_count ?? 0 })}
- </span>
- <span className="text-caption text-muted-foreground">
- {new Date(property.updated_at).toLocaleDateString(locale)}
- </span>
- {canManage ? (
- <DropdownMenu>
- <DropdownMenuTrigger
- render={
- <IconButton
- variant="ghost"
- size="icon-sm"
- label={t(($) => $.properties.actions.open, { name: property.name })}
- >
- <MoreHorizontal className="size-4" />
- </IconButton>
- }
- />
- <DropdownMenuContent align="end">
- <DropdownMenuItem onClick={() => setEditing(property)}>
- <Pencil className="size-4" />
- {t(($) => $.properties.actions.edit)}
- </DropdownMenuItem>
- {property.archived ? (
- <DropdownMenuItem
- onClick={() =>
- update.mutate(
- { id: property.id, archived: false },
- {
- onError: (error) =>
- toast.error(
- error instanceof Error
- ? error.message
- : t(($) => $.properties.save_failed),
- ),
- },
- )
- }
- >
- <ArchiveRestore className="size-4" />
- {t(($) => $.properties.actions.unarchive)}
- </DropdownMenuItem>
- ) : (
- <DropdownMenuItem
- variant="destructive"
- onClick={() => setPendingArchive(property)}
- >
- <Archive className="size-4" />
- {t(($) => $.properties.actions.archive)}
+ <span className="text-caption">
+ {new Date(property.updated_at).toLocaleDateString(locale)}
+ </span>
+ </>
+ }
+ menu={
+ canManage ? (
+ <DropdownMenu>
+ <DropdownMenuTrigger
+ render={
+ <IconButton
+ variant="ghost"
+ size="icon-sm"
+ label={t(($) => $.properties.actions.open, { name: property.name })}
+ >
+ <MoreHorizontal className="size-4" />
+ </IconButton>
+ }
+ />
+ <DropdownMenuContent align="end">
+ <DropdownMenuItem onClick={() => setEditing(property)}>
+ <Pencil className="size-4" />
+ {t(($) => $.properties.actions.edit)}
</DropdownMenuItem>
- )}
- </DropdownMenuContent>
- </DropdownMenu>
- ) : (
- <span />
- )}
- </div>
+ {property.archived ? (
+ <DropdownMenuItem
+ onClick={() =>
+ update.mutate(
+ { id: property.id, archived: false },
+ {
+ onError: (error) =>
+ toast.error(
+ error instanceof Error
+ ? error.message
+ : t(($) => $.properties.save_failed),
+ ),
+ },
+ )
+ }
+ >
+ <ArchiveRestore className="size-4" />
+ {t(($) => $.properties.actions.unarchive)}
+ </DropdownMenuItem>
+ ) : (
+ <DropdownMenuItem
+ variant="destructive"
+ onClick={() => setPendingArchive(property)}
+ >
+ <Archive className="size-4" />
+ {t(($) => $.properties.actions.archive)}
+ </DropdownMenuItem>
+ )}
+ </DropdownMenuContent>
+ </DropdownMenu>
+ ) : null
+ }
+ />
))}
- </div>
+ </CatalogRows>
)}
- </div>
+ </CatalogTable>
</div>
<PropertyEditorDialog open={createOpen} onOpenChange={setCreateOpen} />
@@ -333,6 +317,91 @@ export function PropertiesTab() {
);
}
+const WIDE_OPTION_CHIPS = 6;
+const NARROW_OPTION_CHIPS = 3;
+
+function OptionChip({
+ option,
+ className,
+ children,
+}: {
+ option: IssuePropertyOption;
+ className?: string;
+ children?: ReactNode;
+}) {
+ return (
+ <span
+ className={cn(
+ "inline-flex items-center gap-1.5 rounded-full border border-surface-border px-2 py-0.5 text-caption text-foreground",
+ className,
+ )}
+ >
+ <span
+ className="size-2 shrink-0 rounded-full"
+ style={{ backgroundColor: paletteColor(option.color) }}
+ />
+ {children ?? option.name}
+ </span>
+ );
+}
+
+/**
+ * The Options column. When the catalog is narrow the chips take their own
+ * line under the rest of the metadata, show fewer, and truncate instead of
+ * wrapping, so a select with many options still fits in three lines. The cell
+ * opens a read-only list of every option, so what the row hides or cuts off
+ * stays reachable by touch and keyboard for members without the edit menu.
+ */
+function PropertyOptionChips({ property }: { property: IssueProperty }) {
+ const { t } = useT("settings");
+ if (!typeHasOptions(property.type)) {
+ return <span className="hidden text-caption @3xl/catalog:block">—</span>;
+ }
+ const options = property.config.options ?? [];
+ if (options.length === 0) return <div />;
+ const narrowRest = options.length - NARROW_OPTION_CHIPS;
+ const wideRest = options.length - WIDE_OPTION_CHIPS;
+ return (
+ <Popover>
+ <PopoverTrigger
+ aria-label={t(($) => $.properties.options_preview, { name: property.name })}
+ className="order-last flex min-w-0 basis-full cursor-pointer items-center gap-1 overflow-hidden rounded-md text-left outline-none focus-visible:ring-2 focus-visible:ring-ring @3xl/catalog:order-none @3xl/catalog:flex-wrap @3xl/catalog:overflow-visible"
+ >
+ {options.slice(0, WIDE_OPTION_CHIPS).map((option, index) => (
+ <OptionChip
+ key={option.id}
+ option={option}
+ className={cn(
+ "min-w-0 @3xl/catalog:min-w-auto",
+ index >= NARROW_OPTION_CHIPS && "hidden @3xl/catalog:inline-flex",
+ )}
+ >
+ <span className="truncate @3xl/catalog:overflow-visible @3xl/catalog:whitespace-normal">
+ {option.name}
+ </span>
+ </OptionChip>
+ ))}
+ {narrowRest > 0 && (
+ <span className="shrink-0 text-caption @3xl/catalog:hidden">+{narrowRest}</span>
+ )}
+ {wideRest > 0 && (
+ <span className="hidden text-caption @3xl/catalog:inline">+{wideRest}</span>
+ )}
+ </PopoverTrigger>
+ <PopoverContent
+ align="start"
+ className="max-h-[min(24rem,var(--available-height))] w-auto max-w-72 overflow-y-auto p-2"
+ >
+ <div className="flex flex-wrap gap-1">
+ {options.map((option) => (
+ <OptionChip key={option.id} option={option} />
+ ))}
+ </div>
+ </PopoverContent>
+ </Popover>
+ );
+}
+
export function PropertyTypeLabel({ type }: { type: string }) {
const { t } = useT("settings");
switch (type) {
diff --git a/packages/views/settings/components/quick-actions-tab.tsx b/packages/views/settings/components/quick-actions-tab.tsx
index d737337907..7cda006321 100644
--- a/packages/views/settings/components/quick-actions-tab.tsx
+++ b/packages/views/settings/components/quick-actions-tab.tsx
@@ -50,6 +50,7 @@ import {
import { cn } from "@multica/ui/lib/utils";
import { useLocale, useT } from "../../i18n";
import { SettingsTab } from "./settings-layout";
+import { CatalogHeader, CatalogRow, CatalogRows, CatalogTable } from "./catalog-table";
// Quick Actions catalog (MUL-5465).
//
@@ -59,10 +60,8 @@ import { SettingsTab } from "./settings-layout";
// where the "unused" cleanup signal belongs.
//
// Layout deliberately mirrors the Labels and Properties tabs: same search +
-// primary-action row, same bordered card, same responsive column grid, same
-// overflow menu. When the card is too narrow for the columns, a row
-// collapses to the name and menu over one wrapping meta line. These three are
-// the workspace's "catalog of small named things" and reading as one surface
+// primary-action row and the shared `CatalogTable`. These three are the
+// workspace's "catalog of small named things" and reading as one surface
// matters more than any per-tab cleverness.
const UNUSED_DAYS_THRESHOLD = 90;
@@ -229,15 +228,14 @@ export function QuickActionsTab() {
</Button>
</div>
- <div className="@container/quick-actions overflow-hidden rounded-lg border border-surface-border bg-card">
- <div className="hidden grid-cols-[minmax(10rem,1fr)_minmax(9rem,1fr)_6rem_5rem_7rem_2rem] gap-4 border-b border-surface-border bg-muted/20 px-4 py-2.5 text-caption font-medium text-muted-foreground @min-[48rem]/quick-actions:grid">
+ <CatalogTable columns="minmax(10rem,1fr) minmax(9rem,1fr) 6rem 5rem 7rem">
+ <CatalogHeader>
<span>{t(($) => $.quick_actions.columns.name)}</span>
<span>{t(($) => $.quick_actions.columns.target)}</span>
<span>{t(($) => $.quick_actions.columns.visibility)}</span>
<span>{t(($) => $.quick_actions.columns.usage)}</span>
<span>{t(($) => $.quick_actions.columns.updated)}</span>
- <span />
- </div>
+ </CatalogHeader>
{isLoading ? (
<div className="px-4 py-12 text-center text-body text-muted-foreground">
@@ -258,48 +256,43 @@ export function QuickActionsTab() {
) : null}
</div>
) : (
- <div className="divide-y divide-surface-border">
+ <CatalogRows>
{filtered.map((action) => {
const stale = isStale(action);
return (
- <div
+ <CatalogRow
key={action.id}
- className={cn(
- "grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-1.5 px-4 py-3 @min-[48rem]/quick-actions:grid-cols-[minmax(10rem,1fr)_minmax(9rem,1fr)_6rem_5rem_7rem_2rem] @min-[48rem]/quick-actions:gap-4",
- action.status !== "active" && "opacity-60",
- )}
- >
- <div className="flex min-w-0 items-center gap-2">
- <Zap className="size-3.5 shrink-0 text-muted-foreground" />
- <span className="truncate text-body font-medium">{action.name}</span>
- {action.status !== "active" ? (
- <Badge variant="outline" className="shrink-0 font-normal">
- {t(($) => $.quick_actions.archived)}
- </Badge>
- ) : null}
- </div>
- {/* One wrapping meta line when narrow; `contents` when wide so
- each field lands in its own column. */}
- <div className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-caption text-muted-foreground @min-[48rem]/quick-actions:contents">
- <div className="min-w-0 max-w-full truncate @min-[48rem]/quick-actions:text-body">
- <TargetLine action={action} t={t} />
- </div>
- <div className="min-w-0">
- <VisibilityBadge action={action} t={t} />
+ className={cn(action.status !== "active" && "opacity-60")}
+ name={
+ <div className="flex min-w-0 items-center gap-2">
+ <Zap className="size-3.5 shrink-0 text-muted-foreground" />
+ <span className="truncate text-body font-medium">{action.name}</span>
+ {action.status !== "active" ? (
+ <Badge variant="outline" className="shrink-0 font-normal">
+ {t(($) => $.quick_actions.archived)}
+ </Badge>
+ ) : null}
</div>
- <span
- className={cn(
- "tabular-nums @min-[48rem]/quick-actions:text-body",
- stale && "text-warning",
- )}
- >
- {action.use_count === 0
- ? t(($) => $.quick_actions.never_used)
- : t(($) => $.quick_actions.used_count, { count: action.use_count })}
- </span>
- <span>{new Date(action.updated_at).toLocaleDateString(locale)}</span>
- </div>
- <div className="col-[2] row-[1/span_2] @min-[48rem]/quick-actions:col-auto @min-[48rem]/quick-actions:row-auto">
+ }
+ meta={
+ <>
+ <div className="min-w-0 max-w-full truncate">
+ <TargetLine action={action} t={t} />
+ </div>
+ <div className="min-w-0">
+ <VisibilityBadge action={action} t={t} />
+ </div>
+ <span className={cn("tabular-nums", stale && "text-warning")}>
+ {action.use_count === 0
+ ? t(($) => $.quick_actions.never_used)
+ : t(($) => $.quick_actions.used_count, { count: action.use_count })}
+ </span>
+ <span className="text-caption">
+ {new Date(action.updated_at).toLocaleDateString(locale)}
+ </span>
+ </>
+ }
+ menu={
<DropdownMenu>
<DropdownMenuTrigger
render={
@@ -339,13 +332,13 @@ export function QuickActionsTab() {
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
- </div>
- </div>
+ }
+ />
);
})}
- </div>
+ </CatalogRows>
)}
- </div>
+ </CatalogTable>
</div>
<QuickActionDialog