2026-04-09 10:26:17 -05:00
|
|
|
import { memo, useEffect, useMemo, useRef, useState, type ChangeEvent } from "react";
|
2026-03-05 11:02:22 -06:00
|
|
|
import { Link, useLocation } from "react-router-dom";
|
2026-04-02 09:11:49 -05:00
|
|
|
import type {
|
|
|
|
|
Agent,
|
2026-04-06 10:36:31 -05:00
|
|
|
Approval,
|
2026-04-02 09:11:49 -05:00
|
|
|
FeedbackDataSharingPreference,
|
|
|
|
|
FeedbackVote,
|
|
|
|
|
FeedbackVoteValue,
|
|
|
|
|
IssueComment,
|
|
|
|
|
} from "@paperclipai/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-04-02 11:51:40 -05:00
|
|
|
import { ArrowRight, Check, Copy, Paperclip } from "lucide-react";
|
|
|
|
|
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
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-03-02 16:56:05 -06:00
|
|
|
import { InlineEntitySelector, type InlineEntityOption } from "./InlineEntitySelector";
|
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-04-02 09:11:49 -05:00
|
|
|
import { OutputFeedbackButtons } from "./OutputFeedbackButtons";
|
2026-04-06 10:36:31 -05:00
|
|
|
import { ApprovalCard } from "./ApprovalCard";
|
2026-03-06 07:58:30 -06:00
|
|
|
import { AgentIcon } from "./AgentIconPicker";
|
2026-04-02 11:51:40 -05:00
|
|
|
import { formatAssigneeUserLabel } from "../lib/assignees";
|
|
|
|
|
import type { IssueTimelineAssignee, IssueTimelineEvent } from "../lib/issue-timeline-events";
|
|
|
|
|
import { timeAgo } from "../lib/timeAgo";
|
|
|
|
|
import { cn, formatDateTime } from "../lib/utils";
|
2026-03-30 13:25:37 -05:00
|
|
|
import { restoreSubmittedCommentDraft } from "../lib/comment-submit-draft";
|
2026-03-13 23:03:51 -05:00
|
|
|
import { PluginSlotOutlet } from "@/plugins/slots";
|
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-03-28 09:46:34 -05:00
|
|
|
clientId?: string;
|
2026-03-28 11:25:25 -05:00
|
|
|
clientStatus?: "pending" | "queued";
|
|
|
|
|
queueState?: "queued";
|
|
|
|
|
queueTargetRunId?: string | null;
|
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-26 16:30:12 -06:00
|
|
|
interface LinkedRunItem {
|
|
|
|
|
runId: string;
|
|
|
|
|
status: string;
|
|
|
|
|
agentId: string;
|
|
|
|
|
createdAt: Date | string;
|
|
|
|
|
startedAt: Date | string | null;
|
Add sandbox environment support (#4415)
## Thinking Path
> - Paperclip orchestrates AI agents for zero-human companies.
> - The environment/runtime layer decides where agent work executes and
how the control plane reaches those runtimes.
> - Today Paperclip can run locally and over SSH, but sandboxed
execution needs a first-class environment model instead of one-off
adapter behavior.
> - We also want sandbox providers to be pluggable so the core does not
hardcode every provider implementation.
> - This branch adds the Sandbox environment path, the provider
contract, and a deterministic fake provider plugin.
> - That required synchronized changes across shared contracts, plugin
SDK surfaces, server runtime orchestration, and the UI
environment/workspace flows.
> - The result is that sandbox execution becomes a core control-plane
capability while keeping provider implementations extensible and
testable.
## What Changed
- Added sandbox runtime support to the environment execution path,
including runtime URL discovery, sandbox execution targeting,
orchestration, and heartbeat integration.
- Added plugin-provider support for sandbox environments so providers
can be supplied via plugins instead of hardcoded server logic.
- Added the fake sandbox provider plugin with deterministic behavior
suitable for local and automated testing.
- Updated shared types, validators, plugin protocol definitions, and SDK
helpers to carry sandbox provider and workspace-runtime contracts across
package boundaries.
- Updated server routes and services so companies can create sandbox
environments, select them for work, and execute work through the sandbox
runtime path.
- Updated the UI environment and workspace surfaces to expose sandbox
environment configuration and selection.
- Added test coverage for sandbox runtime behavior, provider seams,
environment route guards, orchestration, and the fake provider plugin.
## Verification
- Ran locally before the final fixture-only scrub:
- `pnpm -r typecheck`
- `pnpm test:run`
- `pnpm build`
- Ran locally after the final scrub amend:
- `pnpm vitest run server/src/__tests__/runtime-api.test.ts`
- Reviewer spot checks:
- create a sandbox environment backed by the fake provider plugin
- run work through that environment
- confirm sandbox provider execution does not inherit host secrets
implicitly
## Risks
- This touches shared contracts, plugin SDK plumbing, server runtime
orchestration, and UI environment/workspace flows, so regressions would
likely show up as cross-layer mismatches rather than isolated type
errors.
- Runtime URL discovery and sandbox callback selection are sensitive to
host/bind configuration; if that logic is wrong, sandbox-backed
callbacks may fail even when execution succeeds.
- The fake provider plugin is intentionally deterministic and
test-oriented; future providers may expose capability gaps that this
branch does not yet cover.
## Model Used
- OpenAI Codex coding agent on a GPT-5-class backend in the
Paperclip/Codex harness. Exact backend model ID is not exposed
in-session. Tool-assisted workflow with shell execution, file editing,
git history inspection, and local test execution.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
2026-04-24 12:15:53 -07:00
|
|
|
environment?: {
|
|
|
|
|
id: string;
|
|
|
|
|
name: string;
|
|
|
|
|
driver: string;
|
|
|
|
|
} | null;
|
|
|
|
|
environmentLease?: {
|
|
|
|
|
id: string;
|
|
|
|
|
status: string;
|
|
|
|
|
leasePolicy: string;
|
|
|
|
|
provider: string | null;
|
|
|
|
|
providerLeaseId: string | null;
|
|
|
|
|
executionWorkspaceId: string | null;
|
|
|
|
|
workspacePath: string | null;
|
|
|
|
|
failureReason: string | null;
|
|
|
|
|
cleanupStatus: string | null;
|
|
|
|
|
} | null;
|
2026-04-02 11:51:40 -05:00
|
|
|
finishedAt?: Date | string | null;
|
2026-02-26 16:30:12 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface CommentReassignment {
|
|
|
|
|
assigneeAgentId: string | null;
|
|
|
|
|
assigneeUserId: string | 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
|
|
|
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-03-28 11:25:25 -05:00
|
|
|
queuedComments?: CommentWithRunMeta[];
|
2026-04-06 10:36:31 -05:00
|
|
|
linkedApprovals?: Approval[];
|
2026-04-02 09:11:49 -05:00
|
|
|
feedbackVotes?: FeedbackVote[];
|
|
|
|
|
feedbackDataSharingPreference?: FeedbackDataSharingPreference;
|
|
|
|
|
feedbackTermsUrl?: string | null;
|
2026-02-26 16:30:12 -06:00
|
|
|
linkedRuns?: LinkedRunItem[];
|
2026-04-02 11:51:40 -05:00
|
|
|
timelineEvents?: IssueTimelineEvent[];
|
2026-03-13 23:03:51 -05:00
|
|
|
companyId?: string | null;
|
|
|
|
|
projectId?: string | null;
|
2026-04-06 10:36:31 -05:00
|
|
|
onApproveApproval?: (approvalId: string) => Promise<void>;
|
|
|
|
|
onRejectApproval?: (approvalId: string) => Promise<void>;
|
|
|
|
|
pendingApprovalAction?: {
|
|
|
|
|
approvalId: string;
|
|
|
|
|
action: "approve" | "reject";
|
|
|
|
|
} | null;
|
2026-04-02 09:11:49 -05:00
|
|
|
onVote?: (
|
|
|
|
|
commentId: string,
|
|
|
|
|
vote: FeedbackVoteValue,
|
|
|
|
|
options?: { allowSharing?: boolean; reason?: string },
|
|
|
|
|
) => Promise<void>;
|
2026-03-28 11:53:26 -05:00
|
|
|
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-04-02 11:51:40 -05:00
|
|
|
currentUserId?: string | null;
|
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;
|
2026-03-02 16:56:05 -06:00
|
|
|
reassignOptions?: InlineEntityOption[];
|
|
|
|
|
currentAssigneeValue?: string;
|
2026-03-20 06:05:05 -05:00
|
|
|
suggestedAssigneeValue?: string;
|
2026-03-02 13:31:58 -06:00
|
|
|
mentions?: MentionOption[];
|
2026-03-28 11:25:25 -05:00
|
|
|
onInterruptQueued?: (runId: string) => Promise<void>;
|
|
|
|
|
interruptingQueuedRunId?: string | null;
|
2026-04-04 13:04:34 -05:00
|
|
|
composerDisabledReason?: string | 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
|
|
|
}
|
|
|
|
|
|
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.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Add sandbox environment support (#4415)
## Thinking Path
> - Paperclip orchestrates AI agents for zero-human companies.
> - The environment/runtime layer decides where agent work executes and
how the control plane reaches those runtimes.
> - Today Paperclip can run locally and over SSH, but sandboxed
execution needs a first-class environment model instead of one-off
adapter behavior.
> - We also want sandbox providers to be pluggable so the core does not
hardcode every provider implementation.
> - This branch adds the Sandbox environment path, the provider
contract, and a deterministic fake provider plugin.
> - That required synchronized changes across shared contracts, plugin
SDK surfaces, server runtime orchestration, and the UI
environment/workspace flows.
> - The result is that sandbox execution becomes a core control-plane
capability while keeping provider implementations extensible and
testable.
## What Changed
- Added sandbox runtime support to the environment execution path,
including runtime URL discovery, sandbox execution targeting,
orchestration, and heartbeat integration.
- Added plugin-provider support for sandbox environments so providers
can be supplied via plugins instead of hardcoded server logic.
- Added the fake sandbox provider plugin with deterministic behavior
suitable for local and automated testing.
- Updated shared types, validators, plugin protocol definitions, and SDK
helpers to carry sandbox provider and workspace-runtime contracts across
package boundaries.
- Updated server routes and services so companies can create sandbox
environments, select them for work, and execute work through the sandbox
runtime path.
- Updated the UI environment and workspace surfaces to expose sandbox
environment configuration and selection.
- Added test coverage for sandbox runtime behavior, provider seams,
environment route guards, orchestration, and the fake provider plugin.
## Verification
- Ran locally before the final fixture-only scrub:
- `pnpm -r typecheck`
- `pnpm test:run`
- `pnpm build`
- Ran locally after the final scrub amend:
- `pnpm vitest run server/src/__tests__/runtime-api.test.ts`
- Reviewer spot checks:
- create a sandbox environment backed by the fake provider plugin
- run work through that environment
- confirm sandbox provider execution does not inherit host secrets
implicitly
## Risks
- This touches shared contracts, plugin SDK plumbing, server runtime
orchestration, and UI environment/workspace flows, so regressions would
likely show up as cross-layer mismatches rather than isolated type
errors.
- Runtime URL discovery and sandbox callback selection are sensitive to
host/bind configuration; if that logic is wrong, sandbox-backed
callbacks may fail even when execution succeeds.
- The fake provider plugin is intentionally deterministic and
test-oriented; future providers may expose capability gaps that this
branch does not yet cover.
## Model Used
- OpenAI Codex coding agent on a GPT-5-class backend in the
Paperclip/Codex harness. Exact backend model ID is not exposed
in-session. Tool-assisted workflow with shell execution, file editing,
git history inspection, and local test execution.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
2026-04-24 12:15:53 -07:00
|
|
|
function BreakablePath({ text }: { text: string }) {
|
|
|
|
|
const parts: React.ReactNode[] = [];
|
|
|
|
|
const segments = text.split(/(?<=[\/-])/);
|
|
|
|
|
for (let i = 0; i < segments.length; i++) {
|
|
|
|
|
if (i > 0) parts.push(<wbr key={i} />);
|
|
|
|
|
parts.push(segments[i]);
|
|
|
|
|
}
|
|
|
|
|
return <>{parts}</>;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-26 16:30:12 -06:00
|
|
|
function parseReassignment(target: string): CommentReassignment | null {
|
2026-03-02 16:56:05 -06:00
|
|
|
if (!target || target === "__none__") {
|
2026-02-26 16:30:12 -06:00
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
[codex] Improve issue detail and issue-list UX (#3678)
## Thinking Path
> - Paperclip orchestrates AI agents for zero-human companies
> - A core part of that is the operator experience around reading issue
state, agent chat, and sub-task structure
> - The current branch had a long run of issue-detail and issue-list UX
fixes that all improve how humans follow and steer active work
> - Those changes mostly live in the UI/chat surface and should be
reviewed together instead of mixed with workspace/runtime work
> - This pull request packages the issue-detail, chat, markdown, and
sub-issue list improvements into one standalone change
> - The benefit is a cleaner, less jumpy, more reliable issue workflow
on desktop and mobile without coupling it to unrelated server/runtime
refactors
## What Changed
- Stabilized issue chat runtime wiring, optimistic comment handling,
queued-comment cancellation, and composer anchoring during live updates
- Fixed several issue-detail rendering and navigation regressions
including placeholder bleed, local polling scope, mobile inbox-to-issue
transitions, and visible refresh resets
- Improved markdown and rich-content handling with advisory image
normalization, editor fallback behavior, touch mention recovery, and
`issue:` quicklook links
- Refined sub-issue behavior with parent-derived defaults, current-user
inheritance fixes, empty-state cleanup, and a reusable issue-list
presentation for sub-issues
- Added targeted UI tests for the new issue-detail, chat scroll/message,
placeholder-data, markdown, and issue-list behaviors
## Verification
- `pnpm vitest run ui/src/components/IssueChatThread.test.tsx
ui/src/components/MarkdownEditor.test.tsx
ui/src/components/IssuesList.test.tsx
ui/src/context/LiveUpdatesProvider.test.tsx
ui/src/lib/issue-chat-messages.test.ts
ui/src/lib/issue-chat-scroll.test.ts
ui/src/lib/issue-detail-subissues.test.ts
ui/src/lib/query-placeholder-data.test.tsx
ui/src/hooks/usePaperclipIssueRuntime.test.tsx`
## Risks
- Medium: this branch touches the highest-traffic issue-detail UI paths,
so regressions would show up as chat/thread or sub-issue UX glitches
- The changes are UI-heavy and would benefit from reviewer screenshots
or a quick manual browser pass before merge
## Model Used
- OpenAI Codex coding agent (GPT-5-class runtime in Codex CLI; exact
deployed model ID is not exposed in this environment), reasoning
enabled, tool use and local code execution enabled
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [ ] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-14 12:50:48 -05:00
|
|
|
function shouldImplicitlyReopenComment(issueStatus: string | undefined, assigneeValue: string) {
|
[codex] Polish issue board workflows (#4224)
## Thinking Path
> - Paperclip orchestrates AI agents for zero-human companies
> - Human operators supervise that work through issue lists, issue
detail, comments, inbox groups, markdown references, and
profile/activity surfaces
> - The branch had many small UI fixes that improve the operator loop
but do not need to ship with backend runtime migrations
> - These changes belong together as board workflow polish because they
affect scanning, navigation, issue context, comment state, and markdown
clarity
> - This pull request groups the UI-only slice so it can merge
independently from runtime/backend changes
> - The benefit is a clearer board experience with better issue context,
steadier optimistic updates, and more predictable keyboard navigation
## What Changed
- Improves issue properties, sub-issue actions, blocker chips, and issue
list/detail refresh behavior.
- Adds blocker context above the issue composer and stabilizes
queued/interrupted comment UI state.
- Improves markdown issue/GitHub link rendering and opens external
markdown links in a new tab.
- Adds inbox group keyboard navigation and fold/unfold support.
- Polishes activity/avatar/profile/settings/workspace presentation
details.
## Verification
- `pnpm exec vitest run ui/src/components/IssueProperties.test.tsx
ui/src/components/IssueChatThread.test.tsx
ui/src/components/MarkdownBody.test.tsx ui/src/lib/inbox.test.ts
ui/src/lib/optimistic-issue-comments.test.ts`
## Risks
- Low to medium risk: changes are UI-focused but cover high-traffic
issue and inbox surfaces.
- This branch intentionally does not include the backend runtime changes
from the companion PR; where UI calls newer API filters, unsupported
servers should continue to fail visibly through existing API error
handling.
- Visual screenshots were not captured in this heartbeat; targeted
component/helper tests cover the changed behavior.
> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected — check the roadmap
first. See `CONTRIBUTING.md`.
## Model Used
- OpenAI Codex, GPT-5-based coding agent runtime, shell/git tool use
enabled. Exact hosted model build and context window are not exposed in
this Paperclip heartbeat environment.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
2026-04-21 12:25:34 -05:00
|
|
|
const resumesToTodo = issueStatus === "done" || issueStatus === "cancelled" || issueStatus === "blocked";
|
|
|
|
|
return resumesToTodo && assigneeValue.startsWith("agent:");
|
[codex] Improve issue detail and issue-list UX (#3678)
## Thinking Path
> - Paperclip orchestrates AI agents for zero-human companies
> - A core part of that is the operator experience around reading issue
state, agent chat, and sub-task structure
> - The current branch had a long run of issue-detail and issue-list UX
fixes that all improve how humans follow and steer active work
> - Those changes mostly live in the UI/chat surface and should be
reviewed together instead of mixed with workspace/runtime work
> - This pull request packages the issue-detail, chat, markdown, and
sub-issue list improvements into one standalone change
> - The benefit is a cleaner, less jumpy, more reliable issue workflow
on desktop and mobile without coupling it to unrelated server/runtime
refactors
## What Changed
- Stabilized issue chat runtime wiring, optimistic comment handling,
queued-comment cancellation, and composer anchoring during live updates
- Fixed several issue-detail rendering and navigation regressions
including placeholder bleed, local polling scope, mobile inbox-to-issue
transitions, and visible refresh resets
- Improved markdown and rich-content handling with advisory image
normalization, editor fallback behavior, touch mention recovery, and
`issue:` quicklook links
- Refined sub-issue behavior with parent-derived defaults, current-user
inheritance fixes, empty-state cleanup, and a reusable issue-list
presentation for sub-issues
- Added targeted UI tests for the new issue-detail, chat scroll/message,
placeholder-data, markdown, and issue-list behaviors
## Verification
- `pnpm vitest run ui/src/components/IssueChatThread.test.tsx
ui/src/components/MarkdownEditor.test.tsx
ui/src/components/IssuesList.test.tsx
ui/src/context/LiveUpdatesProvider.test.tsx
ui/src/lib/issue-chat-messages.test.ts
ui/src/lib/issue-chat-scroll.test.ts
ui/src/lib/issue-detail-subissues.test.ts
ui/src/lib/query-placeholder-data.test.tsx
ui/src/hooks/usePaperclipIssueRuntime.test.tsx`
## Risks
- Medium: this branch touches the highest-traffic issue-detail UI paths,
so regressions would show up as chat/thread or sub-issue UX glitches
- The changes are UI-heavy and would benefit from reviewer screenshots
or a quick manual browser pass before merge
## Model Used
- OpenAI Codex coding agent (GPT-5-class runtime in Codex CLI; exact
deployed model ID is not exposed in this environment), reasoning
enabled, tool use and local code execution enabled
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [ ] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-14 12:50:48 -05:00
|
|
|
}
|
|
|
|
|
|
2026-04-02 11:51:40 -05:00
|
|
|
function humanizeValue(value: string | null): string {
|
|
|
|
|
if (!value) return "None";
|
|
|
|
|
return value.replace(/_/g, " ");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function formatTimelineAssigneeLabel(
|
|
|
|
|
assignee: IssueTimelineAssignee,
|
|
|
|
|
agentMap?: Map<string, Agent>,
|
|
|
|
|
currentUserId?: string | null,
|
|
|
|
|
) {
|
|
|
|
|
if (assignee.agentId) {
|
|
|
|
|
return agentMap?.get(assignee.agentId)?.name ?? assignee.agentId.slice(0, 8);
|
|
|
|
|
}
|
|
|
|
|
if (assignee.userId) {
|
|
|
|
|
return formatAssigneeUserLabel(assignee.userId, currentUserId) ?? "Board";
|
|
|
|
|
}
|
|
|
|
|
return "Unassigned";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function formatTimelineActorName(
|
|
|
|
|
actorType: IssueTimelineEvent["actorType"],
|
|
|
|
|
actorId: string,
|
|
|
|
|
agentMap?: Map<string, Agent>,
|
|
|
|
|
currentUserId?: string | null,
|
|
|
|
|
) {
|
|
|
|
|
if (actorType === "agent") {
|
|
|
|
|
return agentMap?.get(actorId)?.name ?? actorId.slice(0, 8);
|
|
|
|
|
}
|
|
|
|
|
if (actorType === "system") {
|
|
|
|
|
return "System";
|
|
|
|
|
}
|
|
|
|
|
return formatAssigneeUserLabel(actorId, currentUserId) ?? "Board";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function initialsForName(name: string) {
|
|
|
|
|
const parts = name.trim().split(/\s+/);
|
|
|
|
|
if (parts.length >= 2) {
|
|
|
|
|
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
|
|
|
}
|
|
|
|
|
return name.slice(0, 2).toUpperCase();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function formatRunStatusLabel(status: string) {
|
|
|
|
|
switch (status) {
|
|
|
|
|
case "timed_out":
|
|
|
|
|
return "timed out";
|
|
|
|
|
default:
|
|
|
|
|
return status.replace(/_/g, " ");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function runTimestamp(run: LinkedRunItem) {
|
|
|
|
|
return run.finishedAt ?? run.startedAt ?? run.createdAt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function runStatusClass(status: string) {
|
|
|
|
|
switch (status) {
|
|
|
|
|
case "succeeded":
|
|
|
|
|
return "text-green-700 dark:text-green-300";
|
|
|
|
|
case "failed":
|
|
|
|
|
case "error":
|
|
|
|
|
return "text-red-700 dark:text-red-300";
|
|
|
|
|
case "timed_out":
|
|
|
|
|
return "text-orange-700 dark:text-orange-300";
|
|
|
|
|
case "running":
|
|
|
|
|
return "text-cyan-700 dark:text-cyan-300";
|
|
|
|
|
case "queued":
|
|
|
|
|
case "pending":
|
|
|
|
|
return "text-amber-700 dark:text-amber-300";
|
|
|
|
|
case "cancelled":
|
|
|
|
|
return "text-muted-foreground";
|
|
|
|
|
default:
|
|
|
|
|
return "text-foreground";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-07 19:16:24 -05:00
|
|
|
async function copyTextWithFallback(text: string) {
|
|
|
|
|
if (navigator.clipboard && window.isSecureContext) {
|
|
|
|
|
await navigator.clipboard.writeText(text);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const textarea = document.createElement("textarea");
|
|
|
|
|
textarea.value = text;
|
|
|
|
|
textarea.style.position = "fixed";
|
|
|
|
|
textarea.style.left = "-9999px";
|
|
|
|
|
document.body.appendChild(textarea);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
textarea.select();
|
|
|
|
|
const success = document.execCommand("copy");
|
|
|
|
|
if (!success) throw new Error("execCommand copy failed");
|
|
|
|
|
} finally {
|
|
|
|
|
document.body.removeChild(textarea);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-07 09:57:50 -06:00
|
|
|
function CopyMarkdownButton({ text }: { text: string }) {
|
2026-04-07 19:16:24 -05:00
|
|
|
const [status, setStatus] = useState<"idle" | "copied" | "failed">("idle");
|
|
|
|
|
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
|
|
|
|
|
|
|
|
useEffect(() => () => {
|
|
|
|
|
if (timeoutRef.current) {
|
|
|
|
|
clearTimeout(timeoutRef.current);
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const label = status === "copied" ? "Copied" : status === "failed" ? "Copy failed" : "Copy";
|
|
|
|
|
|
2026-03-07 09:57:50 -06:00
|
|
|
return (
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
2026-04-07 19:16:24 -05:00
|
|
|
className={cn(
|
|
|
|
|
"inline-flex min-h-8 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium transition-colors",
|
|
|
|
|
status === "copied"
|
|
|
|
|
? "bg-green-100 text-green-700 dark:bg-green-500/15 dark:text-green-300"
|
|
|
|
|
: status === "failed"
|
|
|
|
|
? "bg-destructive/10 text-destructive"
|
|
|
|
|
: "text-muted-foreground hover:bg-accent/60 hover:text-foreground",
|
|
|
|
|
)}
|
|
|
|
|
title={label}
|
|
|
|
|
aria-label="Copy comment as markdown"
|
2026-03-07 09:57:50 -06:00
|
|
|
onClick={() => {
|
2026-04-07 19:16:24 -05:00
|
|
|
void copyTextWithFallback(text)
|
|
|
|
|
.then(() => setStatus("copied"))
|
|
|
|
|
.catch(() => setStatus("failed"));
|
|
|
|
|
|
|
|
|
|
if (timeoutRef.current) {
|
|
|
|
|
clearTimeout(timeoutRef.current);
|
|
|
|
|
}
|
|
|
|
|
timeoutRef.current = setTimeout(() => {
|
|
|
|
|
setStatus("idle");
|
|
|
|
|
timeoutRef.current = null;
|
|
|
|
|
}, 1500);
|
2026-03-07 09:57:50 -06:00
|
|
|
}}
|
|
|
|
|
>
|
2026-04-07 19:16:24 -05:00
|
|
|
{status === "copied" ? <Check className="h-3.5 w-3.5" /> : <Copy className="h-3.5 w-3.5" />}
|
|
|
|
|
<span className="sm:hidden">{label}</span>
|
|
|
|
|
<span className="sr-only" aria-live="polite">
|
|
|
|
|
{label}
|
|
|
|
|
</span>
|
2026-03-07 09:57:50 -06:00
|
|
|
</button>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-28 11:25:25 -05:00
|
|
|
function CommentCard({
|
|
|
|
|
comment,
|
|
|
|
|
agentMap,
|
|
|
|
|
companyId,
|
|
|
|
|
projectId,
|
2026-04-02 09:11:49 -05:00
|
|
|
feedbackVote = null,
|
|
|
|
|
feedbackDataSharingPreference = "prompt",
|
|
|
|
|
feedbackTermsUrl = null,
|
|
|
|
|
onVote,
|
|
|
|
|
voting = false,
|
2026-03-28 11:25:25 -05:00
|
|
|
highlightCommentId,
|
|
|
|
|
queued = false,
|
|
|
|
|
}: {
|
|
|
|
|
comment: CommentWithRunMeta;
|
|
|
|
|
agentMap?: Map<string, Agent>;
|
|
|
|
|
companyId?: string | null;
|
|
|
|
|
projectId?: string | null;
|
2026-04-02 09:11:49 -05:00
|
|
|
feedbackVote?: FeedbackVoteValue | null;
|
|
|
|
|
feedbackDataSharingPreference?: FeedbackDataSharingPreference;
|
|
|
|
|
feedbackTermsUrl?: string | null;
|
|
|
|
|
onVote?: (
|
|
|
|
|
vote: FeedbackVoteValue,
|
|
|
|
|
options?: { allowSharing?: boolean; reason?: string },
|
|
|
|
|
) => Promise<void>;
|
|
|
|
|
voting?: boolean;
|
2026-03-28 11:25:25 -05:00
|
|
|
highlightCommentId?: string | null;
|
|
|
|
|
queued?: boolean;
|
|
|
|
|
}) {
|
|
|
|
|
const isHighlighted = highlightCommentId === comment.id;
|
|
|
|
|
const isPending = comment.clientStatus === "pending";
|
|
|
|
|
const isQueued = queued || comment.queueState === "queued" || comment.clientStatus === "queued";
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
key={comment.id}
|
|
|
|
|
id={`comment-${comment.id}`}
|
|
|
|
|
className={`border p-3 overflow-hidden min-w-0 rounded-sm transition-colors duration-1000 ${
|
|
|
|
|
isQueued
|
|
|
|
|
? "border-amber-300/70 bg-amber-50/70 dark:border-amber-500/40 dark:bg-amber-500/10"
|
|
|
|
|
: isHighlighted
|
|
|
|
|
? "border-primary/50 bg-primary/5"
|
|
|
|
|
: "border-border"
|
|
|
|
|
} ${isPending ? "opacity-80" : ""}`}
|
|
|
|
|
>
|
|
|
|
|
<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="flex items-center gap-1.5">
|
|
|
|
|
{isQueued ? (
|
|
|
|
|
<span className="inline-flex items-center rounded-full border border-amber-400/60 bg-amber-100/70 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.14em] text-amber-800 dark:border-amber-400/40 dark:bg-amber-500/20 dark:text-amber-200">
|
|
|
|
|
Queued
|
|
|
|
|
</span>
|
|
|
|
|
) : null}
|
|
|
|
|
{companyId && !isPending ? (
|
|
|
|
|
<PluginSlotOutlet
|
|
|
|
|
slotTypes={["commentContextMenuItem"]}
|
|
|
|
|
entityType="comment"
|
|
|
|
|
context={{
|
|
|
|
|
companyId,
|
|
|
|
|
projectId: projectId ?? null,
|
|
|
|
|
entityId: comment.id,
|
|
|
|
|
entityType: "comment",
|
|
|
|
|
parentEntityId: comment.issueId,
|
|
|
|
|
}}
|
|
|
|
|
className="flex flex-wrap items-center gap-1.5"
|
|
|
|
|
itemClassName="inline-flex"
|
|
|
|
|
missingBehavior="placeholder"
|
|
|
|
|
/>
|
|
|
|
|
) : null}
|
|
|
|
|
{isPending ? (
|
|
|
|
|
<span className="text-xs text-muted-foreground">{isQueued ? "Queueing..." : "Sending..."}</span>
|
|
|
|
|
) : (
|
|
|
|
|
<a
|
|
|
|
|
href={`#comment-${comment.id}`}
|
|
|
|
|
className="text-xs text-muted-foreground hover:text-foreground hover:underline transition-colors"
|
|
|
|
|
>
|
|
|
|
|
{formatDateTime(comment.createdAt)}
|
|
|
|
|
</a>
|
|
|
|
|
)}
|
|
|
|
|
<CopyMarkdownButton text={comment.body} />
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2026-04-10 22:26:21 -05:00
|
|
|
<MarkdownBody className="text-sm" softBreaks>{comment.body}</MarkdownBody>
|
2026-03-28 11:25:25 -05:00
|
|
|
{companyId && !isPending ? (
|
|
|
|
|
<div className="mt-2 space-y-2">
|
|
|
|
|
<PluginSlotOutlet
|
|
|
|
|
slotTypes={["commentAnnotation"]}
|
|
|
|
|
entityType="comment"
|
|
|
|
|
context={{
|
|
|
|
|
companyId,
|
|
|
|
|
projectId: projectId ?? null,
|
|
|
|
|
entityId: comment.id,
|
|
|
|
|
entityType: "comment",
|
|
|
|
|
parentEntityId: comment.issueId,
|
|
|
|
|
}}
|
|
|
|
|
className="space-y-2"
|
|
|
|
|
itemClassName="rounded-md"
|
|
|
|
|
missingBehavior="placeholder"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
) : null}
|
2026-04-02 09:11:49 -05:00
|
|
|
{comment.authorAgentId && onVote && !isQueued && !isPending ? (
|
|
|
|
|
<OutputFeedbackButtons
|
|
|
|
|
activeVote={feedbackVote}
|
|
|
|
|
disabled={voting}
|
|
|
|
|
sharingPreference={feedbackDataSharingPreference}
|
|
|
|
|
termsUrl={feedbackTermsUrl}
|
|
|
|
|
onVote={onVote}
|
2026-04-03 07:43:23 -05:00
|
|
|
rightSlot={comment.runId && !isPending ? (
|
|
|
|
|
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>
|
|
|
|
|
)
|
|
|
|
|
) : undefined}
|
2026-04-02 09:11:49 -05:00
|
|
|
/>
|
|
|
|
|
) : null}
|
2026-04-03 07:43:23 -05:00
|
|
|
{comment.runId && !isPending && !(comment.authorAgentId && onVote && !isQueued) ? (
|
|
|
|
|
<div className="mt-3 pt-3 border-t border-border/60">
|
2026-03-28 11:25:25 -05:00
|
|
|
{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>
|
|
|
|
|
) : null}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-26 16:30:12 -06:00
|
|
|
type TimelineItem =
|
|
|
|
|
| { kind: "comment"; id: string; createdAtMs: number; comment: CommentWithRunMeta }
|
2026-04-06 10:36:31 -05:00
|
|
|
| { kind: "approval"; id: string; createdAtMs: number; approval: Approval }
|
2026-04-02 11:51:40 -05:00
|
|
|
| { kind: "event"; id: string; createdAtMs: number; event: IssueTimelineEvent }
|
2026-02-26 16:30:12 -06:00
|
|
|
| { kind: "run"; id: string; createdAtMs: number; run: LinkedRunItem };
|
|
|
|
|
|
2026-04-02 11:51:40 -05:00
|
|
|
function TimelineEventCard({
|
|
|
|
|
event,
|
|
|
|
|
agentMap,
|
|
|
|
|
currentUserId,
|
|
|
|
|
}: {
|
|
|
|
|
event: IssueTimelineEvent;
|
|
|
|
|
agentMap?: Map<string, Agent>;
|
|
|
|
|
currentUserId?: string | null;
|
|
|
|
|
}) {
|
|
|
|
|
const actorName = formatTimelineActorName(event.actorType, event.actorId, agentMap, currentUserId);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div id={`activity-${event.id}`} className="flex items-start gap-2.5 py-1.5">
|
|
|
|
|
<Avatar size="sm" className="mt-0.5">
|
|
|
|
|
<AvatarFallback>{initialsForName(actorName)}</AvatarFallback>
|
|
|
|
|
</Avatar>
|
|
|
|
|
|
|
|
|
|
<div className="min-w-0 flex-1 space-y-1.5">
|
|
|
|
|
<div className="flex flex-wrap items-baseline gap-x-1.5 gap-y-1 text-sm">
|
|
|
|
|
<span className="font-medium text-foreground">{actorName}</span>
|
|
|
|
|
<span className="text-muted-foreground">updated this task</span>
|
|
|
|
|
<a
|
|
|
|
|
href={`#activity-${event.id}`}
|
|
|
|
|
className="text-sm text-muted-foreground transition-colors hover:text-foreground hover:underline"
|
|
|
|
|
>
|
|
|
|
|
{timeAgo(event.createdAt)}
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{event.statusChange ? (
|
|
|
|
|
<div className="flex flex-wrap items-center gap-2 text-sm">
|
|
|
|
|
<span className="w-14 text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground">
|
|
|
|
|
Status
|
|
|
|
|
</span>
|
|
|
|
|
<span className="text-muted-foreground">
|
|
|
|
|
{humanizeValue(event.statusChange.from)}
|
|
|
|
|
</span>
|
|
|
|
|
<ArrowRight className="h-3.5 w-3.5 text-muted-foreground" />
|
|
|
|
|
<span className="font-medium text-foreground">
|
|
|
|
|
{humanizeValue(event.statusChange.to)}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
|
|
{event.assigneeChange ? (
|
|
|
|
|
<div className="flex flex-wrap items-center gap-2 text-sm">
|
|
|
|
|
<span className="w-14 text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground">
|
|
|
|
|
Assignee
|
|
|
|
|
</span>
|
|
|
|
|
<span className="text-muted-foreground">
|
|
|
|
|
{formatTimelineAssigneeLabel(event.assigneeChange.from, agentMap, currentUserId)}
|
|
|
|
|
</span>
|
|
|
|
|
<ArrowRight className="h-3.5 w-3.5 text-muted-foreground" />
|
|
|
|
|
<span className="font-medium text-foreground">
|
|
|
|
|
{formatTimelineAssigneeLabel(event.assigneeChange.to, agentMap, currentUserId)}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
) : null}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-03 11:21:38 -06:00
|
|
|
const TimelineList = memo(function TimelineList({
|
|
|
|
|
timeline,
|
|
|
|
|
agentMap,
|
2026-04-02 11:51:40 -05:00
|
|
|
currentUserId,
|
2026-03-13 23:03:51 -05:00
|
|
|
companyId,
|
|
|
|
|
projectId,
|
2026-04-06 10:36:31 -05:00
|
|
|
onApproveApproval,
|
|
|
|
|
onRejectApproval,
|
|
|
|
|
pendingApprovalAction,
|
2026-04-02 09:11:49 -05:00
|
|
|
feedbackVoteByTargetId,
|
|
|
|
|
feedbackDataSharingPreference = "prompt",
|
|
|
|
|
feedbackTermsUrl = null,
|
|
|
|
|
onVote,
|
|
|
|
|
votingTargetId,
|
2026-03-05 11:02:22 -06:00
|
|
|
highlightCommentId,
|
2026-03-03 11:21:38 -06:00
|
|
|
}: {
|
|
|
|
|
timeline: TimelineItem[];
|
|
|
|
|
agentMap?: Map<string, Agent>;
|
2026-04-02 11:51:40 -05:00
|
|
|
currentUserId?: string | null;
|
2026-03-13 23:03:51 -05:00
|
|
|
companyId?: string | null;
|
|
|
|
|
projectId?: string | null;
|
2026-04-06 10:36:31 -05:00
|
|
|
onApproveApproval?: (approvalId: string) => Promise<void>;
|
|
|
|
|
onRejectApproval?: (approvalId: string) => Promise<void>;
|
|
|
|
|
pendingApprovalAction?: {
|
|
|
|
|
approvalId: string;
|
|
|
|
|
action: "approve" | "reject";
|
|
|
|
|
} | null;
|
2026-04-02 09:11:49 -05:00
|
|
|
feedbackVoteByTargetId?: Map<string, FeedbackVoteValue>;
|
|
|
|
|
feedbackDataSharingPreference?: FeedbackDataSharingPreference;
|
|
|
|
|
feedbackTermsUrl?: string | null;
|
|
|
|
|
onVote?: (
|
|
|
|
|
commentId: string,
|
|
|
|
|
vote: FeedbackVoteValue,
|
|
|
|
|
options?: { allowSharing?: boolean; reason?: string },
|
|
|
|
|
) => Promise<void>;
|
|
|
|
|
votingTargetId?: string | null;
|
2026-03-05 11:02:22 -06:00
|
|
|
highlightCommentId?: string | null;
|
2026-03-03 11:21:38 -06:00
|
|
|
}) {
|
|
|
|
|
if (timeline.length === 0) {
|
2026-04-02 11:51:40 -05:00
|
|
|
return <p className="text-sm text-muted-foreground">No timeline entries yet.</p>;
|
2026-03-03 11:21:38 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="space-y-3">
|
|
|
|
|
{timeline.map((item) => {
|
2026-04-02 11:51:40 -05:00
|
|
|
if (item.kind === "event") {
|
|
|
|
|
return (
|
|
|
|
|
<TimelineEventCard
|
|
|
|
|
key={`event:${item.event.id}`}
|
|
|
|
|
event={item.event}
|
|
|
|
|
agentMap={agentMap}
|
|
|
|
|
currentUserId={currentUserId}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-06 10:36:31 -05:00
|
|
|
if (item.kind === "approval") {
|
|
|
|
|
const approval = item.approval;
|
|
|
|
|
const isPending = pendingApprovalAction?.approvalId === approval.id;
|
|
|
|
|
return (
|
|
|
|
|
<div id={`approval-${approval.id}`} key={`approval:${approval.id}`} className="py-1.5">
|
|
|
|
|
<ApprovalCard
|
|
|
|
|
approval={approval}
|
|
|
|
|
requesterAgent={approval.requestedByAgentId ? agentMap?.get(approval.requestedByAgentId) ?? null : null}
|
|
|
|
|
onApprove={onApproveApproval ? () => void onApproveApproval(approval.id) : undefined}
|
|
|
|
|
onReject={onRejectApproval ? () => void onRejectApproval(approval.id) : undefined}
|
|
|
|
|
detailLink={`/approvals/${approval.id}`}
|
|
|
|
|
isPending={isPending}
|
|
|
|
|
pendingAction={isPending ? pendingApprovalAction?.action ?? null : null}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-03 11:21:38 -06:00
|
|
|
if (item.kind === "run") {
|
|
|
|
|
const run = item.run;
|
2026-04-02 11:51:40 -05:00
|
|
|
const actorName = agentMap?.get(run.agentId)?.name ?? run.agentId.slice(0, 8);
|
2026-03-03 11:21:38 -06:00
|
|
|
return (
|
2026-04-02 11:51:40 -05:00
|
|
|
<div id={`run-${run.runId}`} key={`run:${run.runId}`} className="flex items-center gap-2.5 py-1.5">
|
|
|
|
|
<Avatar size="sm">
|
|
|
|
|
<AvatarFallback>{initialsForName(actorName)}</AvatarFallback>
|
|
|
|
|
</Avatar>
|
|
|
|
|
|
|
|
|
|
<div className="min-w-0 flex-1">
|
|
|
|
|
<div className="flex flex-wrap items-center gap-x-1.5 gap-y-1 text-sm">
|
|
|
|
|
<Link to={`/agents/${run.agentId}`} className="font-medium text-foreground transition-colors hover:underline">
|
|
|
|
|
{actorName}
|
|
|
|
|
</Link>
|
|
|
|
|
<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-xs text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground"
|
|
|
|
|
>
|
|
|
|
|
{run.runId.slice(0, 8)}
|
|
|
|
|
</Link>
|
|
|
|
|
<span className={cn("font-medium", runStatusClass(run.status))}>
|
|
|
|
|
{formatRunStatusLabel(run.status)}
|
|
|
|
|
</span>
|
|
|
|
|
<a
|
|
|
|
|
href={`#run-${run.runId}`}
|
|
|
|
|
className="text-sm text-muted-foreground transition-colors hover:text-foreground hover:underline"
|
|
|
|
|
>
|
|
|
|
|
{timeAgo(runTimestamp(run))}
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
2026-03-03 11:21:38 -06:00
|
|
|
</div>
|
Add sandbox environment support (#4415)
## Thinking Path
> - Paperclip orchestrates AI agents for zero-human companies.
> - The environment/runtime layer decides where agent work executes and
how the control plane reaches those runtimes.
> - Today Paperclip can run locally and over SSH, but sandboxed
execution needs a first-class environment model instead of one-off
adapter behavior.
> - We also want sandbox providers to be pluggable so the core does not
hardcode every provider implementation.
> - This branch adds the Sandbox environment path, the provider
contract, and a deterministic fake provider plugin.
> - That required synchronized changes across shared contracts, plugin
SDK surfaces, server runtime orchestration, and the UI
environment/workspace flows.
> - The result is that sandbox execution becomes a core control-plane
capability while keeping provider implementations extensible and
testable.
## What Changed
- Added sandbox runtime support to the environment execution path,
including runtime URL discovery, sandbox execution targeting,
orchestration, and heartbeat integration.
- Added plugin-provider support for sandbox environments so providers
can be supplied via plugins instead of hardcoded server logic.
- Added the fake sandbox provider plugin with deterministic behavior
suitable for local and automated testing.
- Updated shared types, validators, plugin protocol definitions, and SDK
helpers to carry sandbox provider and workspace-runtime contracts across
package boundaries.
- Updated server routes and services so companies can create sandbox
environments, select them for work, and execute work through the sandbox
runtime path.
- Updated the UI environment and workspace surfaces to expose sandbox
environment configuration and selection.
- Added test coverage for sandbox runtime behavior, provider seams,
environment route guards, orchestration, and the fake provider plugin.
## Verification
- Ran locally before the final fixture-only scrub:
- `pnpm -r typecheck`
- `pnpm test:run`
- `pnpm build`
- Ran locally after the final scrub amend:
- `pnpm vitest run server/src/__tests__/runtime-api.test.ts`
- Reviewer spot checks:
- create a sandbox environment backed by the fake provider plugin
- run work through that environment
- confirm sandbox provider execution does not inherit host secrets
implicitly
## Risks
- This touches shared contracts, plugin SDK plumbing, server runtime
orchestration, and UI environment/workspace flows, so regressions would
likely show up as cross-layer mismatches rather than isolated type
errors.
- Runtime URL discovery and sandbox callback selection are sensitive to
host/bind configuration; if that logic is wrong, sandbox-backed
callbacks may fail even when execution succeeds.
- The fake provider plugin is intentionally deterministic and
test-oriented; future providers may expose capability gaps that this
branch does not yet cover.
## Model Used
- OpenAI Codex coding agent on a GPT-5-class backend in the
Paperclip/Codex harness. Exact backend model ID is not exposed
in-session. Tool-assisted workflow with shell execution, file editing,
git history inspection, and local test execution.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
2026-04-24 12:15:53 -07:00
|
|
|
{run.environment || run.environmentLease ? (
|
|
|
|
|
<div className="mt-2 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground">
|
|
|
|
|
{run.environment ? (
|
|
|
|
|
<span>
|
|
|
|
|
Environment <span className="text-foreground">{run.environment.name}</span>
|
|
|
|
|
<span> · {run.environment.driver}</span>
|
|
|
|
|
</span>
|
|
|
|
|
) : null}
|
|
|
|
|
{run.environmentLease?.provider ? (
|
|
|
|
|
<span>
|
|
|
|
|
Provider <span className="text-foreground">{run.environmentLease.provider}</span>
|
|
|
|
|
</span>
|
|
|
|
|
) : null}
|
|
|
|
|
{run.environmentLease ? (
|
|
|
|
|
<span>
|
|
|
|
|
Lease{" "}
|
|
|
|
|
<span className="font-mono text-foreground">
|
|
|
|
|
{run.environmentLease.id.slice(0, 8)}
|
|
|
|
|
</span>
|
|
|
|
|
<span> · {run.environmentLease.status}</span>
|
|
|
|
|
</span>
|
|
|
|
|
) : null}
|
|
|
|
|
{run.environmentLease?.workspacePath ? (
|
|
|
|
|
<span className="min-w-0 font-mono" style={{ overflowWrap: "anywhere" }}>
|
|
|
|
|
<BreakablePath text={run.environmentLease.workspacePath} />
|
|
|
|
|
</span>
|
|
|
|
|
) : null}
|
|
|
|
|
{run.environmentLease?.failureReason ? (
|
|
|
|
|
<span className="text-destructive">
|
|
|
|
|
Failure: {run.environmentLease.failureReason}
|
|
|
|
|
</span>
|
|
|
|
|
) : null}
|
|
|
|
|
</div>
|
|
|
|
|
) : null}
|
2026-03-03 11:21:38 -06:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const comment = item.comment;
|
|
|
|
|
return (
|
2026-03-28 11:25:25 -05:00
|
|
|
<CommentCard
|
2026-03-05 11:02:22 -06:00
|
|
|
key={comment.id}
|
2026-03-28 11:25:25 -05:00
|
|
|
comment={comment}
|
|
|
|
|
agentMap={agentMap}
|
|
|
|
|
companyId={companyId}
|
|
|
|
|
projectId={projectId}
|
2026-04-02 09:11:49 -05:00
|
|
|
feedbackVote={feedbackVoteByTargetId?.get(comment.id) ?? null}
|
|
|
|
|
feedbackDataSharingPreference={feedbackDataSharingPreference}
|
|
|
|
|
feedbackTermsUrl={feedbackTermsUrl}
|
|
|
|
|
onVote={onVote ? (vote, options) => onVote(comment.id, vote, options) : undefined}
|
|
|
|
|
voting={votingTargetId === comment.id}
|
2026-03-28 11:25:25 -05:00
|
|
|
highlightCommentId={highlightCommentId}
|
|
|
|
|
/>
|
2026-03-03 11:21:38 -06:00
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
2026-04-09 10:26:17 -05:00
|
|
|
export function CommentThread({
|
2026-02-26 16:30:12 -06:00
|
|
|
comments,
|
2026-03-28 11:25:25 -05:00
|
|
|
queuedComments = [],
|
2026-04-06 10:36:31 -05:00
|
|
|
linkedApprovals = [],
|
2026-04-02 09:11:49 -05:00
|
|
|
feedbackVotes = [],
|
|
|
|
|
feedbackDataSharingPreference = "prompt",
|
|
|
|
|
feedbackTermsUrl = null,
|
2026-02-26 16:30:12 -06:00
|
|
|
linkedRuns = [],
|
2026-04-02 11:51:40 -05:00
|
|
|
timelineEvents = [],
|
2026-03-13 23:03:51 -05:00
|
|
|
companyId,
|
|
|
|
|
projectId,
|
2026-04-06 10:36:31 -05:00
|
|
|
onApproveApproval,
|
|
|
|
|
onRejectApproval,
|
|
|
|
|
pendingApprovalAction = null,
|
2026-04-02 09:11:49 -05:00
|
|
|
onVote,
|
2026-02-26 16:30:12 -06:00
|
|
|
onAdd,
|
[codex] Improve issue detail and issue-list UX (#3678)
## Thinking Path
> - Paperclip orchestrates AI agents for zero-human companies
> - A core part of that is the operator experience around reading issue
state, agent chat, and sub-task structure
> - The current branch had a long run of issue-detail and issue-list UX
fixes that all improve how humans follow and steer active work
> - Those changes mostly live in the UI/chat surface and should be
reviewed together instead of mixed with workspace/runtime work
> - This pull request packages the issue-detail, chat, markdown, and
sub-issue list improvements into one standalone change
> - The benefit is a cleaner, less jumpy, more reliable issue workflow
on desktop and mobile without coupling it to unrelated server/runtime
refactors
## What Changed
- Stabilized issue chat runtime wiring, optimistic comment handling,
queued-comment cancellation, and composer anchoring during live updates
- Fixed several issue-detail rendering and navigation regressions
including placeholder bleed, local polling scope, mobile inbox-to-issue
transitions, and visible refresh resets
- Improved markdown and rich-content handling with advisory image
normalization, editor fallback behavior, touch mention recovery, and
`issue:` quicklook links
- Refined sub-issue behavior with parent-derived defaults, current-user
inheritance fixes, empty-state cleanup, and a reusable issue-list
presentation for sub-issues
- Added targeted UI tests for the new issue-detail, chat scroll/message,
placeholder-data, markdown, and issue-list behaviors
## Verification
- `pnpm vitest run ui/src/components/IssueChatThread.test.tsx
ui/src/components/MarkdownEditor.test.tsx
ui/src/components/IssuesList.test.tsx
ui/src/context/LiveUpdatesProvider.test.tsx
ui/src/lib/issue-chat-messages.test.ts
ui/src/lib/issue-chat-scroll.test.ts
ui/src/lib/issue-detail-subissues.test.ts
ui/src/lib/query-placeholder-data.test.tsx
ui/src/hooks/usePaperclipIssueRuntime.test.tsx`
## Risks
- Medium: this branch touches the highest-traffic issue-detail UI paths,
so regressions would show up as chat/thread or sub-issue UX glitches
- The changes are UI-heavy and would benefit from reviewer screenshots
or a quick manual browser pass before merge
## Model Used
- OpenAI Codex coding agent (GPT-5-class runtime in Codex CLI; exact
deployed model ID is not exposed in this environment), reasoning
enabled, tool use and local code execution enabled
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [ ] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-14 12:50:48 -05:00
|
|
|
issueStatus,
|
2026-02-26 16:30:12 -06:00
|
|
|
agentMap,
|
2026-04-02 11:51:40 -05:00
|
|
|
currentUserId,
|
2026-02-26 16:30:12 -06:00
|
|
|
imageUploadHandler,
|
|
|
|
|
onAttachImage,
|
|
|
|
|
draftKey,
|
|
|
|
|
liveRunSlot,
|
|
|
|
|
enableReassign = false,
|
|
|
|
|
reassignOptions = [],
|
2026-03-02 16:56:05 -06:00
|
|
|
currentAssigneeValue = "",
|
2026-03-20 06:05:05 -05:00
|
|
|
suggestedAssigneeValue,
|
2026-03-02 13:31:58 -06:00
|
|
|
mentions: providedMentions,
|
2026-03-28 11:25:25 -05:00
|
|
|
onInterruptQueued,
|
|
|
|
|
interruptingQueuedRunId = null,
|
2026-04-04 13:04:34 -05:00
|
|
|
composerDisabledReason = null,
|
2026-02-26 16:30:12 -06:00
|
|
|
}: CommentThreadProps) {
|
2026-04-09 10:26:17 -05:00
|
|
|
const [body, setBody] = useState("");
|
|
|
|
|
const [submitting, setSubmitting] = useState(false);
|
|
|
|
|
const [attaching, setAttaching] = useState(false);
|
2026-03-20 06:05:05 -05:00
|
|
|
const effectiveSuggestedAssigneeValue = suggestedAssigneeValue ?? currentAssigneeValue;
|
2026-04-09 10:26:17 -05:00
|
|
|
const [reassignTarget, setReassignTarget] = useState(effectiveSuggestedAssigneeValue);
|
2026-03-05 11:02:22 -06:00
|
|
|
const [highlightCommentId, setHighlightCommentId] = useState<string | null>(null);
|
2026-04-02 09:11:49 -05:00
|
|
|
const [votingTargetId, setVotingTargetId] = useState<string | null>(null);
|
2026-04-09 10:26:17 -05:00
|
|
|
const editorRef = useRef<MarkdownEditorRef>(null);
|
|
|
|
|
const attachInputRef = useRef<HTMLInputElement | null>(null);
|
|
|
|
|
const draftTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
2026-03-05 11:02:22 -06:00
|
|
|
const location = useLocation();
|
|
|
|
|
const hasScrolledRef = useRef(false);
|
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
|
|
|
const timeline = useMemo<TimelineItem[]>(() => {
|
|
|
|
|
const commentItems: TimelineItem[] = comments.map((comment) => ({
|
|
|
|
|
kind: "comment",
|
|
|
|
|
id: comment.id,
|
|
|
|
|
createdAtMs: new Date(comment.createdAt).getTime(),
|
|
|
|
|
comment,
|
|
|
|
|
}));
|
2026-04-06 10:36:31 -05:00
|
|
|
const approvalItems: TimelineItem[] = linkedApprovals.map((approval) => ({
|
|
|
|
|
kind: "approval",
|
|
|
|
|
id: approval.id,
|
|
|
|
|
createdAtMs: new Date(approval.createdAt).getTime(),
|
|
|
|
|
approval,
|
|
|
|
|
}));
|
2026-04-02 11:51:40 -05:00
|
|
|
const eventItems: TimelineItem[] = timelineEvents.map((event) => ({
|
|
|
|
|
kind: "event",
|
|
|
|
|
id: event.id,
|
|
|
|
|
createdAtMs: new Date(event.createdAt).getTime(),
|
|
|
|
|
event,
|
|
|
|
|
}));
|
2026-02-26 16:30:12 -06:00
|
|
|
const runItems: TimelineItem[] = linkedRuns.map((run) => ({
|
|
|
|
|
kind: "run",
|
|
|
|
|
id: run.runId,
|
2026-04-02 11:51:40 -05:00
|
|
|
createdAtMs: new Date(runTimestamp(run)).getTime(),
|
2026-02-26 16:30:12 -06:00
|
|
|
run,
|
|
|
|
|
}));
|
2026-04-06 10:36:31 -05:00
|
|
|
return [...commentItems, ...approvalItems, ...eventItems, ...runItems].sort((a, b) => {
|
2026-02-26 16:30:12 -06:00
|
|
|
if (a.createdAtMs !== b.createdAtMs) return a.createdAtMs - b.createdAtMs;
|
|
|
|
|
if (a.kind === b.kind) return a.id.localeCompare(b.id);
|
2026-04-02 11:51:40 -05:00
|
|
|
const kindOrder = {
|
|
|
|
|
event: 0,
|
2026-04-06 10:36:31 -05:00
|
|
|
approval: 1,
|
|
|
|
|
comment: 2,
|
|
|
|
|
run: 3,
|
2026-04-02 11:51:40 -05:00
|
|
|
} as const;
|
|
|
|
|
return kindOrder[a.kind] - kindOrder[b.kind];
|
2026-02-26 16:30:12 -06:00
|
|
|
});
|
2026-04-06 10:36:31 -05:00
|
|
|
}, [comments, linkedApprovals, timelineEvents, 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-04-02 09:11:49 -05:00
|
|
|
const feedbackVoteByTargetId = useMemo(() => {
|
|
|
|
|
const map = new Map<string, FeedbackVoteValue>();
|
|
|
|
|
for (const feedbackVote of feedbackVotes) {
|
|
|
|
|
if (feedbackVote.targetType !== "issue_comment") continue;
|
|
|
|
|
map.set(feedbackVote.targetId, feedbackVote.vote);
|
|
|
|
|
}
|
|
|
|
|
return map;
|
|
|
|
|
}, [feedbackVotes]);
|
|
|
|
|
|
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[]>(() => {
|
2026-03-02 13:31:58 -06:00
|
|
|
if (providedMentions) return providedMentions;
|
2026-02-20 13:35:15 -06:00
|
|
|
if (!agentMap) return [];
|
2026-02-23 14:41:21 -06:00
|
|
|
return Array.from(agentMap.values())
|
|
|
|
|
.filter((a) => a.status !== "terminated")
|
|
|
|
|
.map((a) => ({
|
2026-03-21 14:48:10 -05:00
|
|
|
id: `agent:${a.id}`,
|
2026-02-23 14:41:21 -06:00
|
|
|
name: a.name,
|
2026-03-21 14:48:10 -05:00
|
|
|
kind: "agent",
|
|
|
|
|
agentId: a.id,
|
|
|
|
|
agentIcon: a.icon,
|
2026-02-23 14:41:21 -06:00
|
|
|
}));
|
2026-03-02 13:31:58 -06:00
|
|
|
}, [agentMap, providedMentions]);
|
2026-02-20 13:35:15 -06:00
|
|
|
|
2026-04-09 10:26:17 -05: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);
|
|
|
|
|
};
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
setReassignTarget(effectiveSuggestedAssigneeValue);
|
|
|
|
|
}, [effectiveSuggestedAssigneeValue]);
|
|
|
|
|
|
2026-03-05 11:02:22 -06:00
|
|
|
// Scroll to comment when URL hash matches #comment-{id}
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
const hash = location.hash;
|
2026-03-28 11:25:25 -05:00
|
|
|
if (!hash.startsWith("#comment-") || comments.length + queuedComments.length === 0) return;
|
2026-03-05 11:02:22 -06:00
|
|
|
const commentId = hash.slice("#comment-".length);
|
|
|
|
|
// Only scroll once per hash
|
|
|
|
|
if (hasScrolledRef.current) return;
|
|
|
|
|
const el = document.getElementById(`comment-${commentId}`);
|
|
|
|
|
if (el) {
|
|
|
|
|
hasScrolledRef.current = true;
|
|
|
|
|
setHighlightCommentId(commentId);
|
|
|
|
|
el.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
|
|
|
// Clear highlight after animation
|
|
|
|
|
const timer = setTimeout(() => setHighlightCommentId(null), 3000);
|
|
|
|
|
return () => clearTimeout(timer);
|
|
|
|
|
}
|
2026-03-28 11:25:25 -05:00
|
|
|
}, [location.hash, comments, queuedComments]);
|
2026-03-05 11:02:22 -06:00
|
|
|
|
2026-04-09 10:26:17 -05:00
|
|
|
async function handleSubmit() {
|
|
|
|
|
const trimmed = body.trim();
|
|
|
|
|
if (!trimmed) return;
|
|
|
|
|
const hasReassignment = enableReassign && reassignTarget !== currentAssigneeValue;
|
|
|
|
|
const reassignment = hasReassignment ? parseReassignment(reassignTarget) : null;
|
[codex] Improve issue detail and issue-list UX (#3678)
## Thinking Path
> - Paperclip orchestrates AI agents for zero-human companies
> - A core part of that is the operator experience around reading issue
state, agent chat, and sub-task structure
> - The current branch had a long run of issue-detail and issue-list UX
fixes that all improve how humans follow and steer active work
> - Those changes mostly live in the UI/chat surface and should be
reviewed together instead of mixed with workspace/runtime work
> - This pull request packages the issue-detail, chat, markdown, and
sub-issue list improvements into one standalone change
> - The benefit is a cleaner, less jumpy, more reliable issue workflow
on desktop and mobile without coupling it to unrelated server/runtime
refactors
## What Changed
- Stabilized issue chat runtime wiring, optimistic comment handling,
queued-comment cancellation, and composer anchoring during live updates
- Fixed several issue-detail rendering and navigation regressions
including placeholder bleed, local polling scope, mobile inbox-to-issue
transitions, and visible refresh resets
- Improved markdown and rich-content handling with advisory image
normalization, editor fallback behavior, touch mention recovery, and
`issue:` quicklook links
- Refined sub-issue behavior with parent-derived defaults, current-user
inheritance fixes, empty-state cleanup, and a reusable issue-list
presentation for sub-issues
- Added targeted UI tests for the new issue-detail, chat scroll/message,
placeholder-data, markdown, and issue-list behaviors
## Verification
- `pnpm vitest run ui/src/components/IssueChatThread.test.tsx
ui/src/components/MarkdownEditor.test.tsx
ui/src/components/IssuesList.test.tsx
ui/src/context/LiveUpdatesProvider.test.tsx
ui/src/lib/issue-chat-messages.test.ts
ui/src/lib/issue-chat-scroll.test.ts
ui/src/lib/issue-detail-subissues.test.ts
ui/src/lib/query-placeholder-data.test.tsx
ui/src/hooks/usePaperclipIssueRuntime.test.tsx`
## Risks
- Medium: this branch touches the highest-traffic issue-detail UI paths,
so regressions would show up as chat/thread or sub-issue UX glitches
- The changes are UI-heavy and would benefit from reviewer screenshots
or a quick manual browser pass before merge
## Model Used
- OpenAI Codex coding agent (GPT-5-class runtime in Codex CLI; exact
deployed model ID is not exposed in this environment), reasoning
enabled, tool use and local code execution enabled
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [ ] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-14 12:50:48 -05:00
|
|
|
const reopen = shouldImplicitlyReopenComment(
|
|
|
|
|
issueStatus,
|
|
|
|
|
hasReassignment ? reassignTarget : currentAssigneeValue,
|
|
|
|
|
) ? true : undefined;
|
2026-04-09 10:26:17 -05:00
|
|
|
const submittedBody = trimmed;
|
|
|
|
|
|
|
|
|
|
setSubmitting(true);
|
|
|
|
|
setBody("");
|
|
|
|
|
try {
|
[codex] Improve issue detail and issue-list UX (#3678)
## Thinking Path
> - Paperclip orchestrates AI agents for zero-human companies
> - A core part of that is the operator experience around reading issue
state, agent chat, and sub-task structure
> - The current branch had a long run of issue-detail and issue-list UX
fixes that all improve how humans follow and steer active work
> - Those changes mostly live in the UI/chat surface and should be
reviewed together instead of mixed with workspace/runtime work
> - This pull request packages the issue-detail, chat, markdown, and
sub-issue list improvements into one standalone change
> - The benefit is a cleaner, less jumpy, more reliable issue workflow
on desktop and mobile without coupling it to unrelated server/runtime
refactors
## What Changed
- Stabilized issue chat runtime wiring, optimistic comment handling,
queued-comment cancellation, and composer anchoring during live updates
- Fixed several issue-detail rendering and navigation regressions
including placeholder bleed, local polling scope, mobile inbox-to-issue
transitions, and visible refresh resets
- Improved markdown and rich-content handling with advisory image
normalization, editor fallback behavior, touch mention recovery, and
`issue:` quicklook links
- Refined sub-issue behavior with parent-derived defaults, current-user
inheritance fixes, empty-state cleanup, and a reusable issue-list
presentation for sub-issues
- Added targeted UI tests for the new issue-detail, chat scroll/message,
placeholder-data, markdown, and issue-list behaviors
## Verification
- `pnpm vitest run ui/src/components/IssueChatThread.test.tsx
ui/src/components/MarkdownEditor.test.tsx
ui/src/components/IssuesList.test.tsx
ui/src/context/LiveUpdatesProvider.test.tsx
ui/src/lib/issue-chat-messages.test.ts
ui/src/lib/issue-chat-scroll.test.ts
ui/src/lib/issue-detail-subissues.test.ts
ui/src/lib/query-placeholder-data.test.tsx
ui/src/hooks/usePaperclipIssueRuntime.test.tsx`
## Risks
- Medium: this branch touches the highest-traffic issue-detail UI paths,
so regressions would show up as chat/thread or sub-issue UX glitches
- The changes are UI-heavy and would benefit from reviewer screenshots
or a quick manual browser pass before merge
## Model Used
- OpenAI Codex coding agent (GPT-5-class runtime in Codex CLI; exact
deployed model ID is not exposed in this environment), reasoning
enabled, tool use and local code execution enabled
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [ ] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-14 12:50:48 -05:00
|
|
|
await onAdd(submittedBody, reopen, reassignment ?? undefined);
|
2026-04-09 10:26:17 -05:00
|
|
|
if (draftKey) clearDraft(draftKey);
|
|
|
|
|
setReassignTarget(effectiveSuggestedAssigneeValue);
|
|
|
|
|
} catch {
|
|
|
|
|
setBody((current) =>
|
|
|
|
|
restoreSubmittedCommentDraft({
|
|
|
|
|
currentBody: current,
|
|
|
|
|
submittedBody,
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
// Parent mutation handlers surface the failure and the draft is restored for retry.
|
|
|
|
|
} finally {
|
|
|
|
|
setSubmitting(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function handleAttachFile(evt: ChangeEvent<HTMLInputElement>) {
|
|
|
|
|
const file = evt.target.files?.[0];
|
|
|
|
|
if (!file) return;
|
|
|
|
|
setAttaching(true);
|
|
|
|
|
try {
|
|
|
|
|
if (imageUploadHandler) {
|
|
|
|
|
const url = await imageUploadHandler(file);
|
|
|
|
|
const safeName = file.name.replace(/[[\]]/g, "\\$&");
|
|
|
|
|
const markdown = ``;
|
|
|
|
|
setBody((prev) => prev ? `${prev}\n\n${markdown}` : markdown);
|
|
|
|
|
} else if (onAttachImage) {
|
|
|
|
|
await onAttachImage(file);
|
2026-03-10 16:50:57 -07:00
|
|
|
}
|
2026-04-09 10:26:17 -05:00
|
|
|
} finally {
|
|
|
|
|
setAttaching(false);
|
|
|
|
|
if (attachInputRef.current) attachInputRef.current.value = "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function handleFeedbackVote(
|
|
|
|
|
commentId: string,
|
|
|
|
|
vote: FeedbackVoteValue,
|
|
|
|
|
options?: { allowSharing?: boolean; reason?: string },
|
|
|
|
|
) {
|
|
|
|
|
if (!onVote) return;
|
|
|
|
|
setVotingTargetId(commentId);
|
|
|
|
|
try {
|
|
|
|
|
await onVote(commentId, vote, options);
|
|
|
|
|
} finally {
|
|
|
|
|
setVotingTargetId(null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const canSubmit = !submitting && !!body.trim();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="space-y-4">
|
|
|
|
|
<h3 className="text-sm font-semibold">Timeline ({timeline.length + queuedComments.length})</h3>
|
2026-03-28 11:25:25 -05:00
|
|
|
|
2026-04-02 09:11:49 -05:00
|
|
|
<TimelineList
|
|
|
|
|
timeline={timeline}
|
|
|
|
|
agentMap={agentMap}
|
2026-04-02 11:51:40 -05:00
|
|
|
currentUserId={currentUserId}
|
2026-04-02 09:11:49 -05:00
|
|
|
companyId={companyId}
|
|
|
|
|
projectId={projectId}
|
2026-04-06 10:36:31 -05:00
|
|
|
onApproveApproval={onApproveApproval}
|
|
|
|
|
onRejectApproval={onRejectApproval}
|
|
|
|
|
pendingApprovalAction={pendingApprovalAction}
|
2026-04-02 09:11:49 -05:00
|
|
|
feedbackVoteByTargetId={feedbackVoteByTargetId}
|
|
|
|
|
feedbackDataSharingPreference={feedbackDataSharingPreference}
|
|
|
|
|
onVote={onVote ? handleFeedbackVote : undefined}
|
|
|
|
|
votingTargetId={votingTargetId}
|
|
|
|
|
highlightCommentId={highlightCommentId}
|
|
|
|
|
feedbackTermsUrl={feedbackTermsUrl}
|
|
|
|
|
/>
|
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-25 21:36:06 -06:00
|
|
|
{liveRunSlot}
|
|
|
|
|
|
2026-03-28 11:25:25 -05:00
|
|
|
{queuedComments.length > 0 && (
|
|
|
|
|
<div className="space-y-3">
|
|
|
|
|
<div className="flex items-center justify-between gap-2">
|
|
|
|
|
<h4 className="text-xs font-semibold uppercase tracking-[0.14em] text-amber-700 dark:text-amber-300">
|
|
|
|
|
Queued Comments ({queuedComments.length})
|
|
|
|
|
</h4>
|
|
|
|
|
{onInterruptQueued && queuedComments[0]?.queueTargetRunId ? (
|
|
|
|
|
<Button
|
|
|
|
|
size="sm"
|
|
|
|
|
variant="outline"
|
|
|
|
|
className="border-red-300 text-red-700 hover:bg-red-50 hover:text-red-800 dark:border-red-500/40 dark:text-red-300 dark:hover:bg-red-500/10"
|
|
|
|
|
disabled={interruptingQueuedRunId === queuedComments[0].queueTargetRunId}
|
|
|
|
|
onClick={() => void onInterruptQueued(queuedComments[0]!.queueTargetRunId!)}
|
|
|
|
|
>
|
|
|
|
|
{interruptingQueuedRunId === queuedComments[0].queueTargetRunId ? "Interrupting..." : "Interrupt"}
|
|
|
|
|
</Button>
|
|
|
|
|
) : null}
|
|
|
|
|
</div>
|
|
|
|
|
<div className="space-y-3">
|
|
|
|
|
{queuedComments.map((comment) => (
|
|
|
|
|
<CommentCard
|
|
|
|
|
key={comment.id}
|
|
|
|
|
comment={comment}
|
|
|
|
|
agentMap={agentMap}
|
|
|
|
|
companyId={companyId}
|
|
|
|
|
projectId={projectId}
|
|
|
|
|
highlightCommentId={highlightCommentId}
|
|
|
|
|
queued
|
|
|
|
|
/>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-04-04 13:04:34 -05:00
|
|
|
{composerDisabledReason ? (
|
|
|
|
|
<div className="rounded-md border border-amber-300/70 bg-amber-50/80 px-3 py-2 text-sm text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-100">
|
|
|
|
|
{composerDisabledReason}
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
2026-04-09 10:26:17 -05:00
|
|
|
<div className="space-y-2">
|
|
|
|
|
<MarkdownEditor
|
|
|
|
|
ref={editorRef}
|
|
|
|
|
value={body}
|
|
|
|
|
onChange={setBody}
|
|
|
|
|
placeholder="Leave a comment..."
|
|
|
|
|
mentions={mentions}
|
|
|
|
|
onSubmit={handleSubmit}
|
|
|
|
|
imageUploadHandler={imageUploadHandler}
|
|
|
|
|
contentClassName="min-h-[60px] text-sm"
|
|
|
|
|
/>
|
|
|
|
|
<div className="flex items-center justify-end gap-3">
|
|
|
|
|
{(imageUploadHandler || onAttachImage) && (
|
|
|
|
|
<div className="mr-auto flex items-center gap-3">
|
|
|
|
|
<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>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
{enableReassign && reassignOptions.length > 0 && (
|
|
|
|
|
<InlineEntitySelector
|
|
|
|
|
value={reassignTarget}
|
|
|
|
|
options={reassignOptions}
|
|
|
|
|
placeholder="Assignee"
|
|
|
|
|
noneLabel="No assignee"
|
|
|
|
|
searchPlaceholder="Search assignees..."
|
|
|
|
|
emptyMessage="No assignees found."
|
|
|
|
|
onChange={setReassignTarget}
|
|
|
|
|
className="text-xs h-8"
|
|
|
|
|
renderTriggerValue={(option) => {
|
|
|
|
|
if (!option) return <span className="text-muted-foreground">Assignee</span>;
|
|
|
|
|
const agentId = option.id.startsWith("agent:") ? option.id.slice("agent:".length) : null;
|
|
|
|
|
const agent = agentId ? agentMap?.get(agentId) : null;
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{agent ? (
|
|
|
|
|
<AgentIcon icon={agent.icon} className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
|
|
|
|
|
) : null}
|
|
|
|
|
<span className="truncate">{option.label}</span>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}}
|
|
|
|
|
renderOption={(option) => {
|
|
|
|
|
if (!option.id) return <span className="truncate">{option.label}</span>;
|
|
|
|
|
const agentId = option.id.startsWith("agent:") ? option.id.slice("agent:".length) : null;
|
|
|
|
|
const agent = agentId ? agentMap?.get(agentId) : null;
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{agent ? (
|
|
|
|
|
<AgentIcon icon={agent.icon} className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
|
|
|
|
|
) : null}
|
|
|
|
|
<span className="truncate">{option.label}</span>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
<Button size="sm" disabled={!canSubmit} onClick={handleSubmit}>
|
|
|
|
|
{submitting ? "Posting..." : "Comment"}
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-04-04 13:04:34 -05:00
|
|
|
)}
|
2026-04-02 09:11:49 -05: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>
|
|
|
|
|
);
|
|
|
|
|
}
|