Skip to content

⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.

feat(web): edit issue properties in place on the Table, as on the Timeline (#718)

Croff473316409c3d
diff --git a/apps/web/src/features/work-items/components/shared/CellButton.tsx b/apps/web/src/features/work-items/components/shared/CellButton.tsx
new file mode 100644
index 00000000..dcd713ab
--- /dev/null
+++ b/apps/web/src/features/work-items/components/shared/CellButton.tsx
@@ -0,0 +1,12 @@
+// A cell's value as the button that opens its editor.
+export function CellButton({ children, ...props }: React.ComponentProps<'button'>) {
+ return (
+ <button
+ type="button"
+ className="-mx-1 -my-0.5 grid min-h-6 min-w-0 items-center rounded px-1 text-start hover:bg-accent"
+ {...props}
+ >
+ {children}
+ </button>
+ );
+}
diff --git a/apps/web/src/features/work-items/components/shared/CellEditor.tsx b/apps/web/src/features/work-items/components/shared/CellEditor.tsx
new file mode 100644
index 00000000..adbd6fed
--- /dev/null
+++ b/apps/web/src/features/work-items/components/shared/CellEditor.tsx
@@ -0,0 +1,20 @@
+import type { ReactNode, SyntheticEvent } from 'react';
+import { noDragProps } from '@/lib/dnd';
+
+const stopPropagation = (e: SyntheticEvent) => e.stopPropagation();
+
+// Wraps a cell's editor. A table row drags on a press and opens its issue on a
+// click; a press, a click or a key in the editor or in its popover (a portal, whose
+// events still bubble through React to the row) does neither.
+export function CellEditor({ children }: { children: ReactNode }) {
+ return (
+ <div
+ className="contents"
+ {...noDragProps}
+ onClick={stopPropagation}
+ onKeyDown={stopPropagation}
+ >
+ {children}
+ </div>
+ );
+}
diff --git a/apps/web/src/features/work-items/components/timeline/TimelineFieldPopover.tsx b/apps/web/src/features/work-items/components/shared/CustomFieldPopover.tsx
similarity index 92%
rename from apps/web/src/features/work-items/components/timeline/TimelineFieldPopover.tsx
rename to apps/web/src/features/work-items/components/shared/CustomFieldPopover.tsx
index f67468ef..34fa5232 100644
--- a/apps/web/src/features/work-items/components/timeline/TimelineFieldPopover.tsx
+++ b/apps/web/src/features/work-items/components/shared/CustomFieldPopover.tsx
@@ -6,8 +6,8 @@ import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover
import IssueCustomFieldControl from '@/features/issue/components/fields/IssueCustomFieldControl';
// The editor of a custom field that the issue panel edits in place (a url, a
-// number), opened from a timeline cell. It closes once a value is saved.
-export function TimelineFieldPopover({
+// number, a text), opened from a cell. It closes once a value is saved.
+export function CustomFieldPopover({
trigger,
field,
entry,
diff --git a/apps/web/src/features/work-items/components/timeline/TimelineBuiltinCell.tsx b/apps/web/src/features/work-items/components/shared/EditableBuiltinCell.tsx
similarity index 78%
rename from apps/web/src/features/work-items/components/timeline/TimelineBuiltinCell.tsx
rename to apps/web/src/features/work-items/components/shared/EditableBuiltinCell.tsx
index 6ef650c1..a930f885 100644
--- a/apps/web/src/features/work-items/components/timeline/TimelineBuiltinCell.tsx
+++ b/apps/web/src/features/work-items/components/shared/EditableBuiltinCell.tsx
@@ -1,6 +1,6 @@
+import type { ReactNode } from 'react';
import type { ProjectDetail } from '@/lib/api/endpoints/projects';
import type { Issue, IssuePatch } from '@/lib/api/endpoints/issues';
-import { type Maps } from '@/utils/project';
import { parseDate } from '@/utils/dates';
import AssigneeSelect from '@/components/common/fields/AssigneeSelect';
import DatePill from '@/components/common/fields/DatePill';
@@ -12,39 +12,40 @@ import CycleSelect from '@/features/issue/components/fields/CycleSelect';
import DelegateSelect from '@/features/issue/components/fields/DelegateSelect';
import InitiativeSelect from '@/features/issue/components/fields/InitiativeSelect';
import { type TableColumn } from '../../utils/table';
-import { PersonValue } from '../shared/PersonValue';
-import { TableBuiltinCell } from '../table/TableBuiltinCell';
-import { TimelineCellButton } from './TimelineCellButton';
+import { CellButton } from './CellButton';
+import { CellEditor } from './CellEditor';
-// One built-in property cell on a timeline row. It reads like a Table cell, except
-// that the assignee and the delegate are named; when the issue can be edited, a
-// click opens the picker the issue panel uses for that field. The estimates and the
-// times are shown only.
-export function TimelineBuiltinCell({
+// One built-in property cell showing `children` as its value. When the issue can be
+// edited, a click opens the picker the issue panel uses for that field. The
+// estimates and the times are shown only.
+export function EditableBuiltinCell({
column,
issue,
project,
- maps,
readOnly,
onPatch,
+ children,
}: {
column: TableColumn;
issue: Issue;
project: ProjectDetail;
- maps: Maps;
readOnly: boolean;
onPatch: (patch: IssuePatch) => void;
+ children: ReactNode;
}) {
- const isPerson = column === 'assignee' || column === 'delegate';
- const personId = column === 'assignee' ? issue.assigneeUserId : issue.delegateUserId;
- const value = isPerson ? (
- <PersonValue person={personId != null ? maps.assigneeById.get(personId) : undefined} />
- ) : (
- <TableBuiltinCell column={column} issue={issue} maps={maps} />
- );
- if (readOnly) return value;
- const trigger = <TimelineCellButton>{value}</TimelineCellButton>;
+ const editor = readOnly
+ ? null
+ : builtinEditor(column, issue, project, onPatch, <CellButton>{children}</CellButton>);
+ return editor ? <CellEditor>{editor}</CellEditor> : children;
+}
+function builtinEditor(
+ column: TableColumn,
+ issue: Issue,
+ project: ProjectDetail,
+ onPatch: (patch: IssuePatch) => void,
+ trigger: ReactNode,
+): ReactNode {
switch (column) {
case 'status':
return (
@@ -147,6 +148,6 @@ export function TimelineBuiltinCell({
);
}
default:
- return value;
+ return null;
}
}
diff --git a/apps/web/src/features/work-items/components/timeline/TimelineCustomCell.tsx b/apps/web/src/features/work-items/components/shared/EditableCustomCell.tsx
similarity index 78%
rename from apps/web/src/features/work-items/components/timeline/TimelineCustomCell.tsx
rename to apps/web/src/features/work-items/components/shared/EditableCustomCell.tsx
index 5de5a221..6894d306 100644
--- a/apps/web/src/features/work-items/components/timeline/TimelineCustomCell.tsx
+++ b/apps/web/src/features/work-items/components/shared/EditableCustomCell.tsx
@@ -1,5 +1,6 @@
import { CircleDashed } from 'lucide-react';
import { useTranslations } from 'next-intl';
+import type { ReactNode } from 'react';
import type { CustomField } from '@/lib/api/endpoints/customFields';
import type { Issue, IssueFieldValueInput } from '@/lib/api/endpoints/issues';
import type { ProjectDetail } from '@/lib/api/endpoints/projects';
@@ -11,13 +12,15 @@ import DateTimePill from '@/components/common/fields/DateTimePill';
import PopoverPick from '@/components/common/fields/PopoverPick';
import MemberSelect from '@/features/issue/components/fields/MemberSelect';
import { TableCustomCell } from '../table/TableCustomCell';
-import { TimelineCellButton } from './TimelineCellButton';
-import { TimelineFieldPopover } from './TimelineFieldPopover';
+import { CellButton } from './CellButton';
+import { CellEditor } from './CellEditor';
+import { CustomFieldPopover } from './CustomFieldPopover';
-// One custom field cell on a timeline row. It reads like a Table cell; when the
-// issue can be edited and its type holds the field, a click opens the field's
-// editor: the issue panel's own, or for a select the picker the other fields use.
-export function TimelineCustomCell({
+// One custom field cell. It reads like a Table cell; when the issue can be edited
+// and its type holds the field, a click opens the field's editor: the issue
+// panel's own, or for a select the picker the other fields use. A markdown field
+// is shown only.
+export function EditableCustomCell({
field,
issue,
project,
@@ -32,13 +35,43 @@ export function TimelineCustomCell({
readOnly: boolean;
onChange: (value: IssueFieldValueInput) => void;
}) {
- const t = useTranslations('issue.customFields');
const value = <TableCustomCell field={field} issue={issue} maps={maps} />;
- if (readOnly || (field.issueTypeId != null && field.issueTypeId !== issue.typeId)) return value;
+ if (
+ readOnly ||
+ field.fieldType === 'markdown' ||
+ (field.issueTypeId != null && field.issueTypeId !== issue.typeId)
+ ) {
+ return value;
+ }
+ return (
+ <CellEditor>
+ <CustomFieldEditor
+ field={field}
+ issue={issue}
+ project={project}
+ trigger={<CellButton>{value}</CellButton>}
+ onChange={onChange}
+ />
+ </CellEditor>
+ );
+}
+function CustomFieldEditor({
+ field,
+ issue,
+ project,
+ trigger,
+ onChange,
+}: {
+ field: CustomField;
+ issue: Issue;
+ project: ProjectDetail;
+ trigger: ReactNode;
+ onChange: (value: IssueFieldValueInput) => void;
+}) {
+ const t = useTranslations('issue.customFields');
const entry = issue.fieldValues.find((v) => v.fieldId === field.id);
const raw = entry?.value ?? null;
- const trigger = <TimelineCellButton>{value}</TimelineCellButton>;
switch (field.fieldType) {
case 'boolean':
@@ -123,12 +156,12 @@ export function TimelineCustomCell({
// A url cell shows its address as text: the link to open it is in the
// editor, since a link cannot sit inside the button.
return (
- <TimelineFieldPopover
+ <CustomFieldPopover
trigger={
field.fieldType === 'url' && typeof raw === 'string' && raw !== '' ? (
- <TimelineCellButton>
+ <CellButton>
<span className="truncate text-xs text-muted-foreground">{raw}</span>
- </TimelineCellButton>
+ </CellButton>
) : (
trigger
)
diff --git a/apps/web/src/features/work-items/components/table/TableBuiltinCell.tsx b/apps/web/src/features/work-items/components/table/TableBuiltinCell.tsx
index 6981041a..88b0f8f6 100644
--- a/apps/web/src/features/work-items/components/table/TableBuiltinCell.tsx
+++ b/apps/web/src/features/work-items/components/table/TableBuiltinCell.tsx
@@ -81,7 +81,7 @@ export function TableBuiltinCell({
const assignee =
issue.assigneeUserId != null ? maps.assigneeById.get(issue.assigneeUserId) : undefined;
return (
- <div className="flex justify-end">
+ <div className="flex">
{assignee ? <AssigneeAvatar name={assignee.name} image={assignee.image} /> : DASH}
</div>
);
@@ -90,7 +90,7 @@ export function TableBuiltinCell({
const delegate =
issue.delegateUserId != null ? maps.assigneeById.get(issue.delegateUserId) : undefined;
return (
- <div className="flex justify-end">
+ <div className="flex">
{delegate ? <DelegateAvatar name={delegate.name} image={delegate.image} /> : DASH}
</div>
);
diff --git a/apps/web/src/features/work-items/components/table/TableColumnHeader.tsx b/apps/web/src/features/work-items/components/table/TableColumnHeader.tsx
index 9f01756f..07d6047d 100644
--- a/apps/web/src/features/work-items/components/table/TableColumnHeader.tsx
+++ b/apps/web/src/features/work-items/components/table/TableColumnHeader.tsx
@@ -1,6 +1,5 @@
-import { User } from 'lucide-react';
import { useTranslations } from 'next-intl';
-import { cn } from '@/lib/utils';
+import { useColumnLabel } from '../../hooks/useColumnLabel';
import { columnKey, TITLE_COLUMN_KEY, type OrderedColumn } from '../../utils/table';
import { TableColumnResizer } from './TableColumnResizer';
@@ -22,6 +21,7 @@ export function TableColumnHeader({
onResizeEnd: () => void;
}) {
const t = useTranslations('workItems');
+ const columnLabel = useColumnLabel();
return (
<div
className="sticky top-0 z-10 grid items-center gap-3 border-b bg-background px-4 py-2 text-xs font-medium text-muted-foreground"
@@ -35,24 +35,10 @@ export function TableColumnHeader({
/>
</span>
{columns.map((c) => {
- // The assignee column shows avatars, so its header is a right-aligned icon
- // rather than a label; the delegate column beside it stays blank.
- const isAssignee = c.kind === 'builtin' && c.col === 'assignee';
const key = columnKey(c);
return (
- <span
- key={key}
- className={cn('relative flex min-w-0 items-center', isAssignee && 'justify-end')}
- >
- {c.kind === 'custom' ? (
- <span className="truncate">{c.field.name}</span>
- ) : c.col === 'assignee' ? (
- <User className="size-3.5" />
- ) : c.col === 'delegate' ? (
- <span />
- ) : (
- <span className="truncate">{t(`columns.${c.col}`)}</span>
- )}
+ <span key={key} className="relative flex min-w-0 items-center">
+ <span className="truncate">{columnLabel(c)}</span>
<TableColumnResizer
onResize={(width) => onResize(key, width)}
onResizeEnd={onResizeEnd}
diff --git a/apps/web/src/features/work-items/components/table/TableRow.tsx b/apps/web/src/features/work-items/components/table/TableRow.tsx
index e5825211..88b3d2eb 100644
--- a/apps/web/src/features/work-items/components/table/TableRow.tsx
+++ b/apps/web/src/features/work-items/components/table/TableRow.tsx
@@ -1,25 +1,28 @@
import { useCallback } from 'react';
import { useDndContext, useDraggable, useDroppable } from '@dnd-kit/core';
import type { ProjectDetail } from '@/lib/api/endpoints/projects';
-import type { BoardIssue } from '@/lib/api/endpoints/issues';
+import type { BoardIssue, IssuePatch } from '@/lib/api/endpoints/issues';
import { type Maps } from '@/utils/project';
+import { useSetFieldValue, useUpdateIssue } from '@/services/issues.service';
import { useIsPhone } from '@/hooks/useIsPhone';
import { usePermissions } from '@/hooks/usePermissions';
import { isBlocked } from '@/utils/issueLinks';
import { cn } from '@/lib/utils';
import IssueContextMenu from '@/features/issue/components/actions/IssueContextMenu';
import { DropLine } from '../shared/DropLine';
+import { EditableBuiltinCell } from '../shared/EditableBuiltinCell';
+import { EditableCustomCell } from '../shared/EditableCustomCell';
import { IssueIdentifier } from '../shared/IssueIdentifier';
import { SubtaskProgress } from '../shared/SubtaskProgress';
import { useSubtaskFold } from '../../context/useSubtasks';
import { columnKey, type OrderedColumn } from '../../utils/table';
import { TableBuiltinCell } from './TableBuiltinCell';
-import { TableCustomCell } from './TableCustomCell';
import { TableRowLinks } from './TableRowLinks';
import { TableRowSubtasks } from './TableRowSubtasks';
// A draggable, droppable table row. Dragging it starts a move; dropping another
-// row on it inserts before this one (onDrop). A click (no drag) opens it.
+// row on it inserts before this one (onDrop). A click (no drag) opens it, except
+// on a cell that edits the issue in place.
export function TableRow({
project,
issue,
@@ -30,6 +33,7 @@ export function TableRow({
alignTop,
gridTemplate,
dropDisabled,
+ readOnly,
onDrop,
onClick,
onOpenIssue,
@@ -48,6 +52,8 @@ export function TableRow({
// the row stops being a drop target so the pointer falls through to the section
// header, which refuses the move and explains why.
dropDisabled: boolean;
+ // In a read-only share, or without work_items edit, the cells only show values.
+ readOnly: boolean;
onDrop: (draggedId: number) => void;
onClick: () => void;
// Opens a linked issue from a sub-row.
@@ -57,6 +63,9 @@ export function TableRow({
// issue edit).
const { can } = usePermissions();
const subtasks = useSubtaskFold();
+ const updateIssue = useUpdateIssue(project.project.ref);
+ const setFieldValue = useSetFieldValue(project.project.ref);
+ const patch = (fields: IssuePatch) => updateIssue.mutate({ id: issue.id, patch: fields });
const {
setNodeRef: dragRef,
attributes,
@@ -120,9 +129,28 @@ export function TableRow({
{orderedColumns.map((c) =>
c.kind === 'builtin' ? (
- <TableBuiltinCell key={columnKey(c)} column={c.col} issue={issue} maps={maps} />
+ <EditableBuiltinCell
+ key={columnKey(c)}
+ column={c.col}
+ issue={issue}
+ project={project}
+ readOnly={readOnly}
+ onPatch={patch}
+ >
+ <TableBuiltinCell column={c.col} issue={issue} maps={maps} />
+ </EditableBuiltinCell>
) : (
- <TableCustomCell key={columnKey(c)} field={c.field} issue={issue} maps={maps} />
+ <EditableCustomCell
+ key={columnKey(c)}
+ field={c.field}
+ issue={issue}
+ project={project}
+ maps={maps}
+ readOnly={readOnly}
+ onChange={(value) =>
+ setFieldValue.mutate({ issueId: issue.id, fieldId: c.field.id, value })
+ }
+ />
),
)}
diff --git a/apps/web/src/features/work-items/components/table/TableView.tsx b/apps/web/src/features/work-items/components/table/TableView.tsx
index 46049f2e..3543cdcb 100644
--- a/apps/web/src/features/work-items/components/table/TableView.tsx
+++ b/apps/web/src/features/work-items/components/table/TableView.tsx
@@ -8,6 +8,7 @@ import {
sortIssues,
type WorkItemsViewProps,
} from '@/utils/project';
+import { usePermissions } from '@/hooks/usePermissions';
import { usePersistedSet } from '@/hooks/usePersistedSet';
import { useTableColumnWidths } from '../../hooks/useTableColumnWidths';
import { useIssueReorder } from '../../hooks/useIssueReorder';
@@ -42,6 +43,8 @@ export default function TableView({
widthScope,
}: TableViewProps) {
const groupLabels = useGroupLabels();
+ const { can } = usePermissions();
+ const cellsReadOnly = !!readOnly || !can('work_items', 'edit');
const reorder = useIssueReorder({ project, sort: settings.sort, readOnly });
const collapsed = usePersistedSet(
collapsedKey(project.project.id, settings.group, settings.subgroup),
@@ -128,6 +131,7 @@ export default function TableView({
indented={subgrouped}
gridTemplate={gridTemplate}
dropDisabled={!reorder.manualOrder && grouped}
+ readOnly={cellsReadOnly}
onDrop={(draggedId) =>
reorder.moveIssue(draggedId, item.assign, item.bucket, item.index)
}
diff --git a/apps/web/src/features/work-items/components/timeline/TimelineCellButton.tsx b/apps/web/src/features/work-items/components/timeline/TimelineCellButton.tsx
deleted file mode 100644
index 5634da10..00000000
--- a/apps/web/src/features/work-items/components/timeline/TimelineCellButton.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-// A timeline cell's value as the button that opens its editor.
-export function TimelineCellButton({ children, ...props }: React.ComponentProps<'button'>) {
- return (
- <button
- type="button"
- className="-mx-1 flex h-6 min-w-0 items-center rounded px-1 text-start hover:bg-accent"
- {...props}
- >
- {children}
- </button>
- );
-}
diff --git a/apps/web/src/features/work-items/components/timeline/TimelineCells.tsx b/apps/web/src/features/work-items/components/timeline/TimelineCells.tsx
index 25b3dc26..467eca88 100644
--- a/apps/web/src/features/work-items/components/timeline/TimelineCells.tsx
+++ b/apps/web/src/features/work-items/components/timeline/TimelineCells.tsx
@@ -2,10 +2,12 @@ import type { ProjectDetail } from '@/lib/api/endpoints/projects';
import type { Issue, IssuePatch } from '@/lib/api/endpoints/issues';
import { type Maps } from '@/utils/project';
import { useSetFieldValue, useUpdateIssue } from '@/services/issues.service';
-import { columnKey } from '../../utils/table';
+import { columnKey, type TableColumn } from '../../utils/table';
import { type TimelineColumn } from '../../utils/timeline';
-import { TimelineBuiltinCell } from './TimelineBuiltinCell';
-import { TimelineCustomCell } from './TimelineCustomCell';
+import { EditableBuiltinCell } from '../shared/EditableBuiltinCell';
+import { EditableCustomCell } from '../shared/EditableCustomCell';
+import { PersonValue } from '../shared/PersonValue';
+import { TableBuiltinCell } from '../table/TableBuiltinCell';
// The property cells of one timeline row, after its title. They sit outside the
// title, which drags the row and opens the issue, so an edit in a cell does neither.
@@ -33,16 +35,17 @@ export function TimelineCells({
style={{ width }}
>
{column.kind === 'builtin' ? (
- <TimelineBuiltinCell
+ <EditableBuiltinCell
column={column.col}
issue={issue}
project={project}
- maps={maps}
readOnly={readOnly}
onPatch={patch}
- />
+ >
+ <BuiltinValue column={column.col} issue={issue} maps={maps} />
+ </EditableBuiltinCell>
) : (
- <TimelineCustomCell
+ <EditableCustomCell
field={column.field}
issue={issue}
project={project}
@@ -56,3 +59,13 @@ export function TimelineCells({
</div>
));
}
+
+// A built-in value as the Table shows it, except that the assignee and the
+// delegate are named.
+function BuiltinValue({ column, issue, maps }: { column: TableColumn; issue: Issue; maps: Maps }) {
+ if (column !== 'assignee' && column !== 'delegate') {
+ return <TableBuiltinCell column={column} issue={issue} maps={maps} />;
+ }
+ const personId = column === 'assignee' ? issue.assigneeUserId : issue.delegateUserId;
+ return <PersonValue person={personId != null ? maps.assigneeById.get(personId) : undefined} />;
+}
diff --git a/apps/web/src/features/work-items/components/timeline/TimelineColumnHeader.tsx b/apps/web/src/features/work-items/components/timeline/TimelineColumnHeader.tsx
index 034010cc..e173da13 100644
--- a/apps/web/src/features/work-items/components/timeline/TimelineColumnHeader.tsx
+++ b/apps/web/src/features/work-items/components/timeline/TimelineColumnHeader.tsx
@@ -1,19 +1,13 @@
import { useTranslations } from 'next-intl';
-import { byKey } from '@/utils/messageKey';
-import { columnKey, type OrderedColumn } from '../../utils/table';
+import { useColumnLabel } from '../../hooks/useColumnLabel';
+import { columnKey } from '../../utils/table';
import { type TimelineColumn } from '../../utils/timeline';
// The labels over the label column: the title and each property column, level with
-// the day numbers and as wide as the cells below them. Unlike the Table header, a
-// person column is named, since its cells name the person.
+// the day numbers and as wide as the cells below them.
export function TimelineColumnHeader({ columns }: { columns: TimelineColumn[] }) {
const t = useTranslations('workItems');
- const property = byKey(useTranslations('display.properties'));
- const labelOf = (column: OrderedColumn): string => {
- if (column.kind === 'custom') return column.field.name;
- if (column.col === 'assignee' || column.col === 'delegate') return property(column.col);
- return t(`columns.${column.col}`);
- };
+ const columnLabel = useColumnLabel();
return (
<div className="flex h-full items-end text-xs font-medium text-muted-foreground">
@@ -26,7 +20,7 @@ export function TimelineColumnHeader({ columns }: { columns: TimelineColumn[] })
className="flex h-6 shrink-0 items-center overflow-hidden px-1.5"
style={{ width }}
>
- <span className="truncate">{labelOf(column)}</span>
+ <span className="truncate">{columnLabel(column)}</span>
</div>
))}
</div>
diff --git a/apps/web/src/features/work-items/hooks/useColumnLabel.ts b/apps/web/src/features/work-items/hooks/useColumnLabel.ts
new file mode 100644
index 00000000..c4b93bd5
--- /dev/null
+++ b/apps/web/src/features/work-items/hooks/useColumnLabel.ts
@@ -0,0 +1,15 @@
+import { useTranslations } from 'next-intl';
+import { byKey } from '@/utils/messageKey';
+import { type OrderedColumn } from '../utils/table';
+
+// `workItems.columns` has no assignee or delegate, so those two take their
+// Display panel names.
+export function useColumnLabel() {
+ const t = useTranslations('workItems');
+ const property = byKey(useTranslations('display.properties'));
+ return (column: OrderedColumn): string => {
+ if (column.kind === 'custom') return column.field.name;
+ if (column.col === 'assignee' || column.col === 'delegate') return property(column.col);
+ return t(`columns.${column.col}`);
+ };
+}
diff --git a/apps/web/src/features/work-items/utils/table.ts b/apps/web/src/features/work-items/utils/table.ts
index 69dd4613..938bcf21 100644
--- a/apps/web/src/features/work-items/utils/table.ts
+++ b/apps/web/src/features/work-items/utils/table.ts
@@ -17,17 +17,15 @@ import {
} from '@/utils/viewSettings';
// The grid columns after the (always-present) title cell. 'id' is not here — the
-// identifier renders inside the title cell. The header label of a column is a
-// message under `workItems.columns`; assignee and delegate head their avatars
-// with an icon and have none.
+// identifier renders inside the title cell.
export type TableColumn = Exclude<DisplayProperty, 'id'>;
export const COLUMN_META: Record<TableColumn, { width: string }> = {
status: { width: '130px' },
statusAge: { width: '88px' },
priority: { width: '88px' },
type: { width: '120px' },
- assignee: { width: '56px' },
- delegate: { width: '56px' },
+ assignee: { width: '88px' },
+ delegate: { width: '88px' },
initiative: { width: 'minmax(140px,220px)' },
cycle: { width: 'minmax(120px,180px)' },
labels: { width: 'minmax(120px,220px)' },