mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-23 09:07:46 +02:00
Restore covered blocked cyan status ring
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
b587edd925
commit
2d57b8dafa
3 files changed
+17
-12
No files matched your search
@@ -5,7 +5,7 @@ import { describe, expect, it } from "vitest";
|
||||
import { StatusIcon } from "./StatusIcon";
|
||||
|
||||
describe("StatusIcon", () => {
|
||||
it("renders covered blocked issues with a dashed red attention state label", () => {
|
||||
it("renders covered blocked issues with the cyan covered state visual", () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<StatusIcon
|
||||
status="blocked"
|
||||
@@ -23,10 +23,10 @@ describe("StatusIcon", () => {
|
||||
expect(html).toContain('data-blocker-attention-state="covered"');
|
||||
expect(html).toContain('aria-label="Blocked · waiting on active sub-issue PAP-2"');
|
||||
expect(html).toContain('title="Blocked · waiting on active sub-issue PAP-2"');
|
||||
expect(html).toContain("border-red-600");
|
||||
expect(html).toContain("border-dashed");
|
||||
expect(html).not.toContain("border-cyan-600");
|
||||
expect(html).not.toContain("-bottom-0.5");
|
||||
expect(html).toContain("border-cyan-600");
|
||||
expect(html).not.toContain("border-red-600");
|
||||
expect(html).not.toContain("border-dashed");
|
||||
expect(html).toContain("-bottom-0.5");
|
||||
});
|
||||
|
||||
it("uses covered blocked copy for the active dependency count matrix", () => {
|
||||
@@ -45,7 +45,8 @@ describe("StatusIcon", () => {
|
||||
);
|
||||
|
||||
expect(html).toContain('aria-label="Blocked · covered by 2 active dependencies"');
|
||||
expect(html).toContain("border-dashed");
|
||||
expect(html).toContain("border-cyan-600");
|
||||
expect(html).not.toContain("border-dashed");
|
||||
});
|
||||
|
||||
it("keeps normal blocked issues on the attention-required visual", () => {
|
||||
|
||||
@@ -51,7 +51,9 @@ function blockedAttentionLabel(blockerAttention: IssueBlockerAttention | null |
|
||||
export function StatusIcon({ status, blockerAttention, onChange, className, showLabel }: StatusIconProps) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const isCoveredBlocked = status === "blocked" && blockerAttention?.state === "covered";
|
||||
const colorClass = issueStatusIcon[status] ?? issueStatusIconDefault;
|
||||
const colorClass = isCoveredBlocked
|
||||
? "text-cyan-600 border-cyan-600 dark:text-cyan-400 dark:border-cyan-400"
|
||||
: issueStatusIcon[status] ?? issueStatusIconDefault;
|
||||
const isDone = status === "done";
|
||||
const ariaLabel = status === "blocked" ? blockedAttentionLabel(blockerAttention) : statusLabel(status);
|
||||
|
||||
@@ -60,7 +62,6 @@ export function StatusIcon({ status, blockerAttention, onChange, className, show
|
||||
className={cn(
|
||||
"relative inline-flex h-4 w-4 rounded-full border-2 shrink-0",
|
||||
colorClass,
|
||||
isCoveredBlocked && "border-dashed",
|
||||
onChange && !showLabel && "cursor-pointer",
|
||||
className
|
||||
)}
|
||||
@@ -71,6 +72,9 @@ export function StatusIcon({ status, blockerAttention, onChange, className, show
|
||||
{isDone && (
|
||||
<span className="absolute inset-0 m-auto h-2 w-2 rounded-full bg-current" />
|
||||
)}
|
||||
{isCoveredBlocked && (
|
||||
<span className="absolute -bottom-0.5 -right-0.5 h-2 w-2 rounded-full border border-background bg-current" />
|
||||
)}
|
||||
</span>
|
||||
);
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ const coveredBlockedMatrix: CoveredBlockedCell[] = [
|
||||
attentionBlockerCount: 0,
|
||||
sampleBlockerIdentifier: "PAP-2175",
|
||||
},
|
||||
expectedVisual: "dashed red ring",
|
||||
expectedVisual: "cyan ring",
|
||||
expectedCopy: "Blocked · waiting on active sub-issue PAP-2175",
|
||||
},
|
||||
{
|
||||
@@ -76,7 +76,7 @@ const coveredBlockedMatrix: CoveredBlockedCell[] = [
|
||||
attentionBlockerCount: 0,
|
||||
sampleBlockerIdentifier: null,
|
||||
},
|
||||
expectedVisual: "dashed red ring",
|
||||
expectedVisual: "cyan ring",
|
||||
expectedCopy: "Blocked · waiting on 3 active sub-issues",
|
||||
},
|
||||
{
|
||||
@@ -90,7 +90,7 @@ const coveredBlockedMatrix: CoveredBlockedCell[] = [
|
||||
attentionBlockerCount: 0,
|
||||
sampleBlockerIdentifier: "PAP-1918",
|
||||
},
|
||||
expectedVisual: "dashed red ring",
|
||||
expectedVisual: "cyan ring",
|
||||
expectedCopy: "Blocked · covered by active dependency PAP-1918",
|
||||
},
|
||||
{
|
||||
@@ -104,7 +104,7 @@ const coveredBlockedMatrix: CoveredBlockedCell[] = [
|
||||
attentionBlockerCount: 0,
|
||||
sampleBlockerIdentifier: null,
|
||||
},
|
||||
expectedVisual: "dashed red ring",
|
||||
expectedVisual: "cyan ring",
|
||||
expectedCopy: "Blocked · covered by 2 active dependencies",
|
||||
},
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user