Show workspace changes and stale notices in issue threads (#5356)

## Thinking Path

> - Paperclip orchestrates AI agents for zero-human companies
> - The issue thread is the operator's durable audit trail for what
changed and why
> - Workspace changes and stale disposition notices need to be visible
in that same timeline without noisy or misleading rendering
> - The local branch already contained backend activity details,
timeline conversion, and UI rendering work for those events
> - This pull request isolates the issue-thread activity work into a
standalone branch against `origin/master`
> - The benefit is a focused audit-trail PR that can merge independently
of the sidebar/operator UI polish branch

## What Changed

- Adds readable workspace-change activity details to issue update
activity events.
- Surfaces workspace-change events in issue chat/timeline rendering.
- Makes the existing issue comment migration idempotent.
- Folds and renders stale disposition notices inline so they match
activity-log styling and spacing.
- Adds focused route, timeline, and issue-thread system notice coverage.

## Verification

- `pnpm install --frozen-lockfile`
- `pnpm exec vitest run
server/src/__tests__/issue-activity-events-routes.test.ts
ui/src/lib/issue-timeline-events.test.ts
ui/src/components/IssueChatThreadSystemNotice.test.tsx` — 3 files
passed, 22 tests passed.
- Confirmed the PR changes 9 files and does not include `pnpm-lock.yaml`
or `.github/workflows/*`.
- `pnpm exec vitest run
server/src/__tests__/issue-closed-workspace-routes.test.ts` — 1 file
passed, 4 tests passed.
- `pnpm exec vitest run
server/src/__tests__/issue-activity-events-routes.test.ts
ui/src/lib/issue-timeline-events.test.ts
ui/src/components/IssueChatThreadSystemNotice.test.tsx
server/src/services/recovery/successful-run-handoff.test.ts
packages/shared/src/validators/issue.test.ts` — 5 files passed, 54 tests
passed.
- `pnpm --filter @paperclipai/shared typecheck && pnpm --filter
@paperclipai/server typecheck && pnpm --filter @paperclipai/ui
typecheck`.
- `pnpm --filter @paperclipai/ui typecheck` after adding the Storybook
screenshot fixture.
- Captured Storybook screenshots for the new UI rendering paths:
- Collapsed stale notice + workspace-change row:
`docs/pr-screenshots/pr-5356/issue-thread-notices-collapsed.png`
- Expanded stale notice details:
`docs/pr-screenshots/pr-5356/issue-thread-notices-expanded.png`


### Screenshots

Collapsed stale notice with workspace-change row:

![Collapsed stale notice with workspace-change
row](docs/pr-screenshots/pr-5356/issue-thread-notices-collapsed.png)

Expanded stale notice details:

![Expanded stale notice
details](docs/pr-screenshots/pr-5356/issue-thread-notices-expanded.png)

## Risks

- Moderate risk: this touches issue activity serialization and
issue-thread rendering, both of which are central operator surfaces.
- Migration risk is low: the only migration change makes an existing
migration idempotent.
- No new migrations are introduced, so there is no cross-PR migration
ordering requirement.

> 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 coding agent, shell/tool-use enabled, used to
split the existing branch, verify the isolated PR branch, and create
this PR.

## 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
- [x] 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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Dotta 2026-05-06 09:00:54 -05:00 committed by GitHub
parent 4103978578
commit d0e9cc76f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 852 additions and 36 deletions

View file

@ -404,6 +404,7 @@ const issueChatComments: IssueChatComment[] = [
},
metadata: {
version: 1,
sourceRunId: "run-issue-chat-01",
sections: [
{
title: "Required action",
@ -459,6 +460,73 @@ const issueTimelineEvents: IssueTimelineEvent[] = [
}),
];
const issueThreadNoticeReviewComments: IssueChatComment[] = [
createComment({
id: "comment-notice-board",
body: "The issue thread needs to show workspace routing changes and make old missing-disposition warnings feel resolved.",
createdAt: new Date("2026-04-20T13:44:00.000Z"),
}),
createComment({
id: "comment-notice-system-warning",
authorType: "system",
authorAgentId: null,
authorUserId: null,
runId: "run-notice-source",
runAgentId: codexAgent.id,
body: "Paperclip needs a disposition before this issue can continue.",
presentation: {
kind: "system_notice",
tone: "warning",
title: "Missing issue disposition",
detailsDefaultOpen: false,
},
metadata: {
version: 1,
sourceRunId: "run-notice-source",
sections: [
{
title: "Required action",
rows: [
{ type: "issue_link", label: "Source issue", issueId, identifier: "PAP-3660", title: "Show issue-thread notices" },
{ type: "agent_link", label: "Assignee", agentId: codexAgent.id, name: codexAgent.name },
{ type: "key_value", label: "Missing disposition", value: "clear_next_step" },
],
},
{
title: "Run evidence",
rows: [
{ type: "run_link", label: "Completed run", runId: "run-notice-source", title: "succeeded" },
{ type: "key_value", label: "Normalized cause", value: "successful_run_missing_state" },
],
},
],
},
createdAt: new Date("2026-04-20T13:48:00.000Z"),
}),
];
const issueThreadNoticeReviewTimelineEvents: IssueTimelineEvent[] = [
createSystemEvent({
id: "event-notice-workspace-change",
createdAt: new Date("2026-04-20T13:46:00.000Z"),
statusChange: undefined,
workspaceChange: {
from: {
label: "Project primary workspace",
projectWorkspaceId: "workspace-primary",
executionWorkspaceId: null,
mode: "shared_workspace",
},
to: {
label: "PAP-3660 issue-thread-notices",
projectWorkspaceId: null,
executionWorkspaceId: "execution-workspace-notices",
mode: "isolated_workspace",
},
},
}),
];
const issueLinkedRuns: IssueChatLinkedRun[] = [
{
runId: "run-issue-chat-01",
@ -701,6 +769,43 @@ function IssueChatMatrix() {
);
}
function IssueThreadNoticeReview() {
return (
<div className="paperclip-story">
<main className="paperclip-story__inner max-w-4xl">
<Section eyebrow="IssueChatThread" title="Workspace changes and stale disposition notices">
<div className="rounded-lg border border-border bg-background/70 p-4">
<IssueChatThread
comments={issueThreadNoticeReviewComments}
timelineEvents={issueThreadNoticeReviewTimelineEvents}
linkedRuns={[]}
liveRuns={[]}
companyId={companyId}
projectId={projectId}
issueStatus="done"
successfulRunHandoff={{
state: "resolved",
required: false,
sourceRunId: "run-notice-source",
correctiveRunId: "run-notice-corrective",
assigneeAgentId: codexAgent.id,
detectedProgressSummary: "Captured screenshots for the issue thread notice states.",
createdAt: new Date("2026-04-20T13:49:00.000Z"),
}}
agentMap={storybookAgentMap}
currentUserId={currentUserId}
userLabelMap={boardUserLabels}
onAdd={async () => {}}
enableLiveTranscriptPolling={false}
showJumpToLatest={false}
/>
</div>
</Section>
</main>
</div>
);
}
function ChatCommentsStories() {
return (
<div className="paperclip-story">
@ -771,3 +876,7 @@ export const IssueChatWithTimeline: Story = {
</div>
),
};
export const IssueThreadNotices: Story = {
render: () => <IssueThreadNoticeReview />,
};