mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-13 13:38:01 +02:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The task view shows operators why work cannot continue > - The redesigned task thread now shows direct and ultimate blockers > - But it does not show the ordered task queue while a blocker chain has live work > - This pull request adds a compact ordered live-work queue to the redesigned thread > - The benefit is that operators can see completed, running, and queued dependencies without opening the larger legacy notice ## Linked Issues or Issue Description **What existing behavior does this improve?** The redesigned task thread blocker summary is improved. The merged predecessor is #11456. **Current behavior** The redesigned task thread shows compact direct and ultimate blocker links. It does not show the ordered queue when the blocker tree has live work. The legacy task view shows this queue in a larger notice. **Proposed behavior** Show a compact blue live-work queue at both ends of the redesigned task thread. Order completed tasks first, then running tasks, then queued tasks. Show a live terminal leaf as `Now running`. Return to the amber blocker links when no live dependency remains. **Reason and benefit** Operators can see the active dependency order without leaving the redesigned task view. The compact presentation preserves the new thread's low-chrome layout. **Breaking changes** None. The change only adds UI for blocker data that the task view already receives. ## What Changed - Shared the live blocker ordering helper between the legacy notice and the redesigned task thread. - Added compact ordered dependency links at the top and bottom of the redesigned thread. - Added a separate `Now running` link for a live terminal blocker leaf. - Preserved the compact amber blocker rows when live work is not present. - Added component tests and a Storybook state for the new presentation. ## Verification - `pnpm exec vitest run ui/src/components/TaskChatThread.test.tsx ui/src/components/IssueBlockedNotice.test.tsx` - `pnpm check:token-gates` - `pnpm -r typecheck` - `pnpm test:run` - `pnpm build` - `pnpm --filter @paperclipai/ui build-storybook` - Captured and reviewed the new Storybook state in a headless browser. ## Risks - Low risk. The queue appears only for blocked tasks whose blocker attention state is `covered` and whose dependency set contains live work. - The API does not provide an explicit queue position. The UI preserves the existing legacy ordering rule: completed, running, queued, then numeric task identifier. > 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. The runtime does not expose the exact snapshot or context-window size. Reasoning, code execution, repository tools, and browser automation were 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 checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge Co-authored-by: Paperclip <noreply@paperclip.ing>
61 lines
2.0 KiB
TypeScript
61 lines
2.0 KiB
TypeScript
import type { IssueRelationIssueSummary } from "@paperclipai/shared";
|
|
|
|
export type WaitingBlockerStatus = "done" | "running" | "queued";
|
|
|
|
export interface WaitingBlockerStep {
|
|
blocker: IssueRelationIssueSummary;
|
|
status: WaitingBlockerStatus;
|
|
}
|
|
|
|
export function classifyWaitingBlocker(
|
|
blocker: IssueRelationIssueSummary,
|
|
liveIssueIds: ReadonlySet<string>,
|
|
): WaitingBlockerStatus {
|
|
if (blocker.status === "done" || blocker.status === "cancelled") return "done";
|
|
if (liveIssueIds.has(blocker.id)) return "running";
|
|
return "queued";
|
|
}
|
|
|
|
const WAITING_BLOCKER_RANK: Record<WaitingBlockerStatus, number> = {
|
|
done: 0,
|
|
running: 1,
|
|
queued: 2,
|
|
};
|
|
|
|
/**
|
|
* Orders the explicit blocker queue the same way in every task surface.
|
|
*
|
|
* The blocker payload does not carry an explicit sequence. Status gives the
|
|
* operational order (completed work, current work, queued work), while the
|
|
* identifier is the stable tie-break used by plan-generated task chains.
|
|
*/
|
|
export function orderWaitingBlockers(
|
|
blockers: IssueRelationIssueSummary[],
|
|
liveIssueIds: ReadonlySet<string>,
|
|
): WaitingBlockerStep[] {
|
|
return blockers
|
|
.map((blocker) => ({ blocker, status: classifyWaitingBlocker(blocker, liveIssueIds) }))
|
|
.sort((a, b) => {
|
|
const rank = WAITING_BLOCKER_RANK[a.status] - WAITING_BLOCKER_RANK[b.status];
|
|
if (rank !== 0) return rank;
|
|
const aKey = a.blocker.identifier ?? a.blocker.id;
|
|
const bKey = b.blocker.identifier ?? b.blocker.id;
|
|
return aKey.localeCompare(bKey, undefined, { numeric: true });
|
|
});
|
|
}
|
|
|
|
export function isAssignedBacklogBlocker(blocker: IssueRelationIssueSummary): boolean {
|
|
return blocker.status === "backlog" && Boolean(blocker.assigneeAgentId);
|
|
}
|
|
|
|
export function hasAssignedBacklogBlocker(
|
|
blockers: IssueRelationIssueSummary[] | undefined | null,
|
|
): boolean {
|
|
if (!blockers || blockers.length === 0) return false;
|
|
return blockers.some((blocker) => {
|
|
if (isAssignedBacklogBlocker(blocker)) return true;
|
|
if (blocker.terminalBlockers?.some(isAssignedBacklogBlocker)) return true;
|
|
return false;
|
|
});
|
|
}
|