Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
feat(issues): add start_date field with progressive disclosure (MUL-2274) (#2696)
Bohan Jiang3645bdb5b615
diff --git a/packages/core/api/schemas.ts b/packages/core/api/schemas.tsindex 79e2071b11..1aee49221f 100644--- a/packages/core/api/schemas.ts+++ b/packages/core/api/schemas.ts@@ -148,6 +148,7 @@ const IssueSchema = z.object({parent_issue_id: z.string().nullable(),project_id: z.string().nullable(),position: z.number(),+ start_date: z.string().nullable(),due_date: z.string().nullable(),reactions: z.array(z.unknown()).optional(),labels: z.array(z.unknown()).optional(),diff --git a/packages/core/issues/stores/draft-store.test.ts b/packages/core/issues/stores/draft-store.test.tsindex 3cecb6ea35..0a11121ce8 100644--- a/packages/core/issues/stores/draft-store.test.ts+++ b/packages/core/issues/stores/draft-store.test.ts@@ -9,6 +9,7 @@ const RESET_STATE = {priority: "none" as const,assigneeType: undefined,assigneeId: undefined,+ startDate: null,dueDate: null,},lastAssigneeType: undefined,diff --git a/packages/core/issues/stores/draft-store.ts b/packages/core/issues/stores/draft-store.tsindex 3e168691c2..6c284ee3d6 100644--- a/packages/core/issues/stores/draft-store.ts+++ b/packages/core/issues/stores/draft-store.ts@@ -11,6 +11,7 @@ interface IssueDraft {priority: IssuePriority;assigneeType?: IssueAssigneeType;assigneeId?: string;+ startDate: string | null;dueDate: string | null;}@@ -21,6 +22,7 @@ const EMPTY_DRAFT: IssueDraft = {priority: "none",assigneeType: undefined,assigneeId: undefined,+ startDate: null,dueDate: null,};diff --git a/packages/core/issues/stores/view-store.ts b/packages/core/issues/stores/view-store.tsindex dbcf71c27e..938768a85d 100644--- a/packages/core/issues/stores/view-store.ts+++ b/packages/core/issues/stores/view-store.ts@@ -11,13 +11,14 @@ import { defaultStorage } from "../../platform/storage";export type ViewMode = "board" | "list";export type IssueGrouping = "status" | "assignee";-export type SortField = "position" | "priority" | "due_date" | "created_at" | "title";+export type SortField = "position" | "priority" | "start_date" | "due_date" | "created_at" | "title";export type SortDirection = "asc" | "desc";export interface CardProperties {priority: boolean;description: boolean;assignee: boolean;+ startDate: boolean;dueDate: boolean;project: boolean;childProgress: boolean;@@ -32,6 +33,7 @@ export interface ActorFilterValue {export const SORT_OPTIONS: { value: SortField; label: string }[] = [{ value: "position", label: "Manual" },{ value: "priority", label: "Priority" },+ { value: "start_date", label: "Start date" },{ value: "due_date", label: "Due date" },{ value: "created_at", label: "Created date" },{ value: "title", label: "Title" },@@ -46,6 +48,7 @@ export const CARD_PROPERTY_OPTIONS: { key: keyof CardProperties; label: string }{ key: "priority", label: "Priority" },{ key: "description", label: "Description" },{ key: "assignee", label: "Assignee" },+ { key: "startDate", label: "Start date" },{ key: "dueDate", label: "Due date" },{ key: "project", label: "Project" },{ key: "labels", label: "Labels" },@@ -103,6 +106,7 @@ export const viewStoreSlice = (set: StoreApi<IssueViewState>["setState"]): Issuepriority: true,description: true,assignee: true,+ startDate: true,dueDate: true,project: true,childProgress: true,diff --git a/packages/core/issues/ws-updaters.test.ts b/packages/core/issues/ws-updaters.test.tsindex a75f9b299e..cb812b1b50 100644--- a/packages/core/issues/ws-updaters.test.ts+++ b/packages/core/issues/ws-updaters.test.ts@@ -64,6 +64,7 @@ const baseIssue: Issue = {parent_issue_id: null,project_id: null,position: 0,+ start_date: null,due_date: null,labels: [labelA],created_at: "2025-01-01T00:00:00Z",diff --git a/packages/core/types/api.ts b/packages/core/types/api.tsindex e93883b100..8576ef1047 100644--- a/packages/core/types/api.ts+++ b/packages/core/types/api.ts@@ -12,6 +12,7 @@ export interface CreateIssueRequest {assignee_id?: string;parent_issue_id?: string;project_id?: string;+ start_date?: string;due_date?: string;attachment_ids?: string[];}@@ -24,6 +25,7 @@ export interface UpdateIssueRequest {assignee_type?: IssueAssigneeType | null;assignee_id?: string | null;position?: number;+ start_date?: string | null;due_date?: string | null;parent_issue_id?: string | null;project_id?: string | null;diff --git a/packages/core/types/inbox.ts b/packages/core/types/inbox.tsindex 0d1bc1d75e..5f31b946dd 100644--- a/packages/core/types/inbox.ts+++ b/packages/core/types/inbox.ts@@ -8,6 +8,7 @@ export type InboxItemType =| "assignee_changed"| "status_changed"| "priority_changed"+ | "start_date_changed"| "due_date_changed"| "new_comment"| "mentioned"diff --git a/packages/core/types/issue.ts b/packages/core/types/issue.tsindex 9c21b948bb..9affab9820 100644--- a/packages/core/types/issue.ts+++ b/packages/core/types/issue.ts@@ -38,6 +38,7 @@ export interface Issue {parent_issue_id: string | null;project_id: string | null;position: number;+ start_date: string | null;due_date: string | null;reactions?: IssueReaction[];labels?: Label[];diff --git a/packages/views/inbox/components/inbox-detail-label.tsx b/packages/views/inbox/components/inbox-detail-label.tsxindex 7251de6a3d..d50786e95c 100644--- a/packages/views/inbox/components/inbox-detail-label.tsx+++ b/packages/views/inbox/components/inbox-detail-label.tsx@@ -18,6 +18,7 @@ export function useTypeLabels(): Record<InboxItemType, string> {assignee_changed: t(($) => $.types.assignee_changed),status_changed: t(($) => $.types.status_changed),priority_changed: t(($) => $.types.priority_changed),+ start_date_changed: t(($) => $.types.start_date_changed),due_date_changed: t(($) => $.types.due_date_changed),new_comment: t(($) => $.types.new_comment),mentioned: t(($) => $.types.mentioned),@@ -83,6 +84,10 @@ export function InboxDetailLabel({ item }: { item: InboxItem }) {}return <span>{typeLabels[item.type]}</span>;}+ case "start_date_changed": {+ if (details.to) return <span>{t(($) => $.labels.set_start_date_to, { date: shortDate(details.to) })}</span>;+ return <span>{t(($) => $.labels.removed_start_date)}</span>;+ }case "due_date_changed": {if (details.to) return <span>{t(($) => $.labels.set_due_date_to, { date: shortDate(details.to) })}</span>;return <span>{t(($) => $.labels.removed_due_date)}</span>;diff --git a/packages/views/issues/actions/__tests__/issue-actions-menu.test.tsx b/packages/views/issues/actions/__tests__/issue-actions-menu.test.tsxindex 3be2799dc2..345a98bc3a 100644--- a/packages/views/issues/actions/__tests__/issue-actions-menu.test.tsx+++ b/packages/views/issues/actions/__tests__/issue-actions-menu.test.tsx@@ -122,6 +122,7 @@ const mockIssue: Issue = {creator_type: "member",creator_id: "user-1",parent_issue_id: null,+ start_date: null,due_date: null,project_id: null,created_at: "2026-01-01T00:00:00Z",diff --git a/packages/views/issues/actions/__tests__/use-issue-actions.test.tsx b/packages/views/issues/actions/__tests__/use-issue-actions.test.tsxindex 333b68be24..7a5d62a37d 100644--- a/packages/views/issues/actions/__tests__/use-issue-actions.test.tsx+++ b/packages/views/issues/actions/__tests__/use-issue-actions.test.tsx@@ -90,6 +90,7 @@ const mockIssue: Issue = {creator_type: "member",creator_id: "user-1",parent_issue_id: null,+ start_date: null,due_date: null,project_id: null,created_at: "2026-01-01T00:00:00Z",diff --git a/packages/views/issues/actions/issue-actions-menu-items.tsx b/packages/views/issues/actions/issue-actions-menu-items.tsxindex 7890d1d25f..4d2786b553 100644--- a/packages/views/issues/actions/issue-actions-menu-items.tsx+++ b/packages/views/issues/actions/issue-actions-menu-items.tsx@@ -7,6 +7,7 @@ import {ArrowDown,ArrowUp,Calendar,+ CalendarClock,FolderOpen,Link2,MoreHorizontal,@@ -197,6 +198,33 @@ export function IssueActionsMenuItems({{t(($) => $.actions.assignee)}</P.Item>+ {/* Start date */}+ <P.Sub>+ <P.SubTrigger>+ <CalendarClock className="h-3.5 w-3.5" />+ {t(($) => $.actions.start_date)}+ </P.SubTrigger>+ <P.SubContent>+ <P.Item onClick={() => updateField({ start_date: now().toISOString() })}>+ {t(($) => $.actions.start_today)}+ </P.Item>+ <P.Item onClick={() => updateField({ start_date: inDays(1) })}>+ {t(($) => $.actions.start_tomorrow)}+ </P.Item>+ <P.Item onClick={() => updateField({ start_date: inDays(7) })}>+ {t(($) => $.actions.start_next_week)}+ </P.Item>+ {issue.start_date && (+ <>+ <P.Separator />+ <P.Item onClick={() => updateField({ start_date: null })}>+ {t(($) => $.actions.start_clear)}+ </P.Item>+ </>+ )}+ </P.SubContent>+ </P.Sub>+{/* Due date */}<P.Sub><P.SubTrigger>diff --git a/packages/views/issues/components/board-card.tsx b/packages/views/issues/components/board-card.tsxindex c5d67f5bb7..54f8b49ab9 100644--- a/packages/views/issues/components/board-card.tsx+++ b/packages/views/issues/components/board-card.tsx@@ -7,7 +7,7 @@ import type { AnimateLayoutChanges } from "@dnd-kit/sortable";import { CSS } from "@dnd-kit/utilities";import { toast } from "sonner";import type { Issue, UpdateIssueRequest } from "@multica/core/types";-import { CalendarDays } from "lucide-react";+import { CalendarClock, CalendarDays } from "lucide-react";import { useQuery } from "@tanstack/react-query";import { ActorAvatar } from "../../common/actor-avatar";import { useUpdateIssue } from "@multica/core/issues/mutations";@@ -16,7 +16,7 @@ import { useWorkspaceId } from "@multica/core/hooks";import { projectListOptions } from "@multica/core/projects/queries";import { ProjectIcon } from "../../projects/components/project-icon";import { PriorityIcon } from "./priority-icon";-import { PriorityPicker, AssigneePicker, DueDatePicker } from "./pickers";+import { PriorityPicker, AssigneePicker, StartDatePicker, DueDatePicker } from "./pickers";import { PRIORITY_CONFIG } from "@multica/core/issues/config";import { useViewStore } from "@multica/core/issues/stores/view-store-context";import { ProgressRing } from "./progress-ring";@@ -90,6 +90,7 @@ export const BoardCardContent = memo(function BoardCardContent({const showPriority = storeProperties.priority;const showDescription = storeProperties.description && issue.description;const showAssignee = storeProperties.assignee && issue.assignee_type && issue.assignee_id;+ const showStartDate = storeProperties.startDate && issue.start_date;const showDueDate = storeProperties.dueDate && issue.due_date;const showProject = storeProperties.project && project;const showChildProgress = storeProperties.childProgress && childProgress;@@ -138,8 +139,8 @@ export const BoardCardContent = memo(function BoardCardContent({);})()}- {/* Row 3: Assignee, priority badge, due date */}- {(showAssignee || showPriority || showDueDate) && (+ {/* Row 3: Assignee, priority badge, start date, due date */}+ {(showAssignee || showPriority || showStartDate || showDueDate) && (<div className="mt-3 flex items-center gap-2">{showAssignee &&(editable ? (@@ -186,6 +187,29 @@ export const BoardCardContent = memo(function BoardCardContent({{priorityCfg.label}</span>))}+ {showStartDate && (+ <div className={showDueDate ? undefined : "ml-auto"}>+ {editable ? (+ <PickerWrapper>+ <StartDatePicker+ startDate={issue.start_date}+ onUpdate={handleUpdate}+ trigger={+ <span className="flex items-center gap-1 text-xs text-muted-foreground">+ <CalendarClock className="size-3" />+ {formatDate(issue.start_date!)}+ </span>+ }+ />+ </PickerWrapper>+ ) : (+ <span className="flex items-center gap-1 text-xs text-muted-foreground">+ <CalendarClock className="size-3" />+ {formatDate(issue.start_date!)}+ </span>+ )}+ </div>+ )}{showDueDate && (<div className="ml-auto">{editable ? (diff --git a/packages/views/issues/components/index.ts b/packages/views/issues/components/index.tsindex 9165acc32a..3a4c7bd591 100644--- a/packages/views/issues/components/index.ts+++ b/packages/views/issues/components/index.ts@@ -1,7 +1,7 @@export { StatusIcon } from "./status-icon";export { StatusHeading } from "./status-heading";export { PriorityIcon } from "./priority-icon";-export { StatusPicker, PriorityPicker, AssigneePicker, canAssignAgent, DueDatePicker, LabelPicker } from "./pickers";+export { StatusPicker, PriorityPicker, AssigneePicker, canAssignAgent, StartDatePicker, DueDatePicker, LabelPicker } from "./pickers";export { IssueDetail } from "./issue-detail";export { IssuesPage } from "./issues-page";export { CommentCard } from "./comment-card";diff --git a/packages/views/issues/components/issue-detail.test.tsx b/packages/views/issues/components/issue-detail.test.tsxindex 88b830a75c..9b2775790b 100644--- a/packages/views/issues/components/issue-detail.test.tsx+++ b/packages/views/issues/components/issue-detail.test.tsx@@ -401,6 +401,7 @@ const mockIssue: Issue = {parent_issue_id: null,project_id: null,position: 0,+ start_date: null,due_date: "2026-06-01T00:00:00Z",created_at: "2026-01-15T00:00:00Z",updated_at: "2026-01-20T00:00:00Z",@@ -573,6 +574,7 @@ describe("IssueDetail (shared)", () => {mockApiObj.getIssue.mockResolvedValue({...mockIssue,priority: "none",+ start_date: null,due_date: null,});diff --git a/packages/views/issues/components/issue-detail.tsx b/packages/views/issues/components/issue-detail.tsxindex 66f076c490..8547170c33 100644--- a/packages/views/issues/components/issue-detail.tsx+++ b/packages/views/issues/components/issue-detail.tsx@@ -8,6 +8,7 @@ import { useNavigation } from "../../navigation";import {Archive,Calendar,+ CalendarClock,CalendarDays,ChevronDown,ChevronLeft,@@ -44,7 +45,7 @@ import type { Attachment, Issue, IssueStatus, IssuePriority, TimelineEntry, Updaimport { STATUS_CONFIG, PRIORITY_CONFIG } from "@multica/core/issues/config";import { useUpdateIssue } from "@multica/core/issues/mutations";import { toast } from "sonner";-import { StatusIcon, PriorityIcon, StatusPicker, PriorityPicker, DueDatePicker, AssigneePicker, LabelPicker } from ".";+import { StatusIcon, PriorityIcon, StatusPicker, PriorityPicker, StartDatePicker, DueDatePicker, AssigneePicker, LabelPicker } from ".";import { IssueActionsDropdown, useIssueActions } from "../actions";import { ProjectPicker } from "../../projects/components/project-picker";import { CommentCard } from "./comment-card";@@ -213,6 +214,11 @@ function formatActivity(if (details.from_id && !details.to_id) return t(($) => $.activity.removed_assignee);return t(($) => $.activity.changed_assignee);}+ case "start_date_changed": {+ if (!details.to) return t(($) => $.activity.start_date_removed);+ const formatted = new Date(details.to).toLocaleDateString("en-US", { month: "short", day: "numeric" });+ return t(($) => $.activity.start_date_set, { date: formatted });+ }case "due_date_changed": {if (!details.to) return t(($) => $.activity.due_date_removed);const formatted = new Date(details.to).toLocaleDateString("en-US", { month: "short", day: "numeric" });@@ -282,10 +288,10 @@ const EMPTY_REPLIES: TimelineEntry[] = [];// the Properties block, rendered only when the issue actually has a parent.//// `OPTIONAL_PROP_KEYS` is the open set — adding a new optional field-// (e.g. `start_date`) means appending here, wiring its row in the JSX-// switch below, and adding a locale key. The picker, visibility rules,-// and add-property menu all flow from this one list.-const OPTIONAL_PROP_KEYS = ["priority", "due_date", "labels"] as const;+// means appending here, wiring its row in the JSX switch below, and+// adding a locale key. The picker, visibility rules, and add-property+// menu all flow from this one list.+const OPTIONAL_PROP_KEYS = ["priority", "start_date", "due_date", "labels"] as const;type OptionalPropKey = (typeof OPTIONAL_PROP_KEYS)[number];function isOptionalPropSet(@@ -296,6 +302,8 @@ function isOptionalPropSet(switch (key) {case "priority":return issue.priority !== "none";+ case "start_date":+ return !!issue.start_date;case "due_date":return !!issue.due_date;case "labels":@@ -421,6 +429,7 @@ function ActivityBlock({const details = (entry.details ?? {}) as Record<string, string>;const isStatusChange = entry.action === "status_changed";const isPriorityChange = entry.action === "priority_changed";+ const isStartDateChange = entry.action === "start_date_changed";const isDueDateChange = entry.action === "due_date_changed";let leadIcon: React.ReactNode;@@ -428,6 +437,8 @@ function ActivityBlock({leadIcon = <StatusIcon status={details.to as IssueStatus} className="h-4 w-4 shrink-0" />;} else if (isPriorityChange && details.to) {leadIcon = <PriorityIcon priority={details.to as IssuePriority} className="h-4 w-4 shrink-0" />;+ } else if (isStartDateChange) {+ leadIcon = <CalendarClock className="h-4 w-4 shrink-0 text-muted-foreground" />;} else if (isDueDateChange) {leadIcon = <Calendar className="h-4 w-4 shrink-0 text-muted-foreground" />;} else {@@ -1233,6 +1244,15 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr/></PropRow>)}+ {visibleOptionalProps.has("start_date") && (+ <PropRow label={t(($) => $.detail.prop_start_date)}>+ <StartDatePicker+ startDate={issue.start_date}+ onUpdate={handleUpdateField}+ defaultOpen={autoOpenProp === "start_date"}+ />+ </PropRow>+ )}{visibleOptionalProps.has("due_date") && (<PropRow label={t(($) => $.detail.prop_due_date)}><DueDatePicker@@ -1280,6 +1300,9 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr{k === "priority" && (<PriorityIcon priority="medium" inheritColor className="text-muted-foreground" />)}+ {k === "start_date" && (+ <CalendarClock className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />+ )}{k === "due_date" && (<CalendarDays className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />)}@@ -1288,6 +1311,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr)}<span className="truncate">{k === "priority" && t(($) => $.detail.prop_priority)}+ {k === "start_date" && t(($) => $.detail.prop_start_date)}{k === "due_date" && t(($) => $.detail.prop_due_date)}{k === "labels" && t(($) => $.detail.prop_labels)}</span>diff --git a/packages/views/issues/components/issues-header.tsx b/packages/views/issues/components/issues-header.tsxindex 29f80e90b5..bc78e5b869 100644--- a/packages/views/issues/components/issues-header.tsx+++ b/packages/views/issues/components/issues-header.tsx@@ -568,9 +568,10 @@ export function IssueDisplayControls({ scopedIssues }: { scopedIssues: Issue[] }labelFilters,}) > 0;- const SORT_LABEL_KEY: Record<typeof SORT_OPTIONS[number]["value"], "sort_manual" | "sort_priority" | "sort_due_date" | "sort_created" | "sort_title"> = {+ const SORT_LABEL_KEY: Record<typeof SORT_OPTIONS[number]["value"], "sort_manual" | "sort_priority" | "sort_start_date" | "sort_due_date" | "sort_created" | "sort_title"> = {position: "sort_manual",priority: "sort_priority",+ start_date: "sort_start_date",due_date: "sort_due_date",created_at: "sort_created",title: "sort_title",@@ -579,10 +580,11 @@ export function IssueDisplayControls({ scopedIssues }: { scopedIssues: Issue[] }status: "group_status",assignee: "group_assignee",};- const CARD_PROPERTY_LABEL_KEY: Record<typeof CARD_PROPERTY_OPTIONS[number]["key"], "card_priority" | "card_description" | "card_assignee" | "card_due_date" | "card_project" | "card_labels" | "card_child_progress"> = {+ const CARD_PROPERTY_LABEL_KEY: Record<typeof CARD_PROPERTY_OPTIONS[number]["key"], "card_priority" | "card_description" | "card_assignee" | "card_start_date" | "card_due_date" | "card_project" | "card_labels" | "card_child_progress"> = {priority: "card_priority",description: "card_description",assignee: "card_assignee",+ startDate: "card_start_date",dueDate: "card_due_date",project: "card_project",labels: "card_labels",diff --git a/packages/views/issues/components/issues-page.test.tsx b/packages/views/issues/components/issues-page.test.tsxindex dbabd8c15d..17f92db580 100644--- a/packages/views/issues/components/issues-page.test.tsx+++ b/packages/views/issues/components/issues-page.test.tsx@@ -354,6 +354,7 @@ const mockIssues: Issue[] = [assignee_id: "user-1",creator_type: "member",creator_id: "user-1",+ start_date: null,due_date: null,created_at: "2026-01-01T00:00:00Z",updated_at: "2026-01-01T00:00:00Z",@@ -372,6 +373,7 @@ const mockIssues: Issue[] = [assignee_id: "agent-1",creator_type: "member",creator_id: "user-1",+ start_date: null,due_date: "2026-02-01T00:00:00Z",created_at: "2026-01-01T00:00:00Z",updated_at: "2026-01-01T00:00:00Z",@@ -390,6 +392,7 @@ const mockIssues: Issue[] = [assignee_id: null,creator_type: "member",creator_id: "user-1",+ start_date: null,due_date: null,created_at: "2026-01-01T00:00:00Z",updated_at: "2026-01-01T00:00:00Z",@@ -408,6 +411,7 @@ const mockIssues: Issue[] = [assignee_id: "squad-1",creator_type: "member",creator_id: "user-1",+ start_date: null,due_date: null,created_at: "2026-01-01T00:00:00Z",updated_at: "2026-01-01T00:00:00Z",diff --git a/packages/views/issues/components/list-row.tsx b/packages/views/issues/components/list-row.tsxindex 9f29c8cd02..8f1bd1966c 100644--- a/packages/views/issues/components/list-row.tsx+++ b/packages/views/issues/components/list-row.tsx@@ -50,6 +50,7 @@ export const ListRow = memo(function ListRow({const showProject = storeProperties.project && project;const showChildProgress = storeProperties.childProgress && childProgress;const showAssignee = storeProperties.assignee && issue.assignee_type && issue.assignee_id;+ const showStartDate = storeProperties.startDate && issue.start_date;const showDueDate = storeProperties.dueDate && issue.due_date;const showLabels = storeProperties.labels && labels.length > 0;@@ -110,6 +111,11 @@ export const ListRow = memo(function ListRow({<span className="truncate">{project!.title}</span></span>)}+ {showStartDate && (+ <span className="shrink-0 text-xs text-muted-foreground">+ {formatDate(issue.start_date!)}+ </span>+ )}{showDueDate && (<span className="shrink-0 text-xs text-muted-foreground">{formatDate(issue.due_date!)}diff --git a/packages/views/issues/components/pickers/index.ts b/packages/views/issues/components/pickers/index.tsindex 28622d75d8..691c15afc9 100644--- a/packages/views/issues/components/pickers/index.ts+++ b/packages/views/issues/components/pickers/index.ts@@ -2,5 +2,6 @@ export { PropertyPicker, PickerItem, PickerSection, PickerEmpty } from "./properexport { StatusPicker } from "./status-picker";export { PriorityPicker } from "./priority-picker";export { AssigneePicker, canAssignAgent } from "./assignee-picker";+export { StartDatePicker } from "./start-date-picker";export { DueDatePicker } from "./due-date-picker";export { LabelPicker } from "./label-picker";diff --git a/packages/views/issues/components/pickers/start-date-picker.tsx b/packages/views/issues/components/pickers/start-date-picker.tsxnew file mode 100644index 0000000000..b1db8d7efd--- /dev/null+++ b/packages/views/issues/components/pickers/start-date-picker.tsx@@ -0,0 +1,82 @@+"use client";++import { useState } from "react";+import { CalendarClock } from "lucide-react";+import type { UpdateIssueRequest } from "@multica/core/types";+import { Calendar } from "@multica/ui/components/ui/calendar";+import {+ Popover,+ PopoverTrigger,+ PopoverContent,+} from "@multica/ui/components/ui/popover";+import { Button } from "@multica/ui/components/ui/button";+import { useT } from "../../../i18n";++export function StartDatePicker({+ startDate,+ onUpdate,+ trigger: customTrigger,+ triggerRender,+ align = "start",+ defaultOpen = false,+}: {+ startDate: string | null;+ onUpdate: (updates: Partial<UpdateIssueRequest>) => void;+ trigger?: React.ReactNode;+ triggerRender?: React.ReactElement;+ align?: "start" | "center" | "end";+ /** Open the popover on first mount. Used by progressive-disclosure+ * sidebars so a newly-added field immediately enters edit state. */+ defaultOpen?: boolean;+}) {+ const { t } = useT("issues");+ const [open, setOpen] = useState(defaultOpen);+ const date = startDate ? new Date(startDate) : undefined;++ return (+ <Popover open={open} onOpenChange={setOpen}>+ <PopoverTrigger+ className={triggerRender ? undefined : "flex items-center gap-1.5 cursor-pointer rounded px-1 -mx-1 hover:bg-accent/30 transition-colors"}+ render={triggerRender}+ >+ {customTrigger ?? (+ <>+ <CalendarClock className="h-3.5 w-3.5 text-muted-foreground" />+ {date ? (+ <span>+ {date.toLocaleDateString("en-US", { month: "short", day: "numeric" })}+ </span>+ ) : (+ <span className="text-muted-foreground">{t(($) => $.pickers.start_date.trigger_label)}</span>+ )}+ </>+ )}+ </PopoverTrigger>+ <PopoverContent className="w-auto p-0" align={align}>+ <Calendar+ mode="single"+ selected={date}+ onSelect={(d: Date | undefined) => {+ onUpdate({ start_date: d ? d.toISOString() : null });+ setOpen(false);+ }}+ />+ {date && (+ <div className="border-t px-3 py-2">+ <Button+ variant="ghost"+ size="xs"+ onClick={() => {+ onUpdate({ start_date: null });+ setOpen(false);+ }}+ className="text-muted-foreground hover:text-foreground"+ >+ {t(($) => $.pickers.start_date.clear_action)}+ </Button>+ </div>+ )}+ </PopoverContent>+ </Popover>+ );+}diff --git a/packages/views/issues/hooks/issue-delete-mutations.test.tsx b/packages/views/issues/hooks/issue-delete-mutations.test.tsxindex fcbbc4b241..5b4f58965b 100644--- a/packages/views/issues/hooks/issue-delete-mutations.test.tsx+++ b/packages/views/issues/hooks/issue-delete-mutations.test.tsx@@ -60,6 +60,7 @@ const baseIssue: Issue = {parent_issue_id: PARENT_ISSUE_ID,project_id: null,position: 0,+ start_date: null,due_date: null,labels: [],created_at: "2026-01-01T00:00:00Z",diff --git a/packages/views/issues/utils/filter.test.ts b/packages/views/issues/utils/filter.test.tsindex bbf8913fa1..5a2ef0c8ce 100644--- a/packages/views/issues/utils/filter.test.ts+++ b/packages/views/issues/utils/filter.test.ts@@ -30,6 +30,7 @@ function makeIssue(overrides: Partial<Issue> = {}): Issue {parent_issue_id: null,project_id: null,position: 0,+ start_date: null,due_date: null,created_at: "2025-01-01T00:00:00Z",updated_at: "2025-01-01T00:00:00Z",diff --git a/packages/views/issues/utils/sort.ts b/packages/views/issues/utils/sort.tsindex c3ae59f477..065a5d99e6 100644--- a/packages/views/issues/utils/sort.ts+++ b/packages/views/issues/utils/sort.ts@@ -18,6 +18,14 @@ export function sortIssues((PRIORITY_RANK[a.priority] ?? 99) -(PRIORITY_RANK[b.priority] ?? 99));+ case "start_date": {+ if (!a.start_date && !b.start_date) return 0;+ if (!a.start_date) return 1;+ if (!b.start_date) return -1;+ return (+ new Date(a.start_date).getTime() - new Date(b.start_date).getTime()+ );+ }case "due_date": {if (!a.due_date && !b.due_date) return 0;if (!a.due_date) return 1;diff --git a/packages/views/locales/en/inbox.json b/packages/views/locales/en/inbox.jsonindex e2be2cda71..7d93bee9db 100644--- a/packages/views/locales/en/inbox.json+++ b/packages/views/locales/en/inbox.json@@ -33,6 +33,7 @@"assignee_changed": "Assignee changed","status_changed": "Status changed","priority_changed": "Priority changed",+ "start_date_changed": "Start date changed","due_date_changed": "Due date changed","new_comment": "New comment","mentioned": "Mentioned",@@ -50,6 +51,8 @@"set_priority_to": "Set priority to","assigned_to": "Assigned to {{name}}","removed_assignee": "Removed assignee",+ "set_start_date_to": "Set start date to {{date}}",+ "removed_start_date": "Removed start date","set_due_date_to": "Set due date to {{date}}","removed_due_date": "Removed due date","reacted_to_comment": "Reacted {{emoji}} to your comment",diff --git a/packages/views/locales/en/issues.json b/packages/views/locales/en/issues.jsonindex 187335df7c..f617566a14 100644--- a/packages/views/locales/en/issues.json+++ b/packages/views/locales/en/issues.json@@ -61,12 +61,14 @@"group_assignee": "Assignee","sort_manual": "Manual","sort_priority": "Priority",+ "sort_start_date": "Start date","sort_due_date": "Due date","sort_created": "Created date","sort_title": "Title","card_priority": "Priority","card_description": "Description","card_assignee": "Assignee",+ "card_start_date": "Start date","card_due_date": "Due date","card_project": "Project","card_labels": "Labels",@@ -155,6 +157,7 @@"prop_status": "Status","prop_priority": "Priority","prop_assignee": "Assignee",+ "prop_start_date": "Start date","prop_due_date": "Due date","prop_project": "Project","prop_labels": "Labels",@@ -199,6 +202,8 @@"changed_assignee": "changed assignee","status_changed": "changed status from {{from}} to {{to}}","priority_changed": "changed priority from {{from}} to {{to}}",+ "start_date_set": "set start date to {{date}}",+ "start_date_removed": "removed start date","due_date_set": "set due date to {{date}}","due_date_removed": "removed due date","title_renamed": "renamed this issue from \"{{from}}\" to \"{{to}}\"",@@ -327,6 +332,11 @@"status": "Status","priority": "Priority","assignee": "Assignee",+ "start_date": "Start date",+ "start_today": "Today",+ "start_tomorrow": "Tomorrow",+ "start_next_week": "Next week",+ "start_clear": "Clear date","due_date": "Due date","due_today": "Today","due_tomorrow": "Tomorrow",@@ -353,6 +363,10 @@"agents_group": "Agents","squads_group": "Squads"},+ "start_date": {+ "trigger_label": "Start date",+ "clear_action": "Clear date"+ },"due_date": {"trigger_label": "Due date","clear_action": "Clear date"diff --git a/packages/views/locales/zh-Hans/inbox.json b/packages/views/locales/zh-Hans/inbox.jsonindex 09c724953a..e6957f5e52 100644--- a/packages/views/locales/zh-Hans/inbox.json+++ b/packages/views/locales/zh-Hans/inbox.json@@ -33,6 +33,7 @@"assignee_changed": "分配人已更改","status_changed": "状态已更改","priority_changed": "优先级已更改",+ "start_date_changed": "开始日期已更改","due_date_changed": "截止日期已更改","new_comment": "新评论","mentioned": "提及了你",@@ -50,6 +51,8 @@"set_priority_to": "优先级设为","assigned_to": "分配给 {{name}}","removed_assignee": "移除了分配人",+ "set_start_date_to": "开始日期设为 {{date}}",+ "removed_start_date": "移除了开始日期","set_due_date_to": "截止日期设为 {{date}}","removed_due_date": "移除了截止日期","reacted_to_comment": "用 {{emoji}} 回应了你的评论",diff --git a/packages/views/locales/zh-Hans/issues.json b/packages/views/locales/zh-Hans/issues.jsonindex ea0cc074be..dab0faee67 100644--- a/packages/views/locales/zh-Hans/issues.json+++ b/packages/views/locales/zh-Hans/issues.json@@ -60,12 +60,14 @@"group_assignee": "负责人","sort_manual": "手动","sort_priority": "优先级",+ "sort_start_date": "开始日期","sort_due_date": "截止日期","sort_created": "创建时间","sort_title": "标题","card_priority": "优先级","card_description": "描述","card_assignee": "负责人",+ "card_start_date": "开始日期","card_due_date": "截止日期","card_project": "项目","card_labels": "标签",@@ -154,6 +156,7 @@"prop_status": "状态","prop_priority": "优先级","prop_assignee": "负责人",+ "prop_start_date": "开始日期","prop_due_date": "截止日期","prop_project": "项目","prop_labels": "标签",@@ -198,6 +201,8 @@"changed_assignee": "更改了负责人","status_changed": "状态从 {{from}} 改为 {{to}}","priority_changed": "优先级从 {{from}} 改为 {{to}}",+ "start_date_set": "开始日期设为 {{date}}",+ "start_date_removed": "移除了开始日期","due_date_set": "截止日期设为 {{date}}","due_date_removed": "移除了截止日期","title_renamed": "把这个 issue 从\"{{from}}\"重命名为\"{{to}}\"",@@ -318,6 +323,11 @@"status": "状态","priority": "优先级","assignee": "负责人",+ "start_date": "开始日期",+ "start_today": "今天",+ "start_tomorrow": "明天",+ "start_next_week": "下周",+ "start_clear": "清除日期","due_date": "截止日期","due_today": "今天","due_tomorrow": "明天",@@ -344,6 +354,10 @@"agents_group": "智能体","squads_group": "小队"},+ "start_date": {+ "trigger_label": "开始日期",+ "clear_action": "清除日期"+ },"due_date": {"trigger_label": "截止日期","clear_action": "清除日期"diff --git a/packages/views/modals/create-issue.test.tsx b/packages/views/modals/create-issue.test.tsxindex 998ca7060e..39085f9ea9 100644--- a/packages/views/modals/create-issue.test.tsx+++ b/packages/views/modals/create-issue.test.tsx@@ -37,6 +37,7 @@ const mockDraftStore = {priority: "none" as const,assigneeType: undefined as "agent" | "squad" | "member" | undefined,assigneeId: undefined as string | undefined,+ startDate: null,dueDate: null,},lastAssigneeType: undefined,@@ -153,6 +154,7 @@ vi.mock("../issues/components", () => ({StatusPicker: () => <div data-testid="status-picker" />,PriorityPicker: () => <div data-testid="priority-picker" />,AssigneePicker: () => <div data-testid="assignee-picker" />,+ StartDatePicker: () => <div data-testid="start-date-picker" />,DueDatePicker: () => <div data-testid="due-date-picker" />,}));@@ -294,6 +296,7 @@ describe("CreateIssueModal", () => {priority: "none",assignee_type: undefined,assignee_id: undefined,+ start_date: undefined,due_date: undefined,attachment_ids: undefined,parent_issue_id: undefined,@@ -340,6 +343,7 @@ describe("CreateIssueModal", () => {priority: "none",assignee_type: undefined,assignee_id: undefined,+ start_date: undefined,due_date: undefined,attachment_ids: undefined,parent_issue_id: undefined,@@ -357,6 +361,7 @@ describe("CreateIssueModal", () => {priority: "none",assigneeType: undefined,assigneeId: undefined,+ startDate: null,dueDate: null,});});diff --git a/packages/views/modals/create-issue.tsx b/packages/views/modals/create-issue.tsxindex 202344c63a..14979506e9 100644--- a/packages/views/modals/create-issue.tsx+++ b/packages/views/modals/create-issue.tsx@@ -32,7 +32,7 @@ import { Tooltip, TooltipTrigger, TooltipContent } from "@multica/ui/components/import { Button } from "@multica/ui/components/ui/button";import { Switch } from "@multica/ui/components/ui/switch";import { ContentEditor, type ContentEditorRef, TitleEditor, useFileDropZone, FileDropOverlay } from "../editor";-import { StatusIcon, StatusPicker, PriorityPicker, AssigneePicker, DueDatePicker } from "../issues/components";+import { StatusIcon, StatusPicker, PriorityPicker, AssigneePicker, StartDatePicker, DueDatePicker } from "../issues/components";import { BacklogAgentHintContent } from "../issues/components/backlog-agent-hint-dialog";import { ProjectPicker } from "../projects/components/project-picker";import { useCurrentWorkspace, useWorkspacePaths } from "@multica/core/paths";@@ -112,6 +112,7 @@ export function ManualCreatePanel({}return draft.assigneeId;});+ const [startDate, setStartDate] = useState<string | null>(draft.startDate);const [dueDate, setDueDate] = useState<string | null>(draft.dueDate);const [projectId, setProjectId] = useState<string | undefined>((data?.project_id as string) || undefined,@@ -151,6 +152,7 @@ export function ManualCreatePanel({setAssigneeType(type); setAssigneeId(id);setDraft({ assigneeType: type, assigneeId: id });};+ const updateStartDate = (v: string | null) => { setStartDate(v); setDraft({ startDate: v }); };const updateDueDate = (v: string | null) => { setDueDate(v); setDraft({ dueDate: v }); };const createIssueMutation = useCreateIssue();@@ -159,6 +161,7 @@ export function ManualCreatePanel({setTitle("");setStatus("todo");setPriority("none");+ setStartDate(null);setDueDate(null);setProjectId(undefined);setParentIssueId(undefined);@@ -171,6 +174,7 @@ export function ManualCreatePanel({priority: "none",assigneeType,assigneeId,+ startDate: null,dueDate: null,});descEditorRef.current?.clearContent();@@ -188,6 +192,7 @@ export function ManualCreatePanel({priority,assignee_type: assigneeType,assignee_id: assigneeId,+ start_date: startDate || undefined,due_date: dueDate || undefined,attachment_ids: attachmentIds.length > 0 ? attachmentIds : undefined,parent_issue_id: parentIssueId,@@ -414,6 +419,14 @@ export function ManualCreatePanel({align="start"/>+ {/* Start date */}+ <StartDatePicker+ startDate={startDate}+ onUpdate={(u) => updateStartDate(u.start_date ?? null)}+ triggerRender={<PillButton />}+ align="start"+ />+{/* Due date */}<DueDatePickerdueDate={dueDate}diff --git a/server/cmd/multica/cmd_issue.go b/server/cmd/multica/cmd_issue.goindex e044336f16..2a5ef921a9 100644--- a/server/cmd/multica/cmd_issue.go+++ b/server/cmd/multica/cmd_issue.go@@ -276,6 +276,7 @@ func init() {issueCreateCmd.Flags().String("assignee-id", "", "Assignee UUID — member, agent, or squad (mutually exclusive with --assignee)")issueCreateCmd.Flags().String("parent", "", "Parent issue ID")issueCreateCmd.Flags().String("project", "", "Project ID")+ issueCreateCmd.Flags().String("start-date", "", "Start date (RFC3339 format)")issueCreateCmd.Flags().String("due-date", "", "Due date (RFC3339 format)")issueCreateCmd.Flags().Bool("allow-duplicate", false, "Allow creating an issue even when an active duplicate exists")issueCreateCmd.Flags().String("output", "json", "Output format: table or json")@@ -291,6 +292,7 @@ func init() {issueUpdateCmd.Flags().String("assignee", "", "New assignee name (member, agent, or squad; fuzzy match)")issueUpdateCmd.Flags().String("assignee-id", "", "New assignee UUID — member, agent, or squad (mutually exclusive with --assignee)")issueUpdateCmd.Flags().String("project", "", "Project ID")+ issueUpdateCmd.Flags().String("start-date", "", "New start date (RFC3339 format; pass empty string to clear)")issueUpdateCmd.Flags().String("due-date", "", "New due date (RFC3339 format)")issueUpdateCmd.Flags().String("parent", "", "Parent issue ID (use --parent \"\" to clear)")issueUpdateCmd.Flags().String("output", "json", "Output format: table or json")@@ -426,9 +428,9 @@ func runIssueList(cmd *cobra.Command, _ []string) error {}fullID, _ := cmd.Flags().GetBool("full-id")- headers := []string{"KEY", "TITLE", "STATUS", "PRIORITY", "ASSIGNEE", "DUE DATE"}+ headers := []string{"KEY", "TITLE", "STATUS", "PRIORITY", "ASSIGNEE", "START DATE", "DUE DATE"}if fullID {- headers = []string{"KEY", "ID", "TITLE", "STATUS", "PRIORITY", "ASSIGNEE", "DUE DATE"}+ headers = []string{"KEY", "ID", "TITLE", "STATUS", "PRIORITY", "ASSIGNEE", "START DATE", "DUE DATE"}}actors := loadActorDisplayLookup(ctx, client)rows := make([][]string, 0, len(issuesRaw))@@ -438,6 +440,10 @@ func runIssueList(cmd *cobra.Command, _ []string) error {continue}assignee := formatAssignee(issue, actors)+ startDate := strVal(issue, "start_date")+ if startDate != "" && len(startDate) >= 10 {+ startDate = startDate[:10]+ }dueDate := strVal(issue, "due_date")if dueDate != "" && len(dueDate) >= 10 {dueDate = dueDate[:10]@@ -448,6 +454,7 @@ func runIssueList(cmd *cobra.Command, _ []string) error {strVal(issue, "status"),strVal(issue, "priority"),assignee,+ startDate,dueDate,}if fullID {@@ -458,6 +465,7 @@ func runIssueList(cmd *cobra.Command, _ []string) error {strVal(issue, "status"),strVal(issue, "priority"),assignee,+ startDate,dueDate,}}@@ -490,17 +498,22 @@ func runIssueGet(cmd *cobra.Command, args []string) error {if output == "table" {actors := loadActorDisplayLookup(ctx, client)assignee := formatAssignee(issue, actors)+ startDate := strVal(issue, "start_date")+ if startDate != "" && len(startDate) >= 10 {+ startDate = startDate[:10]+ }dueDate := strVal(issue, "due_date")if dueDate != "" && len(dueDate) >= 10 {dueDate = dueDate[:10]}- headers := []string{"KEY", "TITLE", "STATUS", "PRIORITY", "ASSIGNEE", "DUE DATE", "DESCRIPTION"}+ headers := []string{"KEY", "TITLE", "STATUS", "PRIORITY", "ASSIGNEE", "START DATE", "DUE DATE", "DESCRIPTION"}rows := [][]string{{issueDisplayKey(issue),strVal(issue, "title"),strVal(issue, "status"),strVal(issue, "priority"),assignee,+ startDate,dueDate,strVal(issue, "description"),}}@@ -568,6 +581,9 @@ func runIssueCreate(cmd *cobra.Command, _ []string) error {}body["project_id"] = project.ID}+ if v, _ := cmd.Flags().GetString("start-date"); v != "" {+ body["start_date"] = v+ }if v, _ := cmd.Flags().GetString("due-date"); v != "" {body["due_date"] = v}@@ -727,6 +743,10 @@ func runIssueUpdate(cmd *cobra.Command, args []string) error {body["project_id"] = project.ID}}+ if cmd.Flags().Changed("start-date") {+ v, _ := cmd.Flags().GetString("start-date")+ body["start_date"] = v+ }if cmd.Flags().Changed("due-date") {v, _ := cmd.Flags().GetString("due-date")body["due_date"] = vdiff --git a/server/cmd/server/activity_listeners.go b/server/cmd/server/activity_listeners.goindex 1339f46065..9af0141c9c 100644--- a/server/cmd/server/activity_listeners.go+++ b/server/cmd/server/activity_listeners.go@@ -142,6 +142,35 @@ func registerActivityListeners(bus *events.Bus, queries *db.Queries) {}}+ if startDateChanged, _ := payload["start_date_changed"].(bool); startDateChanged {+ prevStartDate := ""+ if v, ok := payload["prev_start_date"].(*string); ok && v != nil {+ prevStartDate = *v+ }+ newStartDate := ""+ if issue.StartDate != nil {+ newStartDate = *issue.StartDate+ }+ details, _ := json.Marshal(map[string]string{+ "from": prevStartDate,+ "to": newStartDate,+ })+ activity, err := queries.CreateActivity(ctx, db.CreateActivityParams{+ WorkspaceID: parseUUID(issue.WorkspaceID),+ IssueID: parseUUID(issue.ID),+ ActorType: util.StrToText(e.ActorType),+ ActorID: optionalUUID(e.ActorID),+ Action: "start_date_changed",+ Details: details,+ })+ if err != nil {+ slog.Error("activity: failed to record start date change",+ "issue_id", issue.ID, "error", err)+ } else {+ publishActivityEvent(bus, e, activity)+ }+ }+if dueDateChanged, _ := payload["due_date_changed"].(bool); dueDateChanged {prevDueDate := ""if v, ok := payload["prev_due_date"].(*string); ok && v != nil {diff --git a/server/cmd/server/notification_listeners.go b/server/cmd/server/notification_listeners.goindex fc62aed905..3133ddf2a7 100644--- a/server/cmd/server/notification_listeners.go+++ b/server/cmd/server/notification_listeners.go@@ -85,6 +85,7 @@ var notifTypeToGroup = map[string]string{"new_comment": "comments","mentioned": "comments","priority_changed": "updates",+ "start_date_changed": "updates","due_date_changed": "updates","task_completed": "agent_activity","task_failed": "agent_activity",@@ -683,6 +684,25 @@ func registerNotificationListeners(bus *events.Bus, queries *db.Queries) {priorityDetails)}+ if startDateChanged, _ := payload["start_date_changed"].(bool); startDateChanged {+ prevStartDateStr := ""+ if prevStartDate, ok := payload["prev_start_date"].(*string); ok && prevStartDate != nil {+ prevStartDateStr = *prevStartDate+ }+ newStartDateStr := ""+ if issue.StartDate != nil {+ newStartDateStr = *issue.StartDate+ }+ startDateDetails, _ := json.Marshal(map[string]string{+ "from": prevStartDateStr,+ "to": newStartDateStr,+ })+ notifySubscribers(ctx, queries, bus, issue.ID, issue.Status, e.WorkspaceID, e,+ nil, "start_date_changed", "info",+ issue.Title, "",+ startDateDetails)+ }+if dueDateChanged, _ := payload["due_date_changed"].(bool); dueDateChanged {prevDueDateStr := ""if prevDueDate, ok := payload["prev_due_date"].(*string); ok && prevDueDate != nil {diff --git a/server/cmd/server/notification_listeners_test.go b/server/cmd/server/notification_listeners_test.goindex fe5421d6d6..b63539c3f4 100644--- a/server/cmd/server/notification_listeners_test.go+++ b/server/cmd/server/notification_listeners_test.go@@ -696,6 +696,66 @@ func TestNotification_DueDateChanged(t *testing.T) {}}+// TestNotification_StartDateChanged verifies that subscribers (except the actor)+// receive a "start_date_changed" notification when an issue start date changes.+func TestNotification_StartDateChanged(t *testing.T) {+ queries := db.New(testPool)+ bus := newNotificationBus(t, queries)++ sub1Email := "[email protected]"+ sub1ID := createTestUser(t, sub1Email)+ t.Cleanup(func() { cleanupTestUser(t, sub1Email) })++ issueID := createTestIssue(t, testWorkspaceID, testUserID)+ t.Cleanup(func() {+ cleanupInboxForIssue(t, issueID)+ cleanupTestIssue(t, issueID)+ })++ addTestSubscriber(t, issueID, "member", testUserID, "creator")+ addTestSubscriber(t, issueID, "member", sub1ID, "assignee")++ startDate := "2026-04-01T00:00:00Z"+ bus.Publish(events.Event{+ Type: protocol.EventIssueUpdated,+ WorkspaceID: testWorkspaceID,+ ActorType: "member",+ ActorID: testUserID,+ Payload: map[string]any{+ "issue": handler.IssueResponse{+ ID: issueID,+ WorkspaceID: testWorkspaceID,+ Title: "start date test issue",+ Status: "todo",+ Priority: "medium",+ CreatorType: "member",+ CreatorID: testUserID,+ StartDate: &startDate,+ },+ "assignee_changed": false,+ "status_changed": false,+ "start_date_changed": true,+ },+ })++ // Actor should NOT get a notification+ actorItems := inboxItemsForRecipient(t, queries, testUserID)+ if len(actorItems) != 0 {+ t.Fatalf("expected 0 inbox items for actor, got %d", len(actorItems))+ }++ sub1Items := inboxItemsForRecipient(t, queries, sub1ID)+ if len(sub1Items) != 1 {+ t.Fatalf("expected 1 inbox item for sub1, got %d", len(sub1Items))+ }+ if sub1Items[0].Type != "start_date_changed" {+ t.Fatalf("expected type 'start_date_changed', got %q", sub1Items[0].Type)+ }+ if sub1Items[0].Severity != "info" {+ t.Fatalf("expected severity 'info', got %q", sub1Items[0].Severity)+ }+}+// TestNotification_ParentBubble_StatusChanged verifies that a status_changed// event on a sub-issue bubbles to subscribers of the parent issue.func TestNotification_ParentBubble_StatusChanged(t *testing.T) {diff --git a/server/internal/handler/issue.go b/server/internal/handler/issue.goindex a13bcc7cf7..efd7995ea6 100644--- a/server/internal/handler/issue.go+++ b/server/internal/handler/issue.go@@ -42,6 +42,7 @@ type IssueResponse struct {ParentIssueID *string `json:"parent_issue_id"`ProjectID *string `json:"project_id"`Position float64 `json:"position"`+ StartDate *string `json:"start_date"`DueDate *string `json:"due_date"`CreatedAt string `json:"created_at"`UpdatedAt string `json:"updated_at"`@@ -74,6 +75,7 @@ func issueToResponse(i db.Issue, issuePrefix string) IssueResponse {ParentIssueID: uuidToPtr(i.ParentIssueID),ProjectID: uuidToPtr(i.ProjectID),Position: i.Position,+ StartDate: timestampToPtr(i.StartDate),DueDate: timestampToPtr(i.DueDate),CreatedAt: timestampToString(i.CreatedAt),UpdatedAt: timestampToString(i.UpdatedAt),@@ -99,6 +101,7 @@ func issueListRowToResponse(i db.ListIssuesRow, issuePrefix string) IssueResponsParentIssueID: uuidToPtr(i.ParentIssueID),ProjectID: uuidToPtr(i.ProjectID),Position: i.Position,+ StartDate: timestampToPtr(i.StartDate),DueDate: timestampToPtr(i.DueDate),CreatedAt: timestampToString(i.CreatedAt),UpdatedAt: timestampToString(i.UpdatedAt),@@ -154,6 +157,7 @@ func openIssueRowToResponse(i db.ListOpenIssuesRow, issuePrefix string) IssueResParentIssueID: uuidToPtr(i.ParentIssueID),ProjectID: uuidToPtr(i.ProjectID),Position: i.Position,+ StartDate: timestampToPtr(i.StartDate),DueDate: timestampToPtr(i.DueDate),CreatedAt: timestampToString(i.CreatedAt),UpdatedAt: timestampToString(i.UpdatedAt),@@ -490,7 +494,7 @@ func buildSearchQuery(phrase string, terms []string, queryNum int, hasNum bool,query := fmt.Sprintf(`SELECT i.id, i.workspace_id, i.title, i.description, i.status, i.priority,i.assignee_type, i.assignee_id, i.creator_type, i.creator_id,i.parent_issue_id, i.acceptance_criteria, i.context_refs, i.position,- i.due_date, i.created_at, i.updated_at, i.number, i.project_id,+ i.start_date, i.due_date, i.created_at, i.updated_at, i.number, i.project_id,COUNT(*) OVER() AS total_count,%s AS match_source,%s AS matched_comment_content@@ -578,6 +582,7 @@ func (h *Handler) SearchIssues(w http.ResponseWriter, r *http.Request) {&sr.issue.AcceptanceCriteria,&sr.issue.ContextRefs,&sr.issue.Position,+ &sr.issue.StartDate,&sr.issue.DueDate,&sr.issue.CreatedAt,&sr.issue.UpdatedAt,@@ -1519,6 +1524,7 @@ type CreateIssueRequest struct {AssigneeID *string `json:"assignee_id"`ParentIssueID *string `json:"parent_issue_id"`ProjectID *string `json:"project_id"`+ StartDate *string `json:"start_date"`DueDate *string `json:"due_date"`AttachmentIDs []string `json:"attachment_ids,omitempty"`// OriginType / OriginID stamp the new issue with its provenance so@@ -1621,6 +1627,16 @@ func (h *Handler) CreateIssue(w http.ResponseWriter, r *http.Request) {return}+ var startDate pgtype.Timestamptz+ if req.StartDate != nil && *req.StartDate != "" {+ t, err := time.Parse(time.RFC3339, *req.StartDate)+ if err != nil {+ writeError(w, http.StatusBadRequest, "invalid start_date format, expected RFC3339")+ return+ }+ startDate = pgtype.Timestamptz{Time: t, Valid: true}+ }+var dueDate pgtype.Timestamptzif req.DueDate != nil && *req.DueDate != "" {t, err := time.Parse(time.RFC3339, *req.DueDate)@@ -1708,6 +1724,7 @@ func (h *Handler) CreateIssue(w http.ResponseWriter, r *http.Request) {CreatorID: parseUUID(actualCreatorID),ParentIssueID: parentIssueID,Position: 0,+ StartDate: startDate,DueDate: dueDate,Number: issueNumber,ProjectID: projectID,@@ -1727,6 +1744,7 @@ func (h *Handler) CreateIssue(w http.ResponseWriter, r *http.Request) {CreatorID: parseUUID(actualCreatorID),ParentIssueID: parentIssueID,Position: 0,+ StartDate: startDate,DueDate: dueDate,Number: issueNumber,ProjectID: projectID,@@ -1829,6 +1847,7 @@ type UpdateIssueRequest struct {AssigneeType *string `json:"assignee_type"`AssigneeID *string `json:"assignee_id"`Position *float64 `json:"position"`+ StartDate *string `json:"start_date"`DueDate *string `json:"due_date"`ParentIssueID *string `json:"parent_issue_id"`ProjectID *string `json:"project_id"`@@ -1870,6 +1889,7 @@ func (h *Handler) UpdateIssue(w http.ResponseWriter, r *http.Request) {ID: prevIssue.ID,AssigneeType: prevIssue.AssigneeType,AssigneeID: prevIssue.AssigneeID,+ StartDate: prevIssue.StartDate,DueDate: prevIssue.DueDate,ParentIssueID: prevIssue.ParentIssueID,ProjectID: prevIssue.ProjectID,@@ -1910,6 +1930,18 @@ func (h *Handler) UpdateIssue(w http.ResponseWriter, r *http.Request) {params.AssigneeID = pgtype.UUID{Valid: false} // explicit null = unassign}}+ if _, ok := rawFields["start_date"]; ok {+ if req.StartDate != nil && *req.StartDate != "" {+ t, err := time.Parse(time.RFC3339, *req.StartDate)+ if err != nil {+ writeError(w, http.StatusBadRequest, "invalid start_date format, expected RFC3339")+ return+ }+ params.StartDate = pgtype.Timestamptz{Time: t, Valid: true}+ } else {+ params.StartDate = pgtype.Timestamptz{Valid: false} // explicit null = clear date+ }+ }if _, ok := rawFields["due_date"]; ok {if req.DueDate != nil && *req.DueDate != "" {t, err := time.Parse(time.RFC3339, *req.DueDate)@@ -2011,6 +2043,9 @@ func (h *Handler) UpdateIssue(w http.ResponseWriter, r *http.Request) {priorityChanged := req.Priority != nil && prevIssue.Priority != issue.PrioritydescriptionChanged := req.Description != nil && textToPtr(prevIssue.Description) != resp.DescriptiontitleChanged := req.Title != nil && prevIssue.Title != issue.Title+ prevStartDate := timestampToPtr(prevIssue.StartDate)+ startDateChanged := prevStartDate != resp.StartDate && (prevStartDate == nil) != (resp.StartDate == nil) ||+ (prevStartDate != nil && resp.StartDate != nil && *prevStartDate != *resp.StartDate)prevDueDate := timestampToPtr(prevIssue.DueDate)dueDateChanged := prevDueDate != resp.DueDate && (prevDueDate == nil) != (resp.DueDate == nil) ||(prevDueDate != nil && resp.DueDate != nil && *prevDueDate != *resp.DueDate)@@ -2023,6 +2058,7 @@ func (h *Handler) UpdateIssue(w http.ResponseWriter, r *http.Request) {"assignee_changed": assigneeChanged,"status_changed": statusChanged,"priority_changed": priorityChanged,+ "start_date_changed": startDateChanged,"due_date_changed": dueDateChanged,"description_changed": descriptionChanged,"title_changed": titleChanged,@@ -2031,6 +2067,7 @@ func (h *Handler) UpdateIssue(w http.ResponseWriter, r *http.Request) {"prev_assignee_id": uuidToPtr(prevIssue.AssigneeID),"prev_status": prevIssue.Status,"prev_priority": prevIssue.Priority,+ "prev_start_date": prevStartDate,"prev_due_date": prevDueDate,"prev_description": textToPtr(prevIssue.Description),"creator_type": prevIssue.CreatorType,@@ -2278,7 +2315,7 @@ func (h *Handler) BatchUpdateIssues(w http.ResponseWriter, r *http.Request) {req.Updates.Priority != nil ||req.Updates.Position != nilif !hasMutation {- for _, k := range []string{"assignee_type", "assignee_id", "due_date", "parent_issue_id", "project_id"} {+ for _, k := range []string{"assignee_type", "assignee_id", "start_date", "due_date", "parent_issue_id", "project_id"} {if _, ok := rawUpdates[k]; ok {hasMutation = truebreak@@ -2313,6 +2350,7 @@ func (h *Handler) BatchUpdateIssues(w http.ResponseWriter, r *http.Request) {ID: prevIssue.ID,AssigneeType: prevIssue.AssigneeType,AssigneeID: prevIssue.AssigneeID,+ StartDate: prevIssue.StartDate,DueDate: prevIssue.DueDate,ParentIssueID: prevIssue.ParentIssueID,ProjectID: prevIssue.ProjectID,@@ -2351,6 +2389,17 @@ func (h *Handler) BatchUpdateIssues(w http.ResponseWriter, r *http.Request) {params.AssigneeID = pgtype.UUID{Valid: false}}}+ if _, ok := rawUpdates["start_date"]; ok {+ if req.Updates.StartDate != nil && *req.Updates.StartDate != "" {+ t, err := time.Parse(time.RFC3339, *req.Updates.StartDate)+ if err != nil {+ continue+ }+ params.StartDate = pgtype.Timestamptz{Time: t, Valid: true}+ } else {+ params.StartDate = pgtype.Timestamptz{Valid: false}+ }+ }if _, ok := rawUpdates["due_date"]; ok {if req.Updates.DueDate != nil && *req.Updates.DueDate != "" {t, err := time.Parse(time.RFC3339, *req.Updates.DueDate)diff --git a/server/internal/service/autopilot.go b/server/internal/service/autopilot.goindex 63af94a90f..8f0648f25a 100644--- a/server/internal/service/autopilot.go+++ b/server/internal/service/autopilot.go@@ -160,6 +160,7 @@ func (s *AutopilotService) dispatchCreateIssue(ctx context.Context, ap db.AutopiCreatorID: ap.AssigneeID,ParentIssueID: pgtype.UUID{},Position: 0,+ StartDate: pgtype.Timestamptz{},DueDate: pgtype.Timestamptz{},Number: issueNumber,ProjectID: pgtype.UUID{},diff --git a/server/internal/service/task.go b/server/internal/service/task.goindex 7aa9e0983a..133e63b1b2 100644--- a/server/internal/service/task.go+++ b/server/internal/service/task.go@@ -1890,6 +1890,7 @@ func issueToMap(issue db.Issue, issuePrefix string) map[string]any {"creator_id": util.UUIDToString(issue.CreatorID),"parent_issue_id": util.UUIDToPtr(issue.ParentIssueID),"position": issue.Position,+ "start_date": util.TimestampToPtr(issue.StartDate),"due_date": util.TimestampToPtr(issue.DueDate),"created_at": util.TimestampToString(issue.CreatedAt),"updated_at": util.TimestampToString(issue.UpdatedAt),diff --git a/server/migrations/091_issue_start_date.down.sql b/server/migrations/091_issue_start_date.down.sqlnew file mode 100644index 0000000000..b92c491af3--- /dev/null+++ b/server/migrations/091_issue_start_date.down.sql@@ -0,0 +1,2 @@+ALTER TABLE issue+ DROP COLUMN IF EXISTS start_date;diff --git a/server/migrations/091_issue_start_date.up.sql b/server/migrations/091_issue_start_date.up.sqlnew file mode 100644index 0000000000..a6836e3e9e--- /dev/null+++ b/server/migrations/091_issue_start_date.up.sql@@ -0,0 +1,5 @@+-- issue.start_date pairs with issue.due_date so an issue can express a planned+-- start as well as a deadline. Backs Project Gantt charts (MUL-1881) and the+-- progressive-disclosure "Add property" surface in the issue sidebar.+ALTER TABLE issue+ ADD COLUMN start_date TIMESTAMPTZ;diff --git a/server/pkg/db/generated/issue.sql.go b/server/pkg/db/generated/issue.sql.goindex b0bedc3e74..45184f0a76 100644--- a/server/pkg/db/generated/issue.sql.go+++ b/server/pkg/db/generated/issue.sql.go@@ -133,10 +133,10 @@ const createIssue = `-- name: CreateIssue :oneINSERT INTO issue (workspace_id, title, description, status, priority,assignee_type, assignee_id, creator_type, creator_id,- parent_issue_id, position, due_date, number, project_id+ parent_issue_id, position, start_date, due_date, number, project_id) VALUES (- $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14-) RETURNING id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at+ $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15+) RETURNING id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at, start_date`type CreateIssueParams struct {@@ -151,6 +151,7 @@ type CreateIssueParams struct {CreatorID pgtype.UUID `json:"creator_id"`ParentIssueID pgtype.UUID `json:"parent_issue_id"`Position float64 `json:"position"`+ StartDate pgtype.Timestamptz `json:"start_date"`DueDate pgtype.Timestamptz `json:"due_date"`Number int32 `json:"number"`ProjectID pgtype.UUID `json:"project_id"`@@ -169,6 +170,7 @@ func (q *Queries) CreateIssue(ctx context.Context, arg CreateIssueParams) (Issuearg.CreatorID,arg.ParentIssueID,arg.Position,+ arg.StartDate,arg.DueDate,arg.Number,arg.ProjectID,@@ -197,6 +199,7 @@ func (q *Queries) CreateIssue(ctx context.Context, arg CreateIssueParams) (Issue&i.OriginType,&i.OriginID,&i.FirstExecutedAt,+ &i.StartDate,)return i, err}@@ -205,12 +208,12 @@ const createIssueWithOrigin = `-- name: CreateIssueWithOrigin :oneINSERT INTO issue (workspace_id, title, description, status, priority,assignee_type, assignee_id, creator_type, creator_id,- parent_issue_id, position, due_date, number, project_id,+ parent_issue_id, position, start_date, due_date, number, project_id,origin_type, origin_id) VALUES (- $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14,- $15, $16-) RETURNING id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at+ $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15,+ $16, $17+) RETURNING id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at, start_date`type CreateIssueWithOriginParams struct {@@ -225,6 +228,7 @@ type CreateIssueWithOriginParams struct {CreatorID pgtype.UUID `json:"creator_id"`ParentIssueID pgtype.UUID `json:"parent_issue_id"`Position float64 `json:"position"`+ StartDate pgtype.Timestamptz `json:"start_date"`DueDate pgtype.Timestamptz `json:"due_date"`Number int32 `json:"number"`ProjectID pgtype.UUID `json:"project_id"`@@ -245,6 +249,7 @@ func (q *Queries) CreateIssueWithOrigin(ctx context.Context, arg CreateIssueWitharg.CreatorID,arg.ParentIssueID,arg.Position,+ arg.StartDate,arg.DueDate,arg.Number,arg.ProjectID,@@ -275,6 +280,7 @@ func (q *Queries) CreateIssueWithOrigin(ctx context.Context, arg CreateIssueWith&i.OriginType,&i.OriginID,&i.FirstExecutedAt,+ &i.StartDate,)return i, err}@@ -342,7 +348,7 @@ func (q *Queries) FindActiveDuplicateIssue(ctx context.Context, arg FindActiveDu}const getIssue = `-- name: GetIssue :one-SELECT id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at FROM issue+SELECT id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at, start_date FROM issueWHERE id = $1`@@ -372,12 +378,13 @@ func (q *Queries) GetIssue(ctx context.Context, id pgtype.UUID) (Issue, error) {&i.OriginType,&i.OriginID,&i.FirstExecutedAt,+ &i.StartDate,)return i, err}const getIssueByNumber = `-- name: GetIssueByNumber :one-SELECT id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at FROM issue+SELECT id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at, start_date FROM issueWHERE workspace_id = $1 AND number = $2`@@ -412,12 +419,13 @@ func (q *Queries) GetIssueByNumber(ctx context.Context, arg GetIssueByNumberPara&i.OriginType,&i.OriginID,&i.FirstExecutedAt,+ &i.StartDate,)return i, err}const getIssueByOrigin = `-- name: GetIssueByOrigin :one-SELECT id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at FROM issue+SELECT id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at, start_date FROM issueWHERE workspace_id = $1AND origin_type = $2AND origin_id = $3@@ -461,12 +469,13 @@ func (q *Queries) GetIssueByOrigin(ctx context.Context, arg GetIssueByOriginPara&i.OriginType,&i.OriginID,&i.FirstExecutedAt,+ &i.StartDate,)return i, err}const getIssueInWorkspace = `-- name: GetIssueInWorkspace :one-SELECT id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at FROM issue+SELECT id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at, start_date FROM issueWHERE id = $1 AND workspace_id = $2`@@ -501,12 +510,13 @@ func (q *Queries) GetIssueInWorkspace(ctx context.Context, arg GetIssueInWorkspa&i.OriginType,&i.OriginID,&i.FirstExecutedAt,+ &i.StartDate,)return i, err}const listChildIssues = `-- name: ListChildIssues :many-SELECT id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at FROM issue+SELECT id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at, start_date FROM issueWHERE parent_issue_id = $1ORDER BY position ASC, created_at DESC`@@ -543,6 +553,7 @@ func (q *Queries) ListChildIssues(ctx context.Context, parentIssueID pgtype.UUID&i.OriginType,&i.OriginID,&i.FirstExecutedAt,+ &i.StartDate,); err != nil {return nil, err}@@ -557,7 +568,7 @@ func (q *Queries) ListChildIssues(ctx context.Context, parentIssueID pgtype.UUIDconst listIssues = `-- name: ListIssues :manySELECT id, workspace_id, title, description, status, priority,assignee_type, assignee_id, creator_type, creator_id,- parent_issue_id, position, due_date, created_at, updated_at, number, project_id+ parent_issue_id, position, start_date, due_date, created_at, updated_at, number, project_idFROM issueWHERE workspace_id = $1AND ($4::text IS NULL OR status = $4)@@ -595,6 +606,7 @@ type ListIssuesRow struct {CreatorID pgtype.UUID `json:"creator_id"`ParentIssueID pgtype.UUID `json:"parent_issue_id"`Position float64 `json:"position"`+ StartDate pgtype.Timestamptz `json:"start_date"`DueDate pgtype.Timestamptz `json:"due_date"`CreatedAt pgtype.Timestamptz `json:"created_at"`UpdatedAt pgtype.Timestamptz `json:"updated_at"`@@ -634,6 +646,7 @@ func (q *Queries) ListIssues(ctx context.Context, arg ListIssuesParams) ([]ListI&i.CreatorID,&i.ParentIssueID,&i.Position,+ &i.StartDate,&i.DueDate,&i.CreatedAt,&i.UpdatedAt,@@ -653,7 +666,7 @@ func (q *Queries) ListIssues(ctx context.Context, arg ListIssuesParams) ([]ListIconst listOpenIssues = `-- name: ListOpenIssues :manySELECT id, workspace_id, title, description, status, priority,assignee_type, assignee_id, creator_type, creator_id,- parent_issue_id, position, due_date, created_at, updated_at, number, project_id+ parent_issue_id, position, start_date, due_date, created_at, updated_at, number, project_idFROM issueWHERE workspace_id = $1AND status NOT IN ('done', 'cancelled')@@ -687,6 +700,7 @@ type ListOpenIssuesRow struct {CreatorID pgtype.UUID `json:"creator_id"`ParentIssueID pgtype.UUID `json:"parent_issue_id"`Position float64 `json:"position"`+ StartDate pgtype.Timestamptz `json:"start_date"`DueDate pgtype.Timestamptz `json:"due_date"`CreatedAt pgtype.Timestamptz `json:"created_at"`UpdatedAt pgtype.Timestamptz `json:"updated_at"`@@ -723,6 +737,7 @@ func (q *Queries) ListOpenIssues(ctx context.Context, arg ListOpenIssuesParams)&i.CreatorID,&i.ParentIssueID,&i.Position,+ &i.StartDate,&i.DueDate,&i.CreatedAt,&i.UpdatedAt,@@ -791,12 +806,13 @@ UPDATE issue SETassignee_type = $6,assignee_id = $7,position = COALESCE($8, position),- due_date = $9,- parent_issue_id = $10,- project_id = $11,+ start_date = $9,+ due_date = $10,+ parent_issue_id = $11,+ project_id = $12,updated_at = now()WHERE id = $1-RETURNING id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at+RETURNING id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at, start_date`type UpdateIssueParams struct {@@ -808,6 +824,7 @@ type UpdateIssueParams struct {AssigneeType pgtype.Text `json:"assignee_type"`AssigneeID pgtype.UUID `json:"assignee_id"`Position pgtype.Float8 `json:"position"`+ StartDate pgtype.Timestamptz `json:"start_date"`DueDate pgtype.Timestamptz `json:"due_date"`ParentIssueID pgtype.UUID `json:"parent_issue_id"`ProjectID pgtype.UUID `json:"project_id"`@@ -823,6 +840,7 @@ func (q *Queries) UpdateIssue(ctx context.Context, arg UpdateIssueParams) (Issuearg.AssigneeType,arg.AssigneeID,arg.Position,+ arg.StartDate,arg.DueDate,arg.ParentIssueID,arg.ProjectID,@@ -851,6 +869,7 @@ func (q *Queries) UpdateIssue(ctx context.Context, arg UpdateIssueParams) (Issue&i.OriginType,&i.OriginID,&i.FirstExecutedAt,+ &i.StartDate,)return i, err}@@ -860,7 +879,7 @@ UPDATE issue SETstatus = $2,updated_at = now()WHERE id = $1-RETURNING id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at+RETURNING id, workspace_id, title, description, status, priority, assignee_type, assignee_id, creator_type, creator_id, parent_issue_id, acceptance_criteria, context_refs, position, due_date, created_at, updated_at, number, project_id, origin_type, origin_id, first_executed_at, start_date`type UpdateIssueStatusParams struct {@@ -894,6 +913,7 @@ func (q *Queries) UpdateIssueStatus(ctx context.Context, arg UpdateIssueStatusPa&i.OriginType,&i.OriginID,&i.FirstExecutedAt,+ &i.StartDate,)return i, err}diff --git a/server/pkg/db/generated/models.go b/server/pkg/db/generated/models.goindex d042d9546f..62dbc8e938 100644--- a/server/pkg/db/generated/models.go+++ b/server/pkg/db/generated/models.go@@ -330,6 +330,7 @@ type Issue struct {OriginType pgtype.Text `json:"origin_type"`OriginID pgtype.UUID `json:"origin_id"`FirstExecutedAt pgtype.Timestamptz `json:"first_executed_at"`+ StartDate pgtype.Timestamptz `json:"start_date"`}type IssueDependency struct {diff --git a/server/pkg/db/queries/issue.sql b/server/pkg/db/queries/issue.sqlindex 8ca69dc9e3..dc0dcc7849 100644--- a/server/pkg/db/queries/issue.sql+++ b/server/pkg/db/queries/issue.sql@@ -1,7 +1,7 @@-- name: ListIssues :manySELECT id, workspace_id, title, description, status, priority,assignee_type, assignee_id, creator_type, creator_id,- parent_issue_id, position, due_date, created_at, updated_at, number, project_id+ parent_issue_id, position, start_date, due_date, created_at, updated_at, number, project_idFROM issueWHERE workspace_id = $1AND (sqlc.narg('status')::text IS NULL OR status = sqlc.narg('status'))@@ -25,9 +25,9 @@ WHERE id = $1 AND workspace_id = $2;INSERT INTO issue (workspace_id, title, description, status, priority,assignee_type, assignee_id, creator_type, creator_id,- parent_issue_id, position, due_date, number, project_id+ parent_issue_id, position, start_date, due_date, number, project_id) VALUES (- $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14+ $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) RETURNING *;-- name: GetIssueByNumber :one@@ -43,6 +43,7 @@ UPDATE issue SETassignee_type = sqlc.narg('assignee_type'),assignee_id = sqlc.narg('assignee_id'),position = COALESCE(sqlc.narg('position'), position),+ start_date = sqlc.narg('start_date'),due_date = sqlc.narg('due_date'),parent_issue_id = sqlc.narg('parent_issue_id'),project_id = sqlc.narg('project_id'),@@ -61,10 +62,10 @@ RETURNING *;INSERT INTO issue (workspace_id, title, description, status, priority,assignee_type, assignee_id, creator_type, creator_id,- parent_issue_id, position, due_date, number, project_id,+ parent_issue_id, position, start_date, due_date, number, project_id,origin_type, origin_id) VALUES (- $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14,+ $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15,sqlc.narg('origin_type'), sqlc.narg('origin_id')) RETURNING *;@@ -87,7 +88,7 @@ DELETE FROM issue WHERE id = $1;-- name: ListOpenIssues :manySELECT id, workspace_id, title, description, status, priority,assignee_type, assignee_id, creator_type, creator_id,- parent_issue_id, position, due_date, created_at, updated_at, number, project_id+ parent_issue_id, position, start_date, due_date, created_at, updated_at, number, project_idFROM issueWHERE workspace_id = $1AND status NOT IN ('done', 'cancelled')