mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-20 06:02:18 +02:00
## Thinking Path > - Paperclip is the open source app that people use to manage AI agents for work. > - The task properties panel helps operators inspect and update task data. > - The status, assignee, and project rows used different leading icon sizes. > - The mixed sizes made the rows look uneven. > - The assignee avatar already provides the correct 24px visual size. > - This pull request sets the status and project visuals to that same size. > - The benefit is a tidy and consistent properties panel. ## Linked Issues or Issue Description **What happened?** The task properties panel showed a 12px status icon, a 24px assignee avatar, and a 16px project tile. **Expected behavior** The status, assignee, and project rows must use the same 24px leading visual size. **Steps to reproduce** 1. Open a task. 2. Open the Properties panel. 3. Compare the Status, Assignee, and Project rows. ## What Changed - Keep the Status glyph at 16px and use spacing to give it the 24px avatar footprint. - Set the Project row tile to the 24px small tile size. - Add a regression check for the Status row size. ## Verification - `pnpm exec vitest run ui/src/components/IssueProperties.test.tsx` (72 tests passed) - `pnpm check:token-gates` (all gates clean) - `pnpm --filter @paperclipai/ui typecheck` (passed) - Full repository typecheck and build reached the Rust runner step, but this environment does not contain `cargo`. - The full test command was stopped after unrelated chat integration tests did not finish. The focused UI suite passed. ## Risks - Low risk. This change only changes visual sizes in three property rows. - The wider status footprint can use slightly more horizontal space in a narrow panel. > This fix does not overlap with planned core work in `ROADMAP.md`. ## Model Used - OpenAI Codex, GPT-5.6, tool use and 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 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) - [ ] 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>
156 lines
6.1 KiB
TypeScript
156 lines
6.1 KiB
TypeScript
import { useState } from "react";
|
|
import type { IssueBlockerAttention } from "@paperclipai/shared";
|
|
import { cn } from "../lib/utils";
|
|
import { StatusGlyph, type StatusGlyphSize } from "./StatusGlyph";
|
|
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
const allStatuses = ["backlog", "todo", "in_progress", "in_review", "done", "cancelled", "blocked"];
|
|
|
|
function statusLabel(status: string): string {
|
|
return status.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
}
|
|
|
|
interface StatusIconProps {
|
|
status: string;
|
|
externalConversationState?: "active" | "waiting" | null;
|
|
blockerAttention?: IssueBlockerAttention | null;
|
|
onChange?: (status: string) => void;
|
|
className?: string;
|
|
/** Optional layout wrapper around the glyph. Does not change glyph dimensions. */
|
|
glyphContainerClassName?: string;
|
|
showLabel?: boolean;
|
|
/** Glyph size (PAP-243a). Default `md` (16px); lists/detail/mentions use `lg` (20px). */
|
|
size?: StatusGlyphSize;
|
|
}
|
|
|
|
function blockedAttentionLabel(blockerAttention: IssueBlockerAttention | null | undefined) {
|
|
if (!blockerAttention || blockerAttention.state === "none") return "Blocked";
|
|
|
|
if (blockerAttention.reason === "active_child") {
|
|
const count = blockerAttention.coveredBlockerCount;
|
|
if (count === 1 && blockerAttention.sampleBlockerIdentifier) {
|
|
return `Blocked · waiting on active sub-task ${blockerAttention.sampleBlockerIdentifier}`;
|
|
}
|
|
if (count === 1) return "Blocked · waiting on 1 active sub-task";
|
|
return `Blocked · waiting on ${count} active sub-tasks`;
|
|
}
|
|
|
|
if (blockerAttention.reason === "active_dependency") {
|
|
const count = blockerAttention.coveredBlockerCount;
|
|
if (count === 1 && blockerAttention.sampleBlockerIdentifier) {
|
|
return `Blocked · covered by active dependency ${blockerAttention.sampleBlockerIdentifier}`;
|
|
}
|
|
if (count === 1) return "Blocked · covered by 1 active dependency";
|
|
return `Blocked · covered by ${count} active dependencies`;
|
|
}
|
|
|
|
if (blockerAttention.reason === "stalled_review") {
|
|
const count = blockerAttention.stalledBlockerCount;
|
|
const leaf = blockerAttention.sampleStalledBlockerIdentifier ?? blockerAttention.sampleBlockerIdentifier;
|
|
if (count === 1 && leaf) return `Blocked · review stalled on ${leaf}`;
|
|
if (count === 1) return "Blocked · review stalled with no clear next step";
|
|
return `Blocked · ${count} reviews stalled with no clear next step`;
|
|
}
|
|
|
|
if (blockerAttention.reason === "attention_required") {
|
|
const count = blockerAttention.attentionBlockerCount || blockerAttention.unresolvedBlockerCount;
|
|
const attentionCopy = `${count} ${count === 1 ? "blocker needs" : "blockers need"} attention`;
|
|
const coveredCount = blockerAttention.coveredBlockerCount;
|
|
if (coveredCount > 0) {
|
|
return `Blocked · ${attentionCopy}; ${coveredCount} covered by active work`;
|
|
}
|
|
return `Blocked · ${attentionCopy}`;
|
|
}
|
|
|
|
return "Blocked";
|
|
}
|
|
|
|
/**
|
|
* Task/issue status indicator — renders the unified, color-blind-safe
|
|
* {@link StatusGlyph} (one distinct shape per status). With `onChange` it also
|
|
* acts as a status picker (popover). This one component drives every standalone
|
|
* status surface: list, kanban, detail header, properties row + picker flyout,
|
|
* sub-task / blocked-by pills, blocked inbox, quicklook, sibling nav, filters,
|
|
* search, columns, dashboard.
|
|
*
|
|
* A "covered" blocked task (waiting on active work) maps to the `in_queue`
|
|
* glyph — the blocked shape recoloured blue — while the full blocked reason
|
|
* still rides on the accessible label.
|
|
*/
|
|
export function StatusIcon({ status, externalConversationState, blockerAttention, onChange, className, glyphContainerClassName, showLabel, size = "md" }: StatusIconProps) {
|
|
const [open, setOpen] = useState(false);
|
|
const displayStatus = status === "in_review" && externalConversationState === "waiting" ? "idle" : status;
|
|
const isCoveredBlocked = status === "blocked" && blockerAttention?.state === "covered";
|
|
const ariaLabel = status === "blocked" ? blockedAttentionLabel(blockerAttention) : statusLabel(displayStatus);
|
|
const glyphStatus = isCoveredBlocked ? "in_queue" : displayStatus;
|
|
|
|
const glyphIcon = (
|
|
<StatusGlyph
|
|
status={glyphStatus}
|
|
size={size}
|
|
className={cn(onChange && !showLabel && "cursor-pointer", className)}
|
|
title={ariaLabel}
|
|
/>
|
|
);
|
|
const glyph = glyphContainerClassName ? (
|
|
<span className={glyphContainerClassName} data-status-glyph-container="true">
|
|
{glyphIcon}
|
|
</span>
|
|
) : glyphIcon;
|
|
|
|
if (!onChange) {
|
|
return showLabel ? (
|
|
<span className="inline-flex items-center gap-1.5">
|
|
{glyph}
|
|
<span className="text-sm">{statusLabel(displayStatus)}</span>
|
|
</span>
|
|
) : (
|
|
glyph
|
|
);
|
|
}
|
|
|
|
const trigger = showLabel ? (
|
|
<button
|
|
type="button"
|
|
aria-label={`Change status (current: ${ariaLabel})`}
|
|
className="inline-flex min-h-5 items-center gap-1.5 cursor-pointer hover:bg-accent/50 rounded px-1 -mx-1 py-0.5 transition-colors"
|
|
>
|
|
{glyph}
|
|
<span className="text-sm">{statusLabel(displayStatus)}</span>
|
|
</button>
|
|
) : (
|
|
<button
|
|
type="button"
|
|
data-slot="icon-button"
|
|
aria-label={`Change status (current: ${ariaLabel})`}
|
|
className="inline-flex cursor-pointer items-center justify-center rounded-sm focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-ring"
|
|
>
|
|
{glyph}
|
|
</button>
|
|
);
|
|
|
|
return (
|
|
<Popover open={open} onOpenChange={setOpen}>
|
|
<PopoverTrigger asChild>{trigger}</PopoverTrigger>
|
|
<PopoverContent className="w-40 p-1" align="start">
|
|
{allStatuses.map((s) => (
|
|
<Button
|
|
key={s}
|
|
variant="ghost"
|
|
size="sm"
|
|
className={cn("w-full justify-start gap-2 text-xs", s === status && "bg-accent")}
|
|
onClick={() => {
|
|
onChange(s);
|
|
setOpen(false);
|
|
}}
|
|
>
|
|
<StatusIcon status={s} size="lg" />
|
|
{statusLabel(s)}
|
|
</Button>
|
|
))}
|
|
</PopoverContent>
|
|
</Popover>
|
|
);
|
|
}
|