2026-02-25 21:36:06 -06:00
|
|
|
import { useEffect, useMemo, useRef, useState, type ChangeEvent } from "react";
|
UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add
LiveRunWidget for real-time streaming of active heartbeat runs on issue detail
pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID
fragments throughout Issues, Inbox, CommandPalette, and detail pages.
Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display,
and run linking. Improve Activity page with richer formatting and filtering.
Update Dashboard with live metrics. Add reports-to agent link in AgentProperties.
Various small fixes: StatusIcon centering, CopyText ref init, agent detail
run-issue cross-links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:10:07 -06:00
|
|
|
import { Link } from "react-router-dom";
|
|
|
|
|
import type { IssueComment, Agent } from "@paperclip/shared";
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
import { Button } from "@/components/ui/button";
|
2026-02-25 21:36:06 -06:00
|
|
|
import { Paperclip } from "lucide-react";
|
UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add
LiveRunWidget for real-time streaming of active heartbeat runs on issue detail
pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID
fragments throughout Issues, Inbox, CommandPalette, and detail pages.
Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display,
and run linking. Improve Activity page with richer formatting and filtering.
Update Dashboard with live metrics. Add reports-to agent link in AgentProperties.
Various small fixes: StatusIcon centering, CopyText ref init, agent detail
run-issue cross-links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:10:07 -06:00
|
|
|
import { Identity } from "./Identity";
|
2026-02-23 14:41:21 -06:00
|
|
|
import { MarkdownBody } from "./MarkdownBody";
|
2026-02-20 13:35:15 -06:00
|
|
|
import { MarkdownEditor, type MarkdownEditorRef, type MentionOption } from "./MarkdownEditor";
|
2026-02-26 16:30:12 -06:00
|
|
|
import { StatusBadge } from "./StatusBadge";
|
2026-02-20 16:19:54 -06:00
|
|
|
import { formatDateTime } from "../lib/utils";
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
|
UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add
LiveRunWidget for real-time streaming of active heartbeat runs on issue detail
pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID
fragments throughout Issues, Inbox, CommandPalette, and detail pages.
Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display,
and run linking. Improve Activity page with richer formatting and filtering.
Update Dashboard with live metrics. Add reports-to agent link in AgentProperties.
Various small fixes: StatusIcon centering, CopyText ref init, agent detail
run-issue cross-links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:10:07 -06:00
|
|
|
interface CommentWithRunMeta extends IssueComment {
|
|
|
|
|
runId?: string | null;
|
|
|
|
|
runAgentId?: string | null;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-26 16:30:12 -06:00
|
|
|
interface LinkedRunItem {
|
|
|
|
|
runId: string;
|
|
|
|
|
status: string;
|
|
|
|
|
agentId: string;
|
|
|
|
|
createdAt: Date | string;
|
|
|
|
|
startedAt: Date | string | null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface CommentReassignment {
|
|
|
|
|
assigneeAgentId: string | null;
|
|
|
|
|
assigneeUserId: string | null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface ReassignOption {
|
|
|
|
|
value: string;
|
|
|
|
|
label: string;
|
|
|
|
|
}
|
|
|
|
|
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
interface CommentThreadProps {
|
UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add
LiveRunWidget for real-time streaming of active heartbeat runs on issue detail
pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID
fragments throughout Issues, Inbox, CommandPalette, and detail pages.
Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display,
and run linking. Improve Activity page with richer formatting and filtering.
Update Dashboard with live metrics. Add reports-to agent link in AgentProperties.
Various small fixes: StatusIcon centering, CopyText ref init, agent detail
run-issue cross-links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:10:07 -06:00
|
|
|
comments: CommentWithRunMeta[];
|
2026-02-26 16:30:12 -06:00
|
|
|
linkedRuns?: LinkedRunItem[];
|
|
|
|
|
onAdd: (body: string, reopen?: boolean, reassignment?: CommentReassignment) => Promise<void>;
|
UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add
LiveRunWidget for real-time streaming of active heartbeat runs on issue detail
pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID
fragments throughout Issues, Inbox, CommandPalette, and detail pages.
Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display,
and run linking. Improve Activity page with richer formatting and filtering.
Update Dashboard with live metrics. Add reports-to agent link in AgentProperties.
Various small fixes: StatusIcon centering, CopyText ref init, agent detail
run-issue cross-links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:10:07 -06:00
|
|
|
issueStatus?: string;
|
|
|
|
|
agentMap?: Map<string, Agent>;
|
2026-02-23 14:41:21 -06:00
|
|
|
imageUploadHandler?: (file: File) => Promise<string>;
|
2026-02-25 21:36:06 -06:00
|
|
|
/** Callback to attach an image file to the parent issue (not inline in a comment). */
|
|
|
|
|
onAttachImage?: (file: File) => Promise<void>;
|
2026-02-25 08:39:31 -06:00
|
|
|
draftKey?: string;
|
2026-02-25 21:36:06 -06:00
|
|
|
liveRunSlot?: React.ReactNode;
|
2026-02-26 16:30:12 -06:00
|
|
|
enableReassign?: boolean;
|
|
|
|
|
reassignOptions?: ReassignOption[];
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
}
|
|
|
|
|
|
UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add
LiveRunWidget for real-time streaming of active heartbeat runs on issue detail
pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID
fragments throughout Issues, Inbox, CommandPalette, and detail pages.
Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display,
and run linking. Improve Activity page with richer formatting and filtering.
Update Dashboard with live metrics. Add reports-to agent link in AgentProperties.
Various small fixes: StatusIcon centering, CopyText ref init, agent detail
run-issue cross-links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:10:07 -06:00
|
|
|
const CLOSED_STATUSES = new Set(["done", "cancelled"]);
|
2026-02-25 08:39:31 -06:00
|
|
|
const DRAFT_DEBOUNCE_MS = 800;
|
UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add
LiveRunWidget for real-time streaming of active heartbeat runs on issue detail
pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID
fragments throughout Issues, Inbox, CommandPalette, and detail pages.
Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display,
and run linking. Improve Activity page with richer formatting and filtering.
Update Dashboard with live metrics. Add reports-to agent link in AgentProperties.
Various small fixes: StatusIcon centering, CopyText ref init, agent detail
run-issue cross-links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:10:07 -06:00
|
|
|
|
2026-02-25 08:39:31 -06:00
|
|
|
function loadDraft(draftKey: string): string {
|
|
|
|
|
try {
|
|
|
|
|
return localStorage.getItem(draftKey) ?? "";
|
|
|
|
|
} catch {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function saveDraft(draftKey: string, value: string) {
|
|
|
|
|
try {
|
|
|
|
|
if (value.trim()) {
|
|
|
|
|
localStorage.setItem(draftKey, value);
|
|
|
|
|
} else {
|
|
|
|
|
localStorage.removeItem(draftKey);
|
|
|
|
|
}
|
|
|
|
|
} catch {
|
|
|
|
|
// Ignore localStorage failures.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function clearDraft(draftKey: string) {
|
|
|
|
|
try {
|
|
|
|
|
localStorage.removeItem(draftKey);
|
|
|
|
|
} catch {
|
|
|
|
|
// Ignore localStorage failures.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-26 16:30:12 -06:00
|
|
|
function parseReassignment(target: string): CommentReassignment | null {
|
|
|
|
|
if (!target) return null;
|
|
|
|
|
if (target === "__none__") {
|
|
|
|
|
return { assigneeAgentId: null, assigneeUserId: null };
|
|
|
|
|
}
|
|
|
|
|
if (target.startsWith("agent:")) {
|
|
|
|
|
const assigneeAgentId = target.slice("agent:".length);
|
|
|
|
|
return assigneeAgentId ? { assigneeAgentId, assigneeUserId: null } : null;
|
|
|
|
|
}
|
|
|
|
|
if (target.startsWith("user:")) {
|
|
|
|
|
const assigneeUserId = target.slice("user:".length);
|
|
|
|
|
return assigneeUserId ? { assigneeAgentId: null, assigneeUserId } : null;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type TimelineItem =
|
|
|
|
|
| { kind: "comment"; id: string; createdAtMs: number; comment: CommentWithRunMeta }
|
|
|
|
|
| { kind: "run"; id: string; createdAtMs: number; run: LinkedRunItem };
|
|
|
|
|
|
|
|
|
|
export function CommentThread({
|
|
|
|
|
comments,
|
|
|
|
|
linkedRuns = [],
|
|
|
|
|
onAdd,
|
|
|
|
|
issueStatus,
|
|
|
|
|
agentMap,
|
|
|
|
|
imageUploadHandler,
|
|
|
|
|
onAttachImage,
|
|
|
|
|
draftKey,
|
|
|
|
|
liveRunSlot,
|
|
|
|
|
enableReassign = false,
|
|
|
|
|
reassignOptions = [],
|
|
|
|
|
}: CommentThreadProps) {
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
const [body, setBody] = useState("");
|
UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add
LiveRunWidget for real-time streaming of active heartbeat runs on issue detail
pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID
fragments throughout Issues, Inbox, CommandPalette, and detail pages.
Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display,
and run linking. Improve Activity page with richer formatting and filtering.
Update Dashboard with live metrics. Add reports-to agent link in AgentProperties.
Various small fixes: StatusIcon centering, CopyText ref init, agent detail
run-issue cross-links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:10:07 -06:00
|
|
|
const [reopen, setReopen] = useState(true);
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
const [submitting, setSubmitting] = useState(false);
|
2026-02-25 21:36:06 -06:00
|
|
|
const [attaching, setAttaching] = useState(false);
|
2026-02-26 16:30:12 -06:00
|
|
|
const [reassign, setReassign] = useState(false);
|
|
|
|
|
const [reassignTarget, setReassignTarget] = useState("");
|
2026-02-20 13:35:15 -06:00
|
|
|
const editorRef = useRef<MarkdownEditorRef>(null);
|
2026-02-25 21:36:06 -06:00
|
|
|
const attachInputRef = useRef<HTMLInputElement | null>(null);
|
2026-02-25 08:39:31 -06:00
|
|
|
const draftTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
|
UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add
LiveRunWidget for real-time streaming of active heartbeat runs on issue detail
pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID
fragments throughout Issues, Inbox, CommandPalette, and detail pages.
Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display,
and run linking. Improve Activity page with richer formatting and filtering.
Update Dashboard with live metrics. Add reports-to agent link in AgentProperties.
Various small fixes: StatusIcon centering, CopyText ref init, agent detail
run-issue cross-links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:10:07 -06:00
|
|
|
const isClosed = issueStatus ? CLOSED_STATUSES.has(issueStatus) : false;
|
|
|
|
|
|
2026-02-26 16:30:12 -06:00
|
|
|
const timeline = useMemo<TimelineItem[]>(() => {
|
|
|
|
|
const commentItems: TimelineItem[] = comments.map((comment) => ({
|
|
|
|
|
kind: "comment",
|
|
|
|
|
id: comment.id,
|
|
|
|
|
createdAtMs: new Date(comment.createdAt).getTime(),
|
|
|
|
|
comment,
|
|
|
|
|
}));
|
|
|
|
|
const runItems: TimelineItem[] = linkedRuns.map((run) => ({
|
|
|
|
|
kind: "run",
|
|
|
|
|
id: run.runId,
|
|
|
|
|
createdAtMs: new Date(run.startedAt ?? run.createdAt).getTime(),
|
|
|
|
|
run,
|
|
|
|
|
}));
|
|
|
|
|
return [...commentItems, ...runItems].sort((a, b) => {
|
|
|
|
|
if (a.createdAtMs !== b.createdAtMs) return a.createdAtMs - b.createdAtMs;
|
|
|
|
|
if (a.kind === b.kind) return a.id.localeCompare(b.id);
|
|
|
|
|
return a.kind === "comment" ? -1 : 1;
|
|
|
|
|
});
|
|
|
|
|
}, [comments, linkedRuns]);
|
UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add
LiveRunWidget for real-time streaming of active heartbeat runs on issue detail
pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID
fragments throughout Issues, Inbox, CommandPalette, and detail pages.
Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display,
and run linking. Improve Activity page with richer formatting and filtering.
Update Dashboard with live metrics. Add reports-to agent link in AgentProperties.
Various small fixes: StatusIcon centering, CopyText ref init, agent detail
run-issue cross-links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:10:07 -06:00
|
|
|
|
2026-02-23 14:41:21 -06:00
|
|
|
// Build mention options from agent map (exclude terminated agents)
|
2026-02-20 13:35:15 -06:00
|
|
|
const mentions = useMemo<MentionOption[]>(() => {
|
|
|
|
|
if (!agentMap) return [];
|
2026-02-23 14:41:21 -06:00
|
|
|
return Array.from(agentMap.values())
|
|
|
|
|
.filter((a) => a.status !== "terminated")
|
|
|
|
|
.map((a) => ({
|
|
|
|
|
id: a.id,
|
|
|
|
|
name: a.name,
|
|
|
|
|
}));
|
2026-02-20 13:35:15 -06:00
|
|
|
}, [agentMap]);
|
|
|
|
|
|
2026-02-25 08:39:31 -06:00
|
|
|
useEffect(() => {
|
|
|
|
|
if (!draftKey) return;
|
|
|
|
|
setBody(loadDraft(draftKey));
|
|
|
|
|
}, [draftKey]);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (!draftKey) return;
|
|
|
|
|
if (draftTimer.current) clearTimeout(draftTimer.current);
|
|
|
|
|
draftTimer.current = setTimeout(() => {
|
|
|
|
|
saveDraft(draftKey, body);
|
|
|
|
|
}, DRAFT_DEBOUNCE_MS);
|
|
|
|
|
}, [body, draftKey]);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
return () => {
|
|
|
|
|
if (draftTimer.current) clearTimeout(draftTimer.current);
|
|
|
|
|
};
|
|
|
|
|
}, []);
|
|
|
|
|
|
2026-02-26 16:30:12 -06:00
|
|
|
useEffect(() => {
|
|
|
|
|
if (enableReassign) return;
|
|
|
|
|
setReassign(false);
|
|
|
|
|
setReassignTarget("");
|
|
|
|
|
}, [enableReassign]);
|
|
|
|
|
|
2026-02-20 13:35:15 -06:00
|
|
|
async function handleSubmit() {
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
const trimmed = body.trim();
|
|
|
|
|
if (!trimmed) return;
|
2026-02-26 16:30:12 -06:00
|
|
|
const reassignment = reassign ? parseReassignment(reassignTarget) : null;
|
|
|
|
|
if (reassign && !reassignment) return;
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
|
|
|
|
|
setSubmitting(true);
|
|
|
|
|
try {
|
2026-02-26 16:30:12 -06:00
|
|
|
await onAdd(trimmed, isClosed && reopen ? true : undefined, reassignment ?? undefined);
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
setBody("");
|
2026-02-25 08:39:31 -06:00
|
|
|
if (draftKey) clearDraft(draftKey);
|
UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add
LiveRunWidget for real-time streaming of active heartbeat runs on issue detail
pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID
fragments throughout Issues, Inbox, CommandPalette, and detail pages.
Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display,
and run linking. Improve Activity page with richer formatting and filtering.
Update Dashboard with live metrics. Add reports-to agent link in AgentProperties.
Various small fixes: StatusIcon centering, CopyText ref init, agent detail
run-issue cross-links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:10:07 -06:00
|
|
|
setReopen(false);
|
2026-02-26 16:30:12 -06:00
|
|
|
setReassign(false);
|
|
|
|
|
setReassignTarget("");
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
} finally {
|
|
|
|
|
setSubmitting(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-25 21:36:06 -06:00
|
|
|
async function handleAttachFile(evt: ChangeEvent<HTMLInputElement>) {
|
|
|
|
|
const file = evt.target.files?.[0];
|
|
|
|
|
if (!file || !onAttachImage) return;
|
|
|
|
|
setAttaching(true);
|
|
|
|
|
try {
|
|
|
|
|
await onAttachImage(file);
|
|
|
|
|
} finally {
|
|
|
|
|
setAttaching(false);
|
|
|
|
|
if (attachInputRef.current) attachInputRef.current.value = "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-26 16:30:12 -06:00
|
|
|
const canSubmit = !submitting && !!body.trim() && (!reassign || !!parseReassignment(reassignTarget));
|
|
|
|
|
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
return (
|
|
|
|
|
<div className="space-y-4">
|
2026-02-26 16:30:12 -06:00
|
|
|
<h3 className="text-sm font-semibold">Comments & Runs ({timeline.length})</h3>
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
|
2026-02-26 16:30:12 -06:00
|
|
|
{timeline.length === 0 && (
|
|
|
|
|
<p className="text-sm text-muted-foreground">No comments or runs yet.</p>
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<div className="space-y-3">
|
2026-02-26 16:30:12 -06:00
|
|
|
{timeline.map((item) => {
|
|
|
|
|
if (item.kind === "run") {
|
|
|
|
|
const run = item.run;
|
|
|
|
|
return (
|
|
|
|
|
<div key={`run:${run.runId}`} className="border border-border bg-accent/20 p-3 overflow-hidden min-w-0 rounded-sm">
|
|
|
|
|
<div className="flex items-center justify-between mb-2">
|
|
|
|
|
<Link to={`/agents/${run.agentId}`} className="hover:underline">
|
|
|
|
|
<Identity
|
|
|
|
|
name={agentMap?.get(run.agentId)?.name ?? run.agentId.slice(0, 8)}
|
|
|
|
|
size="sm"
|
|
|
|
|
/>
|
|
|
|
|
</Link>
|
|
|
|
|
<span className="text-xs text-muted-foreground">
|
|
|
|
|
{formatDateTime(run.startedAt ?? run.createdAt)}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flex items-center gap-2 text-xs">
|
|
|
|
|
<span className="text-muted-foreground">Run</span>
|
|
|
|
|
<Link
|
|
|
|
|
to={`/agents/${run.agentId}/runs/${run.runId}`}
|
|
|
|
|
className="inline-flex items-center rounded-md border border-border bg-accent/40 px-2 py-1 font-mono text-muted-foreground hover:text-foreground hover:bg-accent/60 transition-colors"
|
|
|
|
|
>
|
|
|
|
|
{run.runId.slice(0, 8)}
|
|
|
|
|
</Link>
|
|
|
|
|
<StatusBadge status={run.status} />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const comment = item.comment;
|
|
|
|
|
return (
|
|
|
|
|
<div key={comment.id} className="border border-border p-3 overflow-hidden min-w-0 rounded-sm">
|
|
|
|
|
<div className="flex items-center justify-between mb-1">
|
|
|
|
|
{comment.authorAgentId ? (
|
|
|
|
|
<Link to={`/agents/${comment.authorAgentId}`} className="hover:underline">
|
|
|
|
|
<Identity
|
|
|
|
|
name={agentMap?.get(comment.authorAgentId)?.name ?? comment.authorAgentId.slice(0, 8)}
|
|
|
|
|
size="sm"
|
|
|
|
|
/>
|
|
|
|
|
</Link>
|
|
|
|
|
) : (
|
|
|
|
|
<Identity name="You" size="sm" />
|
|
|
|
|
)}
|
|
|
|
|
<span className="text-xs text-muted-foreground">
|
|
|
|
|
{formatDateTime(comment.createdAt)}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<MarkdownBody className="text-sm">{comment.body}</MarkdownBody>
|
|
|
|
|
{comment.runId && (
|
|
|
|
|
<div className="mt-2 pt-2 border-t border-border/60">
|
|
|
|
|
{comment.runAgentId ? (
|
|
|
|
|
<Link
|
|
|
|
|
to={`/agents/${comment.runAgentId}/runs/${comment.runId}`}
|
|
|
|
|
className="inline-flex items-center rounded-md border border-border bg-accent/30 px-2 py-1 text-[10px] font-mono text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors"
|
|
|
|
|
>
|
|
|
|
|
run {comment.runId.slice(0, 8)}
|
|
|
|
|
</Link>
|
|
|
|
|
) : (
|
|
|
|
|
<span className="inline-flex items-center rounded-md border border-border bg-accent/30 px-2 py-1 text-[10px] font-mono text-muted-foreground">
|
|
|
|
|
run {comment.runId.slice(0, 8)}
|
|
|
|
|
</span>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2026-02-21 08:19:38 -06:00
|
|
|
)}
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
</div>
|
2026-02-26 16:30:12 -06:00
|
|
|
);
|
|
|
|
|
})}
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
</div>
|
|
|
|
|
|
2026-02-25 21:36:06 -06:00
|
|
|
{liveRunSlot}
|
|
|
|
|
|
2026-02-20 13:35:15 -06:00
|
|
|
<div className="space-y-2">
|
|
|
|
|
<MarkdownEditor
|
|
|
|
|
ref={editorRef}
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
value={body}
|
2026-02-20 13:35:15 -06:00
|
|
|
onChange={setBody}
|
|
|
|
|
placeholder="Leave a comment..."
|
|
|
|
|
mentions={mentions}
|
|
|
|
|
onSubmit={handleSubmit}
|
2026-02-23 14:41:21 -06:00
|
|
|
imageUploadHandler={imageUploadHandler}
|
2026-02-20 13:35:15 -06:00
|
|
|
contentClassName="min-h-[60px] text-sm"
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
/>
|
UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add
LiveRunWidget for real-time streaming of active heartbeat runs on issue detail
pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID
fragments throughout Issues, Inbox, CommandPalette, and detail pages.
Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display,
and run linking. Improve Activity page with richer formatting and filtering.
Update Dashboard with live metrics. Add reports-to agent link in AgentProperties.
Various small fixes: StatusIcon centering, CopyText ref init, agent detail
run-issue cross-links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:10:07 -06:00
|
|
|
<div className="flex items-center justify-end gap-3">
|
2026-02-26 16:30:12 -06:00
|
|
|
{(onAttachImage || enableReassign) && (
|
|
|
|
|
<div className="mr-auto flex items-center gap-3">
|
|
|
|
|
{onAttachImage && (
|
|
|
|
|
<>
|
|
|
|
|
<input
|
|
|
|
|
ref={attachInputRef}
|
|
|
|
|
type="file"
|
|
|
|
|
accept="image/png,image/jpeg,image/webp,image/gif"
|
|
|
|
|
className="hidden"
|
|
|
|
|
onChange={handleAttachFile}
|
|
|
|
|
/>
|
|
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="icon-sm"
|
|
|
|
|
onClick={() => attachInputRef.current?.click()}
|
|
|
|
|
disabled={attaching}
|
|
|
|
|
title="Attach image"
|
|
|
|
|
>
|
|
|
|
|
<Paperclip className="h-4 w-4" />
|
|
|
|
|
</Button>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
{enableReassign && (
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
<label className="flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer select-none">
|
|
|
|
|
<input
|
|
|
|
|
type="checkbox"
|
|
|
|
|
checked={reassign}
|
|
|
|
|
onChange={(e) => {
|
|
|
|
|
setReassign(e.target.checked);
|
|
|
|
|
if (!e.target.checked) setReassignTarget("");
|
|
|
|
|
}}
|
|
|
|
|
className="rounded border-border"
|
|
|
|
|
/>
|
|
|
|
|
Reassign
|
|
|
|
|
</label>
|
|
|
|
|
<select
|
|
|
|
|
value={reassignTarget}
|
|
|
|
|
onFocus={() => setReassign(true)}
|
|
|
|
|
onMouseDown={() => setReassign(true)}
|
|
|
|
|
onChange={(event) => {
|
|
|
|
|
setReassign(true);
|
|
|
|
|
setReassignTarget(event.target.value);
|
|
|
|
|
}}
|
|
|
|
|
className="h-8 rounded border border-border bg-background px-2 text-xs"
|
|
|
|
|
>
|
|
|
|
|
<option value="">Select assignee...</option>
|
|
|
|
|
{reassignOptions.map((option) => (
|
|
|
|
|
<option key={option.value} value={option.value}>
|
|
|
|
|
{option.label}
|
|
|
|
|
</option>
|
|
|
|
|
))}
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2026-02-25 21:36:06 -06:00
|
|
|
)}
|
UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add
LiveRunWidget for real-time streaming of active heartbeat runs on issue detail
pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID
fragments throughout Issues, Inbox, CommandPalette, and detail pages.
Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display,
and run linking. Improve Activity page with richer formatting and filtering.
Update Dashboard with live metrics. Add reports-to agent link in AgentProperties.
Various small fixes: StatusIcon centering, CopyText ref init, agent detail
run-issue cross-links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:10:07 -06:00
|
|
|
{isClosed && (
|
|
|
|
|
<label className="flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer select-none">
|
|
|
|
|
<input
|
|
|
|
|
type="checkbox"
|
|
|
|
|
checked={reopen}
|
|
|
|
|
onChange={(e) => setReopen(e.target.checked)}
|
|
|
|
|
className="rounded border-border"
|
|
|
|
|
/>
|
|
|
|
|
Re-open
|
|
|
|
|
</label>
|
|
|
|
|
)}
|
2026-02-26 16:30:12 -06:00
|
|
|
<Button size="sm" disabled={!canSubmit} onClick={handleSubmit}>
|
UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add
LiveRunWidget for real-time streaming of active heartbeat runs on issue detail
pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID
fragments throughout Issues, Inbox, CommandPalette, and detail pages.
Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display,
and run linking. Improve Activity page with richer formatting and filtering.
Update Dashboard with live metrics. Add reports-to agent link in AgentProperties.
Various small fixes: StatusIcon centering, CopyText ref init, agent detail
run-issue cross-links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:10:07 -06:00
|
|
|
{submitting ? "Posting..." : "Comment"}
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
2026-02-20 13:35:15 -06:00
|
|
|
</div>
|
Add shared UI primitives, contexts, and reusable components
Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:57:00 -06:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|