story-kit: merge 254_story_add_refactor_work_item_type

This commit is contained in:
Dave
2026-03-17 00:37:45 +00:00
parent 3553f59078
commit 2fae9066e2
3 changed files with 202 additions and 6 deletions

View File

@@ -4,12 +4,13 @@ import { useLozengeFly } from "./LozengeFlyContext";
const { useLayoutEffect, useRef } = React;
type WorkItemType = "story" | "bug" | "spike" | "unknown";
type WorkItemType = "story" | "bug" | "spike" | "refactor" | "unknown";
const TYPE_COLORS: Record<WorkItemType, string> = {
story: "#3fb950",
bug: "#f85149",
spike: "#58a6ff",
refactor: "#a371f7",
unknown: "#444",
};
@@ -17,6 +18,7 @@ const TYPE_LABELS: Record<WorkItemType, string | null> = {
story: "STORY",
bug: "BUG",
spike: "SPIKE",
refactor: "REFACTOR",
unknown: null,
};
@@ -24,7 +26,12 @@ function getWorkItemType(storyId: string): WorkItemType {
const match = storyId.match(/^\d+_([a-z]+)_/);
if (!match) return "unknown";
const segment = match[1];
if (segment === "story" || segment === "bug" || segment === "spike") {
if (
segment === "story" ||
segment === "bug" ||
segment === "spike" ||
segment === "refactor"
) {
return segment;
}
return "unknown";