@shinnodua/agent-workflows 0.0.0-stage → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/agents/backend-developer/agent.md +39 -0
- package/.agents/agents/frontend-developer/agent.md +42 -0
- package/.agents/agents/project-manager/agent.md +37 -0
- package/.agents/agents/tech-lead/agent.md +41 -0
- package/.agents/agents/ui-ux-designer/agent.md +41 -0
- package/.agents/skills/add-project/SKILL.md +90 -0
- package/.agents/skills/add-project/agents/openai.yaml +4 -0
- package/.agents/skills/add-project/references/save-protocol.md +90 -0
- package/.agents/skills/approve-plan/SKILL.md +86 -0
- package/.agents/skills/approve-plan/agents/openai.yaml +4 -0
- package/.agents/skills/approve-prd/SKILL.md +59 -0
- package/.agents/skills/approve-prd/agents/openai.yaml +4 -0
- package/.agents/skills/auto-mode/SKILL.md +103 -0
- package/.agents/skills/auto-mode/agents/openai.yaml +4 -0
- package/.agents/skills/create-design/SKILL.md +197 -0
- package/.agents/skills/create-design/agents/openai.yaml +4 -0
- package/.agents/skills/create-diagram/SKILL.md +83 -0
- package/.agents/skills/create-diagram/agents/openai.yaml +4 -0
- package/.agents/skills/create-plan/SKILL.md +104 -0
- package/.agents/skills/create-plan/agents/openai.yaml +4 -0
- package/.agents/skills/create-prd/SKILL.md +82 -0
- package/.agents/skills/create-prd/agents/openai.yaml +4 -0
- package/.agents/skills/griling-plan/SKILL.md +114 -0
- package/.agents/skills/griling-plan/agents/openai.yaml +4 -0
- package/.agents/skills/griling-prd/SKILL.md +91 -0
- package/.agents/skills/griling-prd/agents/openai.yaml +4 -0
- package/.agents/skills/package-installation/SKILL.md +67 -0
- package/.agents/skills/package-installation/agents/openai.yaml +4 -0
- package/.agents/skills/project-setup/SKILL.md +104 -0
- package/.agents/skills/project-setup/agents/openai.yaml +3 -0
- package/.agents/skills/research/SKILL.md +61 -0
- package/.agents/skills/research/agents/openai.yaml +4 -0
- package/.agents/skills/sprint-meeting/SKILL.md +230 -0
- package/.agents/skills/sprint-meeting/agents/openai.yaml +4 -0
- package/.claude/agents/backend-developer.md +7 -0
- package/.claude/agents/frontend-developer.md +7 -0
- package/.claude/agents/project-manager.md +7 -0
- package/.claude/agents/tech-lead.md +7 -0
- package/.claude/agents/ui-ux-designer.md +7 -0
- package/.claude/skills/add-project/SKILL.md +10 -0
- package/.claude/skills/approve-plan/SKILL.md +8 -0
- package/.claude/skills/approve-prd/SKILL.md +8 -0
- package/.claude/skills/auto-mode/SKILL.md +8 -0
- package/.claude/skills/create-design/SKILL.md +8 -0
- package/.claude/skills/create-diagram/SKILL.md +8 -0
- package/.claude/skills/create-plan/SKILL.md +8 -0
- package/.claude/skills/create-prd/SKILL.md +8 -0
- package/.claude/skills/griling-plan/SKILL.md +8 -0
- package/.claude/skills/griling-prd/SKILL.md +8 -0
- package/.claude/skills/package-installation/SKILL.md +8 -0
- package/.claude/skills/project-setup/SKILL.md +8 -0
- package/.claude/skills/research/SKILL.md +8 -0
- package/.claude/skills/sprint-meeting/SKILL.md +8 -0
- package/.codex/prompts/add-project.md +3 -0
- package/.codex/prompts/approve-plan.md +3 -0
- package/.codex/prompts/approve-prd.md +3 -0
- package/.codex/prompts/auto-mode.md +3 -0
- package/.codex/prompts/create-design.md +3 -0
- package/.codex/prompts/create-diagram.md +3 -0
- package/.codex/prompts/create-plan.md +3 -0
- package/.codex/prompts/create-prd.md +3 -0
- package/.codex/prompts/griling-plan.md +3 -0
- package/.codex/prompts/griling-prd.md +3 -0
- package/.codex/prompts/grilling-plan.md +3 -0
- package/.codex/prompts/project-setup.md +3 -0
- package/.codex/prompts/research.md +3 -0
- package/.codex/prompts/sprint-meeting.md +3 -0
- package/.gitmodules.example +9 -0
- package/AGENTS.md +84 -0
- package/CLAUDE.md +1 -0
- package/INSTALL.md +284 -0
- package/LICENSE +21 -0
- package/README.md +342 -2
- package/bin/postinstall.js +57 -0
- package/bin/workflows.js +1172 -0
- package/bin/workflows.test.mjs +682 -0
- package/commands/add-project.md +20 -0
- package/commands/approve-plan.md +25 -0
- package/commands/approve-prd.md +24 -0
- package/commands/auto-mode.md +15 -0
- package/commands/create-design.md +20 -0
- package/commands/create-diagram.md +16 -0
- package/commands/create-plan.md +22 -0
- package/commands/create-prd.md +16 -0
- package/commands/griling-plan.md +16 -0
- package/commands/griling-prd.md +16 -0
- package/commands/grilling-plan.md +16 -0
- package/commands/project-setup.md +16 -0
- package/commands/research.md +16 -0
- package/commands/sprint-meeting.md +16 -0
- package/dashboard/.agents/skills/coding-conventions/SKILL.md +76 -0
- package/dashboard/.agents/skills/coding-conventions/agents/openai.yaml +4 -0
- package/dashboard/.agents/skills/design-system-guideline/SKILL.md +51 -0
- package/dashboard/.agents/skills/design-system-guideline/agents/openai.yaml +4 -0
- package/dashboard/.agents/skills/lint-and-fix/SKILL.md +55 -0
- package/dashboard/.agents/skills/lint-and-fix/agents/openai.yaml +4 -0
- package/dashboard/.agents/skills/taste-ui/SKILL.md +45 -0
- package/dashboard/.agents/skills/taste-ui/agents/openai.yaml +4 -0
- package/dashboard/AGENTS.md +43 -0
- package/dashboard/bun.lock +352 -0
- package/dashboard/index.html +12 -0
- package/dashboard/package.json +32 -0
- package/dashboard/src/App.tsx +5 -0
- package/dashboard/src/features/task-status/components/ActionRequiredPanel/ActionRequiredPanel.module.css +85 -0
- package/dashboard/src/features/task-status/components/ActionRequiredPanel/ActionRequiredPanel.tsx +80 -0
- package/dashboard/src/features/task-status/components/ArtifactButton/ArtifactButton.module.css +25 -0
- package/dashboard/src/features/task-status/components/ArtifactButton/ArtifactButton.tsx +29 -0
- package/dashboard/src/features/task-status/components/ArtifactSummaryCards/ArtifactSummaryCards.module.css +29 -0
- package/dashboard/src/features/task-status/components/ArtifactSummaryCards/ArtifactSummaryCards.tsx +35 -0
- package/dashboard/src/features/task-status/components/CategoryPanel/CategoryPanel.module.css +85 -0
- package/dashboard/src/features/task-status/components/CategoryPanel/CategoryPanel.tsx +150 -0
- package/dashboard/src/features/task-status/components/DashboardHeader/DashboardHeader.module.css +41 -0
- package/dashboard/src/features/task-status/components/DashboardHeader/DashboardHeader.tsx +41 -0
- package/dashboard/src/features/task-status/components/FilesPanel/FilesPanel.module.css +25 -0
- package/dashboard/src/features/task-status/components/FilesPanel/FilesPanel.tsx +40 -0
- package/dashboard/src/features/task-status/components/HardnessEngineeringPanel/HardnessEngineeringPanel.module.css +330 -0
- package/dashboard/src/features/task-status/components/HardnessEngineeringPanel/HardnessEngineeringPanel.tsx +299 -0
- package/dashboard/src/features/task-status/components/LifecyclePanel/LifecyclePanel.module.css +74 -0
- package/dashboard/src/features/task-status/components/LifecyclePanel/LifecyclePanel.tsx +79 -0
- package/dashboard/src/features/task-status/components/MarkdownDialog/MarkdownDialog.module.css +133 -0
- package/dashboard/src/features/task-status/components/MarkdownDialog/MarkdownDialog.tsx +233 -0
- package/dashboard/src/features/task-status/components/Sidebar/Sidebar.module.css +53 -0
- package/dashboard/src/features/task-status/components/Sidebar/Sidebar.tsx +163 -0
- package/dashboard/src/features/task-status/components/StatusBadge/StatusBadge.module.css +41 -0
- package/dashboard/src/features/task-status/components/StatusBadge/StatusBadge.tsx +48 -0
- package/dashboard/src/features/task-status/components/TaskOverview/TaskOverview.module.css +97 -0
- package/dashboard/src/features/task-status/components/TaskOverview/TaskOverview.tsx +128 -0
- package/dashboard/src/features/task-status/components/TaskStatusDashboard/TaskStatusDashboard.module.css +9 -0
- package/dashboard/src/features/task-status/components/TaskStatusDashboard/TaskStatusDashboard.tsx +318 -0
- package/dashboard/src/features/task-status/components/WorkflowPanel/WorkflowPanel.module.css +221 -0
- package/dashboard/src/features/task-status/components/WorkflowPanel/WorkflowPanel.tsx +344 -0
- package/dashboard/src/features/task-status/taskStatusConfig.ts +100 -0
- package/dashboard/src/features/task-status/utils/actionItems.ts +247 -0
- package/dashboard/src/features/task-status/utils/artifactGrouping.ts +328 -0
- package/dashboard/src/features/task-status/utils/hardnessScanner.ts +406 -0
- package/dashboard/src/features/task-status/utils/lifecycle.ts +73 -0
- package/dashboard/src/features/task-status/utils/markdownInline/markdownInline.module.css +11 -0
- package/dashboard/src/features/task-status/utils/markdownInline/markdownInline.tsx +104 -0
- package/dashboard/src/features/task-status/utils/markdownLinks.ts +83 -0
- package/dashboard/src/features/task-status/utils/markdownRenderer/markdownRenderer.module.css +74 -0
- package/dashboard/src/features/task-status/utils/markdownRenderer/markdownRenderer.tsx +326 -0
- package/dashboard/src/features/task-status/utils/status.ts +7 -0
- package/dashboard/src/features/task-status/utils/test/actionItems.test.ts +134 -0
- package/dashboard/src/features/task-status/utils/test/artifactGrouping.test.ts +294 -0
- package/dashboard/src/features/task-status/utils/test/hardnessScanner.test.ts +138 -0
- package/dashboard/src/features/task-status/utils/test/lifecycle.test.ts +49 -0
- package/dashboard/src/features/task-status/utils/test/markdownInline.test.ts +41 -0
- package/dashboard/src/features/task-status/utils/test/markdownLinks.test.ts +158 -0
- package/dashboard/src/features/task-status/utils/test/workspaceMetadata.test.ts +37 -0
- package/dashboard/src/features/task-status/utils/workspaceMetadata.ts +175 -0
- package/dashboard/src/main.tsx +16 -0
- package/dashboard/src/shared/design-system.css +134 -0
- package/dashboard/src/shared/design-system.tsx +84 -0
- package/dashboard/src/styles.css +41 -0
- package/dashboard/src/types.ts +133 -0
- package/dashboard/src/workspace-artifacts.d.ts +9 -0
- package/dashboard/tsconfig.json +22 -0
- package/dashboard/vite.config.ts +579 -0
- package/designs/.gitkeep +1 -0
- package/docs/add-project-command-completion.md +117 -0
- package/docs/public-npm-registry-completion.md +104 -0
- package/docs/workflows.png +0 -0
- package/docs/workspace-template-setup.md +229 -0
- package/meeting-logs/.gitkeep +1 -0
- package/modules/.gitkeep +1 -0
- package/package.json +96 -5
- package/plans/.gitkeep +1 -0
- package/prds/.gitkeep +1 -0
- package/project/PROJECT.md +26 -0
- package/project/repositories.json +72 -0
- package/project/validation.json +9 -0
- package/project/workflows.json +20 -0
- package/research/.gitkeep +1 -0
- package/roles/backend-developer.md +26 -0
- package/roles/frontend-developer.md +25 -0
- package/roles/project-manager.md +42 -0
- package/roles/tech-lead.md +42 -0
- package/roles/ui-ux-designer.md +43 -0
- package/scripts/add-project.mjs +990 -0
- package/scripts/add-project.test.mjs +804 -0
- package/scripts/check-staged-security.mjs +97 -0
- package/scripts/check-staged-security.test.mjs +68 -0
- package/scripts/workspace-integrity.ts +220 -0
- package/templates/auto-mode-completion-summary-template.md +78 -0
- package/templates/meeting-log-template.md +177 -0
- package/templates/plan-template.md +219 -0
- package/templates/prd-template.md +106 -0
- package/templates/research-template.md +119 -0
- package/workflows.md +590 -0
- package/workspace.config.json +43 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { displayStatus, normalizeStatus } from "../../utils/status";
|
|
2
|
+
import styles from "./StatusBadge.module.css";
|
|
3
|
+
|
|
4
|
+
type StatusBadgeProps = {
|
|
5
|
+
status: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export function StatusBadge(props: StatusBadgeProps) {
|
|
9
|
+
const { status } = props;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<span className={`${styles.badge} ${getStatusClasses(status)}`}>
|
|
13
|
+
{displayStatus(status)}
|
|
14
|
+
</span>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getStatusClasses(status: string) {
|
|
19
|
+
switch (normalizeStatus(status)) {
|
|
20
|
+
case "approved": {
|
|
21
|
+
return styles.approved;
|
|
22
|
+
}
|
|
23
|
+
case "blocked": {
|
|
24
|
+
return styles.blocked;
|
|
25
|
+
}
|
|
26
|
+
case "complete": {
|
|
27
|
+
return styles.complete;
|
|
28
|
+
}
|
|
29
|
+
case "draft": {
|
|
30
|
+
return styles.draft;
|
|
31
|
+
}
|
|
32
|
+
case "need-design": {
|
|
33
|
+
return styles.needDesign;
|
|
34
|
+
}
|
|
35
|
+
case "design-done": {
|
|
36
|
+
return styles.designDone;
|
|
37
|
+
}
|
|
38
|
+
case "in-progress": {
|
|
39
|
+
return styles.inProgress;
|
|
40
|
+
}
|
|
41
|
+
case "superseded": {
|
|
42
|
+
return styles.superseded;
|
|
43
|
+
}
|
|
44
|
+
default: {
|
|
45
|
+
return styles.unknown;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
@reference "../../../../styles.css";
|
|
2
|
+
|
|
3
|
+
.sectionHeader {
|
|
4
|
+
@apply mb-3 flex items-center gap-2;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.sectionIcon {
|
|
8
|
+
@apply size-5;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.sectionTitle {
|
|
12
|
+
@apply text-2xl font-black;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.taskGrid {
|
|
16
|
+
@apply grid gap-4;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.emptyCard {
|
|
20
|
+
@apply p-5;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.emptyTitle {
|
|
24
|
+
@apply font-black;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.emptyCopy {
|
|
28
|
+
@apply mt-1 text-sm font-bold text-black/60;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.taskCard {
|
|
32
|
+
@apply p-4;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.columns {
|
|
36
|
+
@apply mt-4 grid gap-2 md:grid-cols-4;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.header {
|
|
40
|
+
@apply grid gap-3 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-start;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.headerMain {
|
|
44
|
+
@apply min-w-0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.meta {
|
|
48
|
+
@apply flex flex-wrap items-center gap-2;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.artifactCount {
|
|
52
|
+
@apply rounded-full border-[3px] border-black bg-surface px-3 py-1 text-xs font-black uppercase;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.title {
|
|
56
|
+
@apply mt-3 text-xl font-black leading-tight;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.description {
|
|
60
|
+
@apply mt-2 w-full text-sm font-bold leading-relaxed text-black/70;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.key {
|
|
64
|
+
@apply mt-1 break-all text-sm font-bold text-black/60;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.updated {
|
|
68
|
+
@apply inline-flex w-fit items-center gap-2 text-sm font-black lg:justify-self-end;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.updatedIcon {
|
|
72
|
+
@apply size-4;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.column {
|
|
76
|
+
@apply min-h-24 rounded-xl border-[3px] border-black bg-background p-3;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.columnHeader {
|
|
80
|
+
@apply flex items-center justify-between gap-2;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.columnLabel {
|
|
84
|
+
@apply text-xs font-black uppercase;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.columnItems {
|
|
88
|
+
@apply mt-2 flex flex-col gap-2;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.artifactButton {
|
|
92
|
+
@apply block w-full rounded-lg bg-white px-2 py-1 text-left text-sm font-black underline decoration-[3px] underline-offset-2;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.missing {
|
|
96
|
+
@apply text-sm font-bold text-black/50;
|
|
97
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { CalendarDays, Search } from "lucide-react";
|
|
2
|
+
import { Card } from "../../../../shared/design-system";
|
|
3
|
+
import type { Artifact, TaskGroup } from "../../../../types";
|
|
4
|
+
import { type artifactTypes, taskArtifactTypes } from "../../taskStatusConfig";
|
|
5
|
+
import { StatusBadge } from "../StatusBadge/StatusBadge";
|
|
6
|
+
import styles from "./TaskOverview.module.css";
|
|
7
|
+
|
|
8
|
+
type TaskOverviewProps = {
|
|
9
|
+
onSelectArtifact: (artifact: Artifact) => void;
|
|
10
|
+
taskGroups: TaskGroup[];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function TaskOverview(props: TaskOverviewProps) {
|
|
14
|
+
const { onSelectArtifact, taskGroups } = props;
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<section>
|
|
18
|
+
<div className={styles.sectionHeader}>
|
|
19
|
+
<Search className={styles.sectionIcon} />
|
|
20
|
+
<h2 className={styles.sectionTitle}>Task overview</h2>
|
|
21
|
+
</div>
|
|
22
|
+
<div className={styles.taskGrid}>
|
|
23
|
+
{taskGroups.length > 0 ? (
|
|
24
|
+
taskGroups.map((task) => (
|
|
25
|
+
<TaskCard
|
|
26
|
+
key={task.key}
|
|
27
|
+
onSelectArtifact={onSelectArtifact}
|
|
28
|
+
task={task}
|
|
29
|
+
/>
|
|
30
|
+
))
|
|
31
|
+
) : (
|
|
32
|
+
<Card className={styles.emptyCard} variant="white">
|
|
33
|
+
<p className={styles.emptyTitle}>No matching tasks found.</p>
|
|
34
|
+
<p className={styles.emptyCopy}>
|
|
35
|
+
Try a broader search or clear the filter.
|
|
36
|
+
</p>
|
|
37
|
+
</Card>
|
|
38
|
+
)}
|
|
39
|
+
</div>
|
|
40
|
+
</section>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function TaskCard(props: {
|
|
45
|
+
onSelectArtifact: (artifact: Artifact) => void;
|
|
46
|
+
task: TaskGroup;
|
|
47
|
+
}) {
|
|
48
|
+
const { onSelectArtifact, task } = props;
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Card variant="white" className={styles.taskCard}>
|
|
52
|
+
<TaskCardHeader task={task} />
|
|
53
|
+
<div className={styles.columns}>
|
|
54
|
+
{taskArtifactTypes.map((artifactType) => (
|
|
55
|
+
<TaskArtifactColumn
|
|
56
|
+
artifactType={artifactType}
|
|
57
|
+
key={artifactType.type}
|
|
58
|
+
onSelectArtifact={onSelectArtifact}
|
|
59
|
+
task={task}
|
|
60
|
+
/>
|
|
61
|
+
))}
|
|
62
|
+
</div>
|
|
63
|
+
</Card>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function TaskCardHeader(props: { task: TaskGroup }) {
|
|
68
|
+
const { task } = props;
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<div className={styles.header}>
|
|
72
|
+
<div className={styles.headerMain}>
|
|
73
|
+
<div className={styles.meta}>
|
|
74
|
+
<StatusBadge status={task.status} />
|
|
75
|
+
<span className={styles.artifactCount}>
|
|
76
|
+
{task.artifacts.length} artifacts
|
|
77
|
+
</span>
|
|
78
|
+
</div>
|
|
79
|
+
<h2 className={styles.title}>{task.title}</h2>
|
|
80
|
+
{task.description ? (
|
|
81
|
+
<p className={styles.description}>{task.description}</p>
|
|
82
|
+
) : null}
|
|
83
|
+
<p className={styles.key}>{task.key}</p>
|
|
84
|
+
</div>
|
|
85
|
+
{task.updated ? (
|
|
86
|
+
<div className={styles.updated}>
|
|
87
|
+
<CalendarDays className={styles.updatedIcon} />
|
|
88
|
+
{task.updated}
|
|
89
|
+
</div>
|
|
90
|
+
) : null}
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function TaskArtifactColumn(props: {
|
|
96
|
+
artifactType: (typeof artifactTypes)[number];
|
|
97
|
+
onSelectArtifact: (artifact: Artifact) => void;
|
|
98
|
+
task: TaskGroup;
|
|
99
|
+
}) {
|
|
100
|
+
const { artifactType, onSelectArtifact, task } = props;
|
|
101
|
+
const items = task.byType[artifactType.type];
|
|
102
|
+
const firstStatus = items[0]?.status ?? "missing";
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<div className={styles.column}>
|
|
106
|
+
<div className={styles.columnHeader}>
|
|
107
|
+
<div className={styles.columnLabel}>{artifactType.label}</div>
|
|
108
|
+
<StatusBadge status={firstStatus} />
|
|
109
|
+
</div>
|
|
110
|
+
<div className={styles.columnItems}>
|
|
111
|
+
{items.length > 0 ? (
|
|
112
|
+
items.map((artifact) => (
|
|
113
|
+
<button
|
|
114
|
+
className={styles.artifactButton}
|
|
115
|
+
key={artifact.relativePath}
|
|
116
|
+
onClick={() => onSelectArtifact(artifact)}
|
|
117
|
+
type="button"
|
|
118
|
+
>
|
|
119
|
+
{artifact.title}
|
|
120
|
+
</button>
|
|
121
|
+
))
|
|
122
|
+
) : (
|
|
123
|
+
<span className={styles.missing}>Missing</span>
|
|
124
|
+
)}
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
}
|
package/dashboard/src/features/task-status/components/TaskStatusDashboard/TaskStatusDashboard.tsx
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import {
|
|
2
|
+
artifactEndpoint,
|
|
3
|
+
artifacts as initialArtifacts,
|
|
4
|
+
generatedAt as initialGeneratedAt,
|
|
5
|
+
hardnessReport as initialHardnessReport,
|
|
6
|
+
projectProfile as initialProjectProfile,
|
|
7
|
+
} from "virtual:workspace-artifacts";
|
|
8
|
+
import { useEffect, useState } from "react";
|
|
9
|
+
import type {
|
|
10
|
+
ActionItem,
|
|
11
|
+
Artifact,
|
|
12
|
+
DashboardView,
|
|
13
|
+
DocumentModuleFilter,
|
|
14
|
+
DocumentModuleTab,
|
|
15
|
+
HardnessScanReport,
|
|
16
|
+
ProjectProfile,
|
|
17
|
+
} from "../../../../types";
|
|
18
|
+
import { artifactTypes } from "../../taskStatusConfig";
|
|
19
|
+
import { buildActionItems, filterActionItems } from "../../utils/actionItems";
|
|
20
|
+
import {
|
|
21
|
+
buildTaskGroups,
|
|
22
|
+
countDocumentsByModule,
|
|
23
|
+
filterArtifacts,
|
|
24
|
+
filterDocumentsByModule,
|
|
25
|
+
getVisibleFiles,
|
|
26
|
+
} from "../../utils/artifactGrouping";
|
|
27
|
+
import { ActionRequiredPanel } from "../ActionRequiredPanel/ActionRequiredPanel";
|
|
28
|
+
import { ArtifactSummaryCards } from "../ArtifactSummaryCards/ArtifactSummaryCards";
|
|
29
|
+
import { CategoryPanel } from "../CategoryPanel/CategoryPanel";
|
|
30
|
+
import { DashboardHeader } from "../DashboardHeader/DashboardHeader";
|
|
31
|
+
import { FilesPanel } from "../FilesPanel/FilesPanel";
|
|
32
|
+
import { HardnessEngineeringPanel } from "../HardnessEngineeringPanel/HardnessEngineeringPanel";
|
|
33
|
+
import { LifecyclePanel } from "../LifecyclePanel/LifecyclePanel";
|
|
34
|
+
import { MarkdownDialog } from "../MarkdownDialog/MarkdownDialog";
|
|
35
|
+
import { Sidebar } from "../Sidebar/Sidebar";
|
|
36
|
+
import { TaskOverview } from "../TaskOverview/TaskOverview";
|
|
37
|
+
import { WorkflowPanel } from "../WorkflowPanel/WorkflowPanel";
|
|
38
|
+
import styles from "./TaskStatusDashboard.module.css";
|
|
39
|
+
|
|
40
|
+
type WorkspaceArtifactPayload = {
|
|
41
|
+
artifacts: Artifact[];
|
|
42
|
+
hardnessReport?: HardnessScanReport;
|
|
43
|
+
projectProfile: ProjectProfile;
|
|
44
|
+
generatedAt: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export function TaskStatusDashboard() {
|
|
48
|
+
const [activeView, setActiveView] = useState<DashboardView>("task");
|
|
49
|
+
const [artifactHistory, setArtifactHistory] = useState<Artifact[]>([]);
|
|
50
|
+
const [activeDocumentModule, setActiveDocumentModule] =
|
|
51
|
+
useState<DocumentModuleFilter>("all");
|
|
52
|
+
const [artifactPayload, setArtifactPayload] =
|
|
53
|
+
useState<WorkspaceArtifactPayload>({
|
|
54
|
+
artifacts: initialArtifacts,
|
|
55
|
+
hardnessReport: initialHardnessReport,
|
|
56
|
+
projectProfile: initialProjectProfile,
|
|
57
|
+
generatedAt: initialGeneratedAt,
|
|
58
|
+
});
|
|
59
|
+
const [query, setQuery] = useState("");
|
|
60
|
+
const {
|
|
61
|
+
artifacts,
|
|
62
|
+
generatedAt,
|
|
63
|
+
hardnessReport = initialHardnessReport,
|
|
64
|
+
projectProfile,
|
|
65
|
+
} = artifactPayload;
|
|
66
|
+
const activeArtifact = artifactHistory.at(-1) ?? null;
|
|
67
|
+
const filteredArtifacts = filterArtifacts(artifacts, query);
|
|
68
|
+
const actionItems = filterActionItems(
|
|
69
|
+
buildActionItems(artifacts, projectProfile.repositories),
|
|
70
|
+
query,
|
|
71
|
+
);
|
|
72
|
+
const markdownMetadataCount = artifacts.filter(
|
|
73
|
+
(artifact) => artifact.metadataFormat === "markdown",
|
|
74
|
+
).length;
|
|
75
|
+
const taskGroups = buildTaskGroups(filteredArtifacts);
|
|
76
|
+
const selectedType = artifactTypes.find((type) => type.type === activeView);
|
|
77
|
+
const visibleFiles = getVisibleFiles(filteredArtifacts, activeView);
|
|
78
|
+
const documentModuleTabs = buildDocumentModuleTabs(projectProfile);
|
|
79
|
+
const documentModuleCounts = countDocumentsByModule(
|
|
80
|
+
getVisibleFiles(filteredArtifacts, "document"),
|
|
81
|
+
documentModuleTabs,
|
|
82
|
+
);
|
|
83
|
+
const visibleFilesForView =
|
|
84
|
+
activeView === "document"
|
|
85
|
+
? filterDocumentsByModule(visibleFiles, activeDocumentModule)
|
|
86
|
+
: visibleFiles;
|
|
87
|
+
const visibleFilesTitle =
|
|
88
|
+
activeView === "task"
|
|
89
|
+
? "Task files"
|
|
90
|
+
: activeView === "workflow"
|
|
91
|
+
? "Workflow files"
|
|
92
|
+
: `${selectedType?.label ?? "Selected"} files`;
|
|
93
|
+
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
const controller = new AbortController();
|
|
96
|
+
|
|
97
|
+
async function refreshArtifacts() {
|
|
98
|
+
try {
|
|
99
|
+
const response = await fetch(
|
|
100
|
+
`${artifactEndpoint}?updated=${Date.now().toString()}`,
|
|
101
|
+
{
|
|
102
|
+
cache: "no-store",
|
|
103
|
+
signal: controller.signal,
|
|
104
|
+
},
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
if (!response.ok) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const nextPayload = (await response.json()) as WorkspaceArtifactPayload;
|
|
112
|
+
setArtifactPayload(nextPayload);
|
|
113
|
+
} catch (error) {
|
|
114
|
+
if (!controller.signal.aborted) {
|
|
115
|
+
console.warn("Unable to refresh workspace artifacts.", error);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
refreshArtifacts();
|
|
121
|
+
|
|
122
|
+
return () => controller.abort();
|
|
123
|
+
}, []);
|
|
124
|
+
|
|
125
|
+
function handleSelectView(view: DashboardView) {
|
|
126
|
+
setActiveView(view);
|
|
127
|
+
setArtifactHistory([]);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function handleSelectArtifact(artifact: Artifact) {
|
|
131
|
+
setArtifactHistory([artifact]);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function handleNavigateArtifact(artifact: Artifact) {
|
|
135
|
+
setArtifactHistory((currentHistory) => {
|
|
136
|
+
const currentArtifact = currentHistory.at(-1);
|
|
137
|
+
|
|
138
|
+
if (currentArtifact?.relativePath === artifact.relativePath) {
|
|
139
|
+
return currentHistory;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return [...currentHistory, artifact];
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function handleBackArtifact() {
|
|
147
|
+
setArtifactHistory((currentHistory) => currentHistory.slice(0, -1));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function handleCloseDialog() {
|
|
151
|
+
setArtifactHistory([]);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<>
|
|
156
|
+
<main className={styles.layout}>
|
|
157
|
+
<Sidebar
|
|
158
|
+
activeView={activeView}
|
|
159
|
+
filteredArtifacts={filteredArtifacts}
|
|
160
|
+
actionItems={actionItems}
|
|
161
|
+
hardnessReport={hardnessReport}
|
|
162
|
+
onSelectView={handleSelectView}
|
|
163
|
+
query={query}
|
|
164
|
+
setQuery={setQuery}
|
|
165
|
+
/>
|
|
166
|
+
|
|
167
|
+
<section className={styles.content}>
|
|
168
|
+
<DashboardHeader
|
|
169
|
+
artifactCount={artifacts.length}
|
|
170
|
+
generatedAt={generatedAt}
|
|
171
|
+
markdownMetadataCount={markdownMetadataCount}
|
|
172
|
+
/>
|
|
173
|
+
<ContentPanel
|
|
174
|
+
activeArtifact={activeArtifact}
|
|
175
|
+
actionItems={actionItems}
|
|
176
|
+
activeView={activeView}
|
|
177
|
+
activeDocumentModule={activeDocumentModule}
|
|
178
|
+
artifacts={artifacts}
|
|
179
|
+
documentModuleCounts={documentModuleCounts}
|
|
180
|
+
documentModuleTabs={documentModuleTabs}
|
|
181
|
+
hardnessReport={hardnessReport}
|
|
182
|
+
onSelectArtifact={handleSelectArtifact}
|
|
183
|
+
onSelectDocumentModule={setActiveDocumentModule}
|
|
184
|
+
selectedType={selectedType}
|
|
185
|
+
taskGroups={taskGroups}
|
|
186
|
+
visibleFiles={visibleFilesForView}
|
|
187
|
+
visibleFilesTitle={visibleFilesTitle}
|
|
188
|
+
/>
|
|
189
|
+
</section>
|
|
190
|
+
</main>
|
|
191
|
+
{activeArtifact ? (
|
|
192
|
+
<MarkdownDialog
|
|
193
|
+
artifact={activeArtifact}
|
|
194
|
+
artifacts={artifacts}
|
|
195
|
+
canGoBack={artifactHistory.length > 1}
|
|
196
|
+
onBack={handleBackArtifact}
|
|
197
|
+
onClose={handleCloseDialog}
|
|
198
|
+
onNavigate={handleNavigateArtifact}
|
|
199
|
+
/>
|
|
200
|
+
) : null}
|
|
201
|
+
</>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function ContentPanel(props: {
|
|
206
|
+
activeArtifact: Artifact | null;
|
|
207
|
+
actionItems: ActionItem[];
|
|
208
|
+
activeView: DashboardView;
|
|
209
|
+
activeDocumentModule: DocumentModuleFilter;
|
|
210
|
+
artifacts: Artifact[];
|
|
211
|
+
documentModuleCounts: Record<DocumentModuleFilter, number>;
|
|
212
|
+
documentModuleTabs: DocumentModuleTab[];
|
|
213
|
+
hardnessReport: HardnessScanReport;
|
|
214
|
+
onSelectArtifact: (artifact: Artifact) => void;
|
|
215
|
+
onSelectDocumentModule: (module: DocumentModuleFilter) => void;
|
|
216
|
+
selectedType: (typeof artifactTypes)[number] | undefined;
|
|
217
|
+
taskGroups: ReturnType<typeof buildTaskGroups>;
|
|
218
|
+
visibleFiles: Artifact[];
|
|
219
|
+
visibleFilesTitle: string;
|
|
220
|
+
}) {
|
|
221
|
+
const {
|
|
222
|
+
activeArtifact,
|
|
223
|
+
actionItems,
|
|
224
|
+
activeView,
|
|
225
|
+
activeDocumentModule,
|
|
226
|
+
artifacts,
|
|
227
|
+
documentModuleCounts,
|
|
228
|
+
documentModuleTabs,
|
|
229
|
+
hardnessReport,
|
|
230
|
+
onSelectArtifact,
|
|
231
|
+
onSelectDocumentModule,
|
|
232
|
+
selectedType,
|
|
233
|
+
taskGroups,
|
|
234
|
+
visibleFiles,
|
|
235
|
+
visibleFilesTitle,
|
|
236
|
+
} = props;
|
|
237
|
+
|
|
238
|
+
if (activeView === "task") {
|
|
239
|
+
return (
|
|
240
|
+
<>
|
|
241
|
+
<ArtifactSummaryCards artifacts={artifacts} />
|
|
242
|
+
<TaskOverview
|
|
243
|
+
onSelectArtifact={onSelectArtifact}
|
|
244
|
+
taskGroups={taskGroups}
|
|
245
|
+
/>
|
|
246
|
+
<FilesPanel
|
|
247
|
+
activeArtifact={activeArtifact}
|
|
248
|
+
files={visibleFiles}
|
|
249
|
+
onSelectArtifact={onSelectArtifact}
|
|
250
|
+
title={visibleFilesTitle}
|
|
251
|
+
/>
|
|
252
|
+
</>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (activeView === "workflow") {
|
|
257
|
+
return <WorkflowPanel />;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (activeView === "action-required") {
|
|
261
|
+
return (
|
|
262
|
+
<ActionRequiredPanel
|
|
263
|
+
items={actionItems}
|
|
264
|
+
onSelectArtifact={(item) => onSelectArtifact(item.artifact)}
|
|
265
|
+
/>
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (activeView === "lifecycle") {
|
|
270
|
+
return (
|
|
271
|
+
<LifecyclePanel
|
|
272
|
+
onSelectArtifact={onSelectArtifact}
|
|
273
|
+
taskGroups={taskGroups}
|
|
274
|
+
/>
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (activeView === "hardness") {
|
|
279
|
+
return <HardnessEngineeringPanel report={hardnessReport} />;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if (!selectedType) {
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return (
|
|
287
|
+
<>
|
|
288
|
+
<CategoryPanel
|
|
289
|
+
activeDocumentModule={activeDocumentModule}
|
|
290
|
+
artifactsForType={visibleFiles}
|
|
291
|
+
documentModuleCounts={documentModuleCounts}
|
|
292
|
+
documentModuleTabs={documentModuleTabs}
|
|
293
|
+
onSelectArtifact={onSelectArtifact}
|
|
294
|
+
onSelectDocumentModule={onSelectDocumentModule}
|
|
295
|
+
type={selectedType}
|
|
296
|
+
/>
|
|
297
|
+
<FilesPanel
|
|
298
|
+
activeArtifact={activeArtifact}
|
|
299
|
+
files={visibleFiles}
|
|
300
|
+
onSelectArtifact={onSelectArtifact}
|
|
301
|
+
title={visibleFilesTitle}
|
|
302
|
+
/>
|
|
303
|
+
</>
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function buildDocumentModuleTabs(
|
|
308
|
+
projectProfile: ProjectProfile,
|
|
309
|
+
): DocumentModuleTab[] {
|
|
310
|
+
return [
|
|
311
|
+
{ module: "all", label: "All" },
|
|
312
|
+
{ module: "workspace", label: "Workspace" },
|
|
313
|
+
...projectProfile.repositories.map((repository) => ({
|
|
314
|
+
module: repository.id,
|
|
315
|
+
label: repository.name,
|
|
316
|
+
})),
|
|
317
|
+
];
|
|
318
|
+
}
|