Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

Commit

Chat: work item card kinds in the web

G1T-Session:
ses_01m560bz6eeqc8v1hrrha03pap
syntaqxcommitted Parentc65f3d3Browse files
3 files+9−90/3 viewed
+2−2
3636
3737 const CARD_ICONS: Record<string, ReactNode> = {
3838 pull: <GitPullRequest size={16} />,
39− issue: <CircleDot size={16} />,
40− draft_issue: <CircleDotDashed size={16} />,
39+ work_item: <CircleDot size={16} />,
40+ draft_work_item: <CircleDotDashed size={16} />,
4141 task: <ListChecks size={16} />,
4242 deploy: <Rocket size={16} />,
4343 approval: <ShieldCheck size={16} />,
+5−5
1515 });
1616
1717 test("a draft issue's chip says where it is", () => {
18− assert.deepEqual(cardChip({ kind: "draft_issue", state: "Draft" }), { tone: "accent", live: false, outline: true });
19− assert.equal(cardChip({ kind: "draft_issue", state: "Filed" })?.tone, "success");
20− assert.equal(cardChip({ kind: "draft_issue", state: "Discarded" })?.tone, "neutral");
21− assert.equal(cardChip({ kind: "draft_issue", state: "Something new" })?.tone, "neutral");
22− assert.equal(cardChip({ kind: "draft_issue", state: null }), null);
18+ assert.deepEqual(cardChip({ kind: "draft_work_item", state: "Draft" }), { tone: "accent", live: false, outline: true });
19+ assert.equal(cardChip({ kind: "draft_work_item", state: "Filed" })?.tone, "success");
20+ assert.equal(cardChip({ kind: "draft_work_item", state: "Discarded" })?.tone, "neutral");
21+ assert.equal(cardChip({ kind: "draft_work_item", state: "Something new" })?.tone, "neutral");
22+ assert.equal(cardChip({ kind: "draft_work_item", state: null }), null);
2323 assert.equal(cardChip({ kind: "pull", state: "Merged" }), null);
2424 });
2525
+2−2
1818 };
1919
2020 /**
21− * How a draft issue's state reads; null for other kinds (a session's chip
21+ * How a draft work item's state reads; null for other kinds (a session's chip
2222 * is lib/session-card.ts's, others are guessed from their words).
2323 */
2424 export function cardChip(card: Pick<MessageCard, "kind" | "state">): CardChip | null {
2525 if (!card.state) return null;
26− if (card.kind === "draft_issue") return DRAFT_CHIPS[card.state.trim().toLowerCase()] ?? { tone: "neutral", live: false };
26+ if (card.kind === "draft_work_item") return DRAFT_CHIPS[card.state.trim().toLowerCase()] ?? { tone: "neutral", live: false };
2727 return null;
2828 }
2929

Comments

Sign in to comment.