orbital-command 0.1.0
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/LICENSE +21 -0
- package/README.md +396 -0
- package/bin/orbital.js +362 -0
- package/dist/assets/WorkflowVisualizer-BZ21PIIF.js +84 -0
- package/dist/assets/WorkflowVisualizer-BZV40eAE.css +1 -0
- package/dist/assets/charts-D__PA1zp.js +72 -0
- package/dist/assets/index-D1G6i0nS.css +1 -0
- package/dist/assets/index-DpItvKpf.js +419 -0
- package/dist/assets/ui-BvF022GT.js +53 -0
- package/dist/assets/vendor-Dzv9lrRc.js +59 -0
- package/dist/index.html +19 -0
- package/dist/scanner-sweep.png +0 -0
- package/dist/server/server/adapters/index.js +34 -0
- package/dist/server/server/adapters/iterm2-adapter.js +29 -0
- package/dist/server/server/adapters/subprocess-adapter.js +21 -0
- package/dist/server/server/adapters/terminal-adapter.js +1 -0
- package/dist/server/server/config.js +156 -0
- package/dist/server/server/database.js +90 -0
- package/dist/server/server/index.js +372 -0
- package/dist/server/server/init.js +811 -0
- package/dist/server/server/parsers/event-parser.js +64 -0
- package/dist/server/server/parsers/scope-parser.js +188 -0
- package/dist/server/server/routes/config-routes.js +163 -0
- package/dist/server/server/routes/data-routes.js +461 -0
- package/dist/server/server/routes/dispatch-routes.js +215 -0
- package/dist/server/server/routes/git-routes.js +92 -0
- package/dist/server/server/routes/scope-routes.js +215 -0
- package/dist/server/server/routes/sprint-routes.js +116 -0
- package/dist/server/server/routes/version-routes.js +130 -0
- package/dist/server/server/routes/workflow-routes.js +185 -0
- package/dist/server/server/schema.js +90 -0
- package/dist/server/server/services/batch-orchestrator.js +253 -0
- package/dist/server/server/services/claude-session-service.js +352 -0
- package/dist/server/server/services/config-service.js +132 -0
- package/dist/server/server/services/deploy-service.js +51 -0
- package/dist/server/server/services/event-service.js +63 -0
- package/dist/server/server/services/gate-service.js +83 -0
- package/dist/server/server/services/git-service.js +309 -0
- package/dist/server/server/services/github-service.js +145 -0
- package/dist/server/server/services/readiness-service.js +184 -0
- package/dist/server/server/services/scope-cache.js +72 -0
- package/dist/server/server/services/scope-service.js +424 -0
- package/dist/server/server/services/sprint-orchestrator.js +312 -0
- package/dist/server/server/services/sprint-service.js +293 -0
- package/dist/server/server/services/workflow-service.js +397 -0
- package/dist/server/server/utils/cc-hooks-parser.js +49 -0
- package/dist/server/server/utils/dispatch-utils.js +305 -0
- package/dist/server/server/utils/logger.js +86 -0
- package/dist/server/server/utils/terminal-launcher.js +388 -0
- package/dist/server/server/utils/worktree-manager.js +98 -0
- package/dist/server/server/watchers/event-watcher.js +81 -0
- package/dist/server/server/watchers/scope-watcher.js +33 -0
- package/dist/server/shared/api-types.js +5 -0
- package/dist/server/shared/default-workflow.json +616 -0
- package/dist/server/shared/workflow-config.js +44 -0
- package/dist/server/shared/workflow-engine.js +353 -0
- package/index.html +15 -0
- package/package.json +110 -0
- package/postcss.config.js +6 -0
- package/schemas/orbital.config.schema.json +83 -0
- package/scripts/postinstall.js +24 -0
- package/scripts/start.sh +20 -0
- package/server/adapters/index.ts +41 -0
- package/server/adapters/iterm2-adapter.ts +37 -0
- package/server/adapters/subprocess-adapter.ts +25 -0
- package/server/adapters/terminal-adapter.ts +24 -0
- package/server/config.ts +234 -0
- package/server/database.ts +107 -0
- package/server/index.ts +452 -0
- package/server/init.ts +891 -0
- package/server/parsers/event-parser.ts +74 -0
- package/server/parsers/scope-parser.ts +240 -0
- package/server/routes/config-routes.ts +182 -0
- package/server/routes/data-routes.ts +548 -0
- package/server/routes/dispatch-routes.ts +275 -0
- package/server/routes/git-routes.ts +112 -0
- package/server/routes/scope-routes.ts +262 -0
- package/server/routes/sprint-routes.ts +142 -0
- package/server/routes/version-routes.ts +156 -0
- package/server/routes/workflow-routes.ts +198 -0
- package/server/schema.ts +90 -0
- package/server/services/batch-orchestrator.ts +286 -0
- package/server/services/claude-session-service.ts +441 -0
- package/server/services/config-service.ts +151 -0
- package/server/services/deploy-service.ts +98 -0
- package/server/services/event-service.ts +98 -0
- package/server/services/gate-service.ts +126 -0
- package/server/services/git-service.ts +391 -0
- package/server/services/github-service.ts +183 -0
- package/server/services/readiness-service.ts +250 -0
- package/server/services/scope-cache.ts +81 -0
- package/server/services/scope-service.ts +476 -0
- package/server/services/sprint-orchestrator.ts +361 -0
- package/server/services/sprint-service.ts +415 -0
- package/server/services/workflow-service.ts +461 -0
- package/server/utils/cc-hooks-parser.ts +70 -0
- package/server/utils/dispatch-utils.ts +395 -0
- package/server/utils/logger.ts +109 -0
- package/server/utils/terminal-launcher.ts +462 -0
- package/server/utils/worktree-manager.ts +104 -0
- package/server/watchers/event-watcher.ts +100 -0
- package/server/watchers/scope-watcher.ts +38 -0
- package/shared/api-types.ts +20 -0
- package/shared/default-workflow.json +616 -0
- package/shared/workflow-config.ts +170 -0
- package/shared/workflow-engine.ts +427 -0
- package/src/App.tsx +33 -0
- package/src/components/AgentBadge.tsx +40 -0
- package/src/components/BatchPreflightModal.tsx +115 -0
- package/src/components/CardDisplayToggle.tsx +74 -0
- package/src/components/ColumnHeaderActions.tsx +55 -0
- package/src/components/ColumnMenu.tsx +99 -0
- package/src/components/DeployHistory.tsx +141 -0
- package/src/components/DispatchModal.tsx +164 -0
- package/src/components/DispatchPopover.tsx +139 -0
- package/src/components/DragOverlay.tsx +25 -0
- package/src/components/DriftSidebar.tsx +140 -0
- package/src/components/EnvironmentStrip.tsx +88 -0
- package/src/components/ErrorBoundary.tsx +62 -0
- package/src/components/FilterChip.tsx +105 -0
- package/src/components/GateIndicator.tsx +33 -0
- package/src/components/IdeaDetailModal.tsx +190 -0
- package/src/components/IdeaFormDialog.tsx +113 -0
- package/src/components/KanbanColumn.tsx +201 -0
- package/src/components/MarkdownRenderer.tsx +114 -0
- package/src/components/NeonGrid.tsx +128 -0
- package/src/components/PromotionQueue.tsx +89 -0
- package/src/components/ScopeCard.tsx +234 -0
- package/src/components/ScopeDetailModal.tsx +255 -0
- package/src/components/ScopeFilterBar.tsx +152 -0
- package/src/components/SearchInput.tsx +102 -0
- package/src/components/SessionPanel.tsx +335 -0
- package/src/components/SprintContainer.tsx +303 -0
- package/src/components/SprintDependencyDialog.tsx +78 -0
- package/src/components/SprintPreflightModal.tsx +138 -0
- package/src/components/StatusBar.tsx +168 -0
- package/src/components/SwimCell.tsx +67 -0
- package/src/components/SwimLaneRow.tsx +94 -0
- package/src/components/SwimlaneBoardView.tsx +108 -0
- package/src/components/VersionBadge.tsx +139 -0
- package/src/components/ViewModeSelector.tsx +114 -0
- package/src/components/config/AgentChip.tsx +53 -0
- package/src/components/config/AgentCreateDialog.tsx +321 -0
- package/src/components/config/AgentEditor.tsx +175 -0
- package/src/components/config/DirectoryTree.tsx +582 -0
- package/src/components/config/FileEditor.tsx +550 -0
- package/src/components/config/HookChip.tsx +50 -0
- package/src/components/config/StageCard.tsx +198 -0
- package/src/components/config/TransitionZone.tsx +173 -0
- package/src/components/config/UnifiedWorkflowPipeline.tsx +216 -0
- package/src/components/config/WorkflowPipeline.tsx +161 -0
- package/src/components/source-control/BranchList.tsx +93 -0
- package/src/components/source-control/BranchPanel.tsx +105 -0
- package/src/components/source-control/CommitLog.tsx +100 -0
- package/src/components/source-control/CommitRow.tsx +47 -0
- package/src/components/source-control/GitHubPanel.tsx +110 -0
- package/src/components/source-control/GitHubSetupGuide.tsx +52 -0
- package/src/components/source-control/GitOverviewBar.tsx +101 -0
- package/src/components/source-control/PullRequestList.tsx +69 -0
- package/src/components/source-control/WorktreeList.tsx +80 -0
- package/src/components/ui/badge.tsx +41 -0
- package/src/components/ui/button.tsx +55 -0
- package/src/components/ui/card.tsx +78 -0
- package/src/components/ui/dialog.tsx +94 -0
- package/src/components/ui/popover.tsx +33 -0
- package/src/components/ui/scroll-area.tsx +54 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/tabs.tsx +52 -0
- package/src/components/ui/toggle-switch.tsx +35 -0
- package/src/components/ui/tooltip.tsx +27 -0
- package/src/components/workflow/AddEdgeDialog.tsx +217 -0
- package/src/components/workflow/AddListDialog.tsx +201 -0
- package/src/components/workflow/ChecklistEditor.tsx +239 -0
- package/src/components/workflow/CommandPrefixManager.tsx +118 -0
- package/src/components/workflow/ConfigSettingsPanel.tsx +189 -0
- package/src/components/workflow/DirectionSelector.tsx +133 -0
- package/src/components/workflow/DispatchConfigPanel.tsx +180 -0
- package/src/components/workflow/EdgeDetailPanel.tsx +236 -0
- package/src/components/workflow/EdgePropertyEditor.tsx +251 -0
- package/src/components/workflow/EditToolbar.tsx +138 -0
- package/src/components/workflow/HookDetailPanel.tsx +250 -0
- package/src/components/workflow/HookExecutionLog.tsx +24 -0
- package/src/components/workflow/HookSourceModal.tsx +129 -0
- package/src/components/workflow/HooksDashboard.tsx +363 -0
- package/src/components/workflow/ListPropertyEditor.tsx +251 -0
- package/src/components/workflow/MigrationPreviewDialog.tsx +237 -0
- package/src/components/workflow/MovementRulesPanel.tsx +188 -0
- package/src/components/workflow/NodeDetailPanel.tsx +245 -0
- package/src/components/workflow/PresetSelector.tsx +414 -0
- package/src/components/workflow/SkillCommandBuilder.tsx +174 -0
- package/src/components/workflow/WorkflowEdgeComponent.tsx +145 -0
- package/src/components/workflow/WorkflowNode.tsx +147 -0
- package/src/components/workflow/graphLayout.ts +186 -0
- package/src/components/workflow/mergeHooks.ts +85 -0
- package/src/components/workflow/useEditHistory.ts +88 -0
- package/src/components/workflow/useWorkflowEditor.ts +262 -0
- package/src/components/workflow/validateConfig.ts +70 -0
- package/src/hooks/useActiveDispatches.ts +198 -0
- package/src/hooks/useBoardSettings.ts +170 -0
- package/src/hooks/useCardDisplay.ts +57 -0
- package/src/hooks/useCcHooks.ts +24 -0
- package/src/hooks/useConfigTree.ts +51 -0
- package/src/hooks/useEnforcementRules.ts +46 -0
- package/src/hooks/useEvents.ts +59 -0
- package/src/hooks/useFileEditor.ts +165 -0
- package/src/hooks/useGates.ts +57 -0
- package/src/hooks/useIdeaActions.ts +53 -0
- package/src/hooks/useKanbanDnd.ts +410 -0
- package/src/hooks/useOrbitalConfig.ts +54 -0
- package/src/hooks/usePipeline.ts +47 -0
- package/src/hooks/usePipelineData.ts +338 -0
- package/src/hooks/useReconnect.ts +25 -0
- package/src/hooks/useScopeFilters.ts +125 -0
- package/src/hooks/useScopeSessions.ts +44 -0
- package/src/hooks/useScopes.ts +67 -0
- package/src/hooks/useSearch.ts +67 -0
- package/src/hooks/useSettings.tsx +187 -0
- package/src/hooks/useSocket.ts +25 -0
- package/src/hooks/useSourceControl.ts +105 -0
- package/src/hooks/useSprintPreflight.ts +55 -0
- package/src/hooks/useSprints.ts +154 -0
- package/src/hooks/useStatusBarHighlight.ts +18 -0
- package/src/hooks/useSwimlaneBoardSettings.ts +104 -0
- package/src/hooks/useTheme.ts +9 -0
- package/src/hooks/useTransitionReadiness.ts +53 -0
- package/src/hooks/useVersion.ts +155 -0
- package/src/hooks/useViolations.ts +65 -0
- package/src/hooks/useWorkflow.tsx +125 -0
- package/src/hooks/useZoomModifier.ts +19 -0
- package/src/index.css +797 -0
- package/src/layouts/DashboardLayout.tsx +113 -0
- package/src/lib/collisionDetection.ts +20 -0
- package/src/lib/scope-fields.ts +61 -0
- package/src/lib/swimlane.ts +146 -0
- package/src/lib/utils.ts +15 -0
- package/src/main.tsx +19 -0
- package/src/socket.ts +11 -0
- package/src/types/index.ts +497 -0
- package/src/views/AgentFeed.tsx +339 -0
- package/src/views/DeployPipeline.tsx +59 -0
- package/src/views/EnforcementView.tsx +378 -0
- package/src/views/PrimitivesConfig.tsx +500 -0
- package/src/views/QualityGates.tsx +1012 -0
- package/src/views/ScopeBoard.tsx +454 -0
- package/src/views/SessionTimeline.tsx +516 -0
- package/src/views/Settings.tsx +183 -0
- package/src/views/SourceControl.tsx +95 -0
- package/src/views/WorkflowVisualizer.tsx +382 -0
- package/tailwind.config.js +161 -0
- package/templates/agents/AUTO-INVOKE.md +180 -0
- package/templates/agents/CONFLICT-RESOLUTION.md +128 -0
- package/templates/agents/QUICK-REFERENCE.md +122 -0
- package/templates/agents/README.md +188 -0
- package/templates/agents/SKILL-TRIGGERS.md +100 -0
- package/templates/agents/blue-team/frontend-designer.md +424 -0
- package/templates/agents/green-team/architect.md +526 -0
- package/templates/agents/green-team/rules-enforcer.md +131 -0
- package/templates/agents/red-team/attacker-learned.md +24 -0
- package/templates/agents/red-team/attacker.md +486 -0
- package/templates/agents/red-team/chaos.md +548 -0
- package/templates/agents/reference/component-registry.md +82 -0
- package/templates/agents/workflows/full-mode.md +218 -0
- package/templates/agents/workflows/quick-mode.md +118 -0
- package/templates/agents/workflows/security-mode.md +283 -0
- package/templates/anti-patterns/dangerous-shortcuts.md +427 -0
- package/templates/config/agent-triggers.json +92 -0
- package/templates/hooks/agent-team-gate.sh +31 -0
- package/templates/hooks/agent-trigger.sh +97 -0
- package/templates/hooks/block-push.sh +66 -0
- package/templates/hooks/block-workarounds.sh +61 -0
- package/templates/hooks/blocker-check.sh +28 -0
- package/templates/hooks/completion-checklist.sh +28 -0
- package/templates/hooks/decision-capture.sh +15 -0
- package/templates/hooks/dependency-check.sh +27 -0
- package/templates/hooks/end-session.sh +31 -0
- package/templates/hooks/exploration-logger.sh +37 -0
- package/templates/hooks/files-changed-summary.sh +37 -0
- package/templates/hooks/get-session-id.sh +49 -0
- package/templates/hooks/git-commit-guard.sh +34 -0
- package/templates/hooks/init-session.sh +93 -0
- package/templates/hooks/orbital-emit.sh +79 -0
- package/templates/hooks/orbital-report-deploy.sh +78 -0
- package/templates/hooks/orbital-report-gates.sh +40 -0
- package/templates/hooks/orbital-report-violation.sh +36 -0
- package/templates/hooks/orbital-scope-update.sh +53 -0
- package/templates/hooks/phase-verify-reminder.sh +26 -0
- package/templates/hooks/review-gate-check.sh +82 -0
- package/templates/hooks/scope-commit-logger.sh +37 -0
- package/templates/hooks/scope-create-cleanup.sh +36 -0
- package/templates/hooks/scope-create-gate.sh +80 -0
- package/templates/hooks/scope-create-tracker.sh +17 -0
- package/templates/hooks/scope-file-sync.sh +53 -0
- package/templates/hooks/scope-gate.sh +35 -0
- package/templates/hooks/scope-helpers.sh +188 -0
- package/templates/hooks/scope-lifecycle-gate.sh +139 -0
- package/templates/hooks/scope-prepare.sh +244 -0
- package/templates/hooks/scope-transition.sh +172 -0
- package/templates/hooks/session-enforcer.sh +143 -0
- package/templates/hooks/time-tracker.sh +33 -0
- package/templates/lessons-learned.md +15 -0
- package/templates/orbital.config.json +35 -0
- package/templates/presets/development.json +42 -0
- package/templates/presets/gitflow.json +712 -0
- package/templates/presets/minimal.json +23 -0
- package/templates/quick/rules.md +218 -0
- package/templates/scopes/_template.md +255 -0
- package/templates/settings-hooks.json +98 -0
- package/templates/skills/git-commit/SKILL.md +85 -0
- package/templates/skills/git-dev/SKILL.md +99 -0
- package/templates/skills/git-hotfix/SKILL.md +223 -0
- package/templates/skills/git-main/SKILL.md +84 -0
- package/templates/skills/git-production/SKILL.md +165 -0
- package/templates/skills/git-staging/SKILL.md +112 -0
- package/templates/skills/scope-create/SKILL.md +81 -0
- package/templates/skills/scope-fix-review/SKILL.md +168 -0
- package/templates/skills/scope-implement/SKILL.md +110 -0
- package/templates/skills/scope-post-review/SKILL.md +144 -0
- package/templates/skills/scope-pre-review/SKILL.md +211 -0
- package/templates/skills/scope-verify/SKILL.md +201 -0
- package/templates/skills/session-init/SKILL.md +62 -0
- package/templates/skills/session-resume/SKILL.md +201 -0
- package/templates/skills/test-checks/SKILL.md +171 -0
- package/templates/skills/test-code-review/SKILL.md +252 -0
- package/tsconfig.json +25 -0
- package/vite.config.ts +38 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { ArrowRight, AlertTriangle, Terminal, ExternalLink } from 'lucide-react';
|
|
3
|
+
import {
|
|
4
|
+
Dialog,
|
|
5
|
+
DialogContent,
|
|
6
|
+
} from '@/components/ui/dialog';
|
|
7
|
+
import { Button } from '@/components/ui/button';
|
|
8
|
+
import { Badge } from '@/components/ui/badge';
|
|
9
|
+
import { cn, formatScopeId } from '@/lib/utils';
|
|
10
|
+
import type { WorkflowEdge } from '../../shared/workflow-config';
|
|
11
|
+
import type { Scope } from '@/types';
|
|
12
|
+
|
|
13
|
+
interface DispatchPopoverProps {
|
|
14
|
+
open: boolean;
|
|
15
|
+
scope: Scope | null;
|
|
16
|
+
transition: WorkflowEdge | null;
|
|
17
|
+
hasActiveSession: boolean;
|
|
18
|
+
onConfirm: () => void;
|
|
19
|
+
onCancel: () => void;
|
|
20
|
+
onViewDetails: () => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function DispatchPopover({
|
|
24
|
+
open,
|
|
25
|
+
scope,
|
|
26
|
+
transition,
|
|
27
|
+
hasActiveSession,
|
|
28
|
+
onConfirm,
|
|
29
|
+
onCancel,
|
|
30
|
+
onViewDetails,
|
|
31
|
+
}: DispatchPopoverProps) {
|
|
32
|
+
const launchRef = useRef<HTMLButtonElement>(null);
|
|
33
|
+
const [loading, setLoading] = useState(false);
|
|
34
|
+
|
|
35
|
+
// Auto-focus launch button when dialog opens
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (open) {
|
|
38
|
+
setTimeout(() => launchRef.current?.focus(), 100);
|
|
39
|
+
setLoading(false);
|
|
40
|
+
}
|
|
41
|
+
}, [open]);
|
|
42
|
+
|
|
43
|
+
if (!scope || !transition) return null;
|
|
44
|
+
|
|
45
|
+
const command = transition.command?.replace('{id}', String(scope.id)) ?? null;
|
|
46
|
+
const entryPointPromotion = transition.direction === 'forward' && !transition.command && transition.from !== transition.to;
|
|
47
|
+
const isIdeaPromotion = scope.status === transition.from && entryPointPromotion;
|
|
48
|
+
const displayCommand = isIdeaPromotion ? '/scope-create' : command;
|
|
49
|
+
const actionLabel = isIdeaPromotion ? 'Launch' : command ? 'Launch' : 'Move';
|
|
50
|
+
|
|
51
|
+
function handleConfirm() {
|
|
52
|
+
setLoading(true);
|
|
53
|
+
onConfirm();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<Dialog open={open} onOpenChange={(isOpen) => { if (!isOpen) onCancel(); }}>
|
|
58
|
+
<DialogContent className="max-w-xs p-3 gap-0">
|
|
59
|
+
{/* Transition arrow */}
|
|
60
|
+
<div className="mb-2.5 flex items-center gap-2">
|
|
61
|
+
<Badge variant="outline" className="text-xxs capitalize">{transition.from}</Badge>
|
|
62
|
+
<ArrowRight className="h-3 w-3 text-muted-foreground" />
|
|
63
|
+
<Badge variant="default" className="text-xxs capitalize [color:#000]">{transition.to}</Badge>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
{/* Scope preview */}
|
|
67
|
+
<div className="mb-2 text-xs text-muted-foreground">
|
|
68
|
+
{isIdeaPromotion ? (
|
|
69
|
+
<span className="font-light">{scope.title}</span>
|
|
70
|
+
) : (
|
|
71
|
+
<>
|
|
72
|
+
<span className="font-mono">{formatScopeId(scope.id)}</span>
|
|
73
|
+
{' '}
|
|
74
|
+
<span className="font-light">{scope.title}</span>
|
|
75
|
+
</>
|
|
76
|
+
)}
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
{/* Command preview */}
|
|
80
|
+
{displayCommand && (
|
|
81
|
+
<div className="mb-3 flex items-center gap-1.5 rounded bg-black/40 px-2 py-1.5">
|
|
82
|
+
<Terminal className="h-3 w-3 shrink-0 text-primary" />
|
|
83
|
+
<code className="text-xxs font-mono text-primary">{displayCommand}</code>
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
|
|
87
|
+
{/* Idea promotion info */}
|
|
88
|
+
{isIdeaPromotion && (
|
|
89
|
+
<p className="mb-3 text-xxs text-muted-foreground">
|
|
90
|
+
Creates a scope document from this idea
|
|
91
|
+
</p>
|
|
92
|
+
)}
|
|
93
|
+
|
|
94
|
+
{/* Active session warning */}
|
|
95
|
+
{hasActiveSession && (
|
|
96
|
+
<div className={cn(
|
|
97
|
+
'mb-3 flex items-start gap-1.5 rounded border px-2 py-1.5 text-xxs',
|
|
98
|
+
'border-warning-amber/30 bg-warning-amber/10 text-warning-amber'
|
|
99
|
+
)}>
|
|
100
|
+
<AlertTriangle className="mt-0.5 h-3 w-3 shrink-0" />
|
|
101
|
+
<span>A CLI session is already running for this scope.</span>
|
|
102
|
+
</div>
|
|
103
|
+
)}
|
|
104
|
+
|
|
105
|
+
{/* Actions */}
|
|
106
|
+
<div className="flex items-center gap-2">
|
|
107
|
+
<Button
|
|
108
|
+
ref={launchRef}
|
|
109
|
+
size="sm"
|
|
110
|
+
onClick={handleConfirm}
|
|
111
|
+
disabled={loading}
|
|
112
|
+
className="flex-1"
|
|
113
|
+
>
|
|
114
|
+
{loading ? 'Launching...' : actionLabel}
|
|
115
|
+
</Button>
|
|
116
|
+
<Button
|
|
117
|
+
size="sm"
|
|
118
|
+
variant="ghost"
|
|
119
|
+
onClick={onCancel}
|
|
120
|
+
disabled={loading}
|
|
121
|
+
>
|
|
122
|
+
Cancel
|
|
123
|
+
</Button>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
{/* View details link */}
|
|
127
|
+
{(command || isIdeaPromotion) && (
|
|
128
|
+
<button
|
|
129
|
+
onClick={onViewDetails}
|
|
130
|
+
className="mt-2 flex items-center gap-1 text-xxs text-muted-foreground hover:text-foreground transition-colors"
|
|
131
|
+
>
|
|
132
|
+
<ExternalLink className="h-2.5 w-2.5" />
|
|
133
|
+
View Details
|
|
134
|
+
</button>
|
|
135
|
+
)}
|
|
136
|
+
</DialogContent>
|
|
137
|
+
</Dialog>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DragOverlay as DndDragOverlay } from '@dnd-kit/core';
|
|
2
|
+
import { ScopeCard } from './ScopeCard';
|
|
3
|
+
import { SprintDragPreview } from './SprintContainer';
|
|
4
|
+
import type { Scope, Sprint, CardDisplayConfig } from '@/types';
|
|
5
|
+
|
|
6
|
+
interface DragOverlayProps {
|
|
7
|
+
activeScope: Scope | null;
|
|
8
|
+
activeSprint?: Sprint | null;
|
|
9
|
+
cardDisplay?: CardDisplayConfig;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function DragOverlay({ activeScope, activeSprint, cardDisplay }: DragOverlayProps) {
|
|
13
|
+
return (
|
|
14
|
+
<DndDragOverlay dropAnimation={null}>
|
|
15
|
+
{activeScope && (
|
|
16
|
+
<div className="w-72 rotate-2 opacity-90 shadow-xl shadow-black/40">
|
|
17
|
+
<ScopeCard scope={activeScope} cardDisplay={cardDisplay} />
|
|
18
|
+
</div>
|
|
19
|
+
)}
|
|
20
|
+
{activeSprint && (
|
|
21
|
+
<SprintDragPreview sprint={activeSprint} />
|
|
22
|
+
)}
|
|
23
|
+
</DndDragOverlay>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { formatDistanceToNow } from 'date-fns';
|
|
2
|
+
import {
|
|
3
|
+
BarChart,
|
|
4
|
+
Bar,
|
|
5
|
+
XAxis,
|
|
6
|
+
YAxis,
|
|
7
|
+
Tooltip as RechartsTooltip,
|
|
8
|
+
ResponsiveContainer,
|
|
9
|
+
Legend,
|
|
10
|
+
} from 'recharts';
|
|
11
|
+
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
|
12
|
+
import { cn } from '@/lib/utils';
|
|
13
|
+
import type { PipelineDrift, DeployFrequencyWeek, Deployment } from '@/types';
|
|
14
|
+
|
|
15
|
+
interface Props {
|
|
16
|
+
drift: PipelineDrift;
|
|
17
|
+
frequency: DeployFrequencyWeek[];
|
|
18
|
+
deployments: Deployment[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function driftColor(count: number): string {
|
|
22
|
+
if (count === 0) return 'text-bid-green';
|
|
23
|
+
if (count <= 5) return 'text-accent-blue';
|
|
24
|
+
if (count <= 20) return 'text-warning-amber';
|
|
25
|
+
return 'text-ask-red';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function timeBehind(oldestDate: string | null): string {
|
|
29
|
+
if (!oldestDate) return 'synced';
|
|
30
|
+
return formatDistanceToNow(new Date(oldestDate)) + ' behind';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function DriftSidebar({ drift, frequency, deployments }: Props) {
|
|
34
|
+
const latestStaging = deployments.find((d) => d.environment === 'staging');
|
|
35
|
+
const latestProd = deployments.find((d) => d.environment === 'production');
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div className="space-y-6">
|
|
39
|
+
{/* Branch Drift Summary */}
|
|
40
|
+
<Card>
|
|
41
|
+
<CardHeader>
|
|
42
|
+
<CardTitle className="text-base">Branch Drift</CardTitle>
|
|
43
|
+
</CardHeader>
|
|
44
|
+
<CardContent className="space-y-3">
|
|
45
|
+
<DriftRow
|
|
46
|
+
label="dev → staging"
|
|
47
|
+
count={drift.devToStaging.count}
|
|
48
|
+
oldestDate={drift.devToStaging.oldestDate}
|
|
49
|
+
/>
|
|
50
|
+
<DriftRow
|
|
51
|
+
label="staging → main"
|
|
52
|
+
count={drift.stagingToMain.count}
|
|
53
|
+
oldestDate={drift.stagingToMain.oldestDate}
|
|
54
|
+
/>
|
|
55
|
+
|
|
56
|
+
<div className="mt-4 border-t border-border pt-3 space-y-2">
|
|
57
|
+
<div className="flex items-center justify-between text-xs">
|
|
58
|
+
<span className="text-muted-foreground">Last staging deploy</span>
|
|
59
|
+
<span className="text-foreground">
|
|
60
|
+
{latestStaging?.started_at
|
|
61
|
+
? formatDistanceToNow(new Date(latestStaging.started_at), { addSuffix: true })
|
|
62
|
+
: '—'}
|
|
63
|
+
</span>
|
|
64
|
+
</div>
|
|
65
|
+
<div className="flex items-center justify-between text-xs">
|
|
66
|
+
<span className="text-muted-foreground">Last production deploy</span>
|
|
67
|
+
<span className="text-foreground">
|
|
68
|
+
{latestProd?.started_at
|
|
69
|
+
? formatDistanceToNow(new Date(latestProd.started_at), { addSuffix: true })
|
|
70
|
+
: '—'}
|
|
71
|
+
</span>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</CardContent>
|
|
75
|
+
</Card>
|
|
76
|
+
|
|
77
|
+
{/* Deploy Frequency Chart */}
|
|
78
|
+
{frequency.length > 0 && (
|
|
79
|
+
<Card>
|
|
80
|
+
<CardHeader>
|
|
81
|
+
<CardTitle className="text-base">Deploy Frequency</CardTitle>
|
|
82
|
+
</CardHeader>
|
|
83
|
+
<CardContent>
|
|
84
|
+
<ResponsiveContainer width="100%" height={200}>
|
|
85
|
+
<BarChart
|
|
86
|
+
data={frequency}
|
|
87
|
+
margin={{ left: 0, right: 10, top: 0, bottom: 0 }}
|
|
88
|
+
>
|
|
89
|
+
<XAxis
|
|
90
|
+
dataKey="week"
|
|
91
|
+
tick={{ fontSize: 10, fill: 'hsl(var(--muted-foreground))' }}
|
|
92
|
+
tickFormatter={(w: string) => w.replace(/^\d{4}-/, '')}
|
|
93
|
+
/>
|
|
94
|
+
<YAxis
|
|
95
|
+
allowDecimals={false}
|
|
96
|
+
tick={{ fontSize: 10, fill: 'hsl(var(--muted-foreground))' }}
|
|
97
|
+
width={24}
|
|
98
|
+
/>
|
|
99
|
+
<RechartsTooltip
|
|
100
|
+
contentStyle={{
|
|
101
|
+
background: 'hsl(var(--card))',
|
|
102
|
+
border: '1px solid hsl(var(--border))',
|
|
103
|
+
borderRadius: '6px',
|
|
104
|
+
fontSize: '12px',
|
|
105
|
+
}}
|
|
106
|
+
/>
|
|
107
|
+
<Legend
|
|
108
|
+
iconSize={8}
|
|
109
|
+
wrapperStyle={{ fontSize: '10px' }}
|
|
110
|
+
/>
|
|
111
|
+
<Bar dataKey="staging" stackId="a" fill="#EC4899" radius={[0, 0, 0, 0]} />
|
|
112
|
+
<Bar dataKey="production" stackId="a" fill="#00c853" radius={[4, 4, 0, 0]} />
|
|
113
|
+
</BarChart>
|
|
114
|
+
</ResponsiveContainer>
|
|
115
|
+
</CardContent>
|
|
116
|
+
</Card>
|
|
117
|
+
)}
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function DriftRow({ label, count, oldestDate }: {
|
|
123
|
+
label: string;
|
|
124
|
+
count: number;
|
|
125
|
+
oldestDate: string | null;
|
|
126
|
+
}) {
|
|
127
|
+
return (
|
|
128
|
+
<div className="flex items-center justify-between">
|
|
129
|
+
<span className="text-xs text-muted-foreground">{label}</span>
|
|
130
|
+
<div className="flex items-center gap-2">
|
|
131
|
+
<span className={cn('font-mono text-xs font-medium', driftColor(count))}>
|
|
132
|
+
{count} commits
|
|
133
|
+
</span>
|
|
134
|
+
<span className="text-[10px] text-muted-foreground/60">
|
|
135
|
+
{timeBehind(oldestDate)}
|
|
136
|
+
</span>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { formatDistanceToNow } from 'date-fns';
|
|
2
|
+
import { ArrowRight } from 'lucide-react';
|
|
3
|
+
import { Card, CardContent } from '@/components/ui/card';
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
import type { PipelineDrift } from '@/types';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
drift: PipelineDrift;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function driftColor(count: number): string {
|
|
12
|
+
if (count === 0) return 'text-bid-green';
|
|
13
|
+
if (count <= 5) return 'text-accent-blue';
|
|
14
|
+
if (count <= 20) return 'text-warning-amber';
|
|
15
|
+
return 'text-ask-red';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function driftGlow(count: number): string {
|
|
19
|
+
if (count === 0) return 'glow-green-sm';
|
|
20
|
+
if (count <= 5) return '';
|
|
21
|
+
if (count <= 20) return 'glow-amber';
|
|
22
|
+
return 'glow-red-sm';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function driftLabel(count: number): string {
|
|
26
|
+
if (count === 0) return 'synced';
|
|
27
|
+
return `${count} ahead`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function EnvCard({ name, sha, date }: { name: string; sha: string; date: string }) {
|
|
31
|
+
return (
|
|
32
|
+
<div className="flex flex-col items-center gap-1 rounded border border-border bg-surface p-3 min-w-[130px]">
|
|
33
|
+
<span className="text-xs font-medium uppercase tracking-wider text-foreground">
|
|
34
|
+
{name}
|
|
35
|
+
</span>
|
|
36
|
+
<code className="font-mono text-xxs text-muted-foreground">
|
|
37
|
+
{sha ? sha.slice(0, 7) : '—'}
|
|
38
|
+
</code>
|
|
39
|
+
{date && (
|
|
40
|
+
<span className="text-[10px] text-muted-foreground/60">
|
|
41
|
+
{formatDistanceToNow(new Date(date), { addSuffix: true })}
|
|
42
|
+
</span>
|
|
43
|
+
)}
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function DriftArrow({ count }: { count: number }) {
|
|
49
|
+
const color = driftColor(count);
|
|
50
|
+
const glow = driftGlow(count);
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div className={cn('flex flex-col items-center gap-0.5', glow)}>
|
|
54
|
+
<span className={cn('text-[10px] font-medium', color)}>
|
|
55
|
+
{driftLabel(count)}
|
|
56
|
+
</span>
|
|
57
|
+
<ArrowRight className={cn('h-4 w-4', color)} />
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function EnvironmentStrip({ drift }: Props) {
|
|
63
|
+
return (
|
|
64
|
+
<Card>
|
|
65
|
+
<CardContent className="py-4">
|
|
66
|
+
<div className="grid grid-cols-[1fr_auto_1fr_auto_1fr] items-center gap-3">
|
|
67
|
+
<EnvCard
|
|
68
|
+
name="dev"
|
|
69
|
+
sha={drift.heads.dev.sha}
|
|
70
|
+
date={drift.heads.dev.date}
|
|
71
|
+
/>
|
|
72
|
+
<DriftArrow count={drift.devToStaging.count} />
|
|
73
|
+
<EnvCard
|
|
74
|
+
name="staging"
|
|
75
|
+
sha={drift.heads.staging.sha}
|
|
76
|
+
date={drift.heads.staging.date}
|
|
77
|
+
/>
|
|
78
|
+
<DriftArrow count={drift.stagingToMain.count} />
|
|
79
|
+
<EnvCard
|
|
80
|
+
name="main"
|
|
81
|
+
sha={drift.heads.main.sha}
|
|
82
|
+
date={drift.heads.main.date}
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
</CardContent>
|
|
86
|
+
</Card>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Component, type ErrorInfo, type ReactNode } from 'react';
|
|
2
|
+
import { AlertTriangle, RotateCcw } from 'lucide-react';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface State {
|
|
9
|
+
hasError: boolean;
|
|
10
|
+
error: Error | null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Catches unhandled render errors and shows a recoverable fallback UI
|
|
15
|
+
* instead of a blank white screen.
|
|
16
|
+
*
|
|
17
|
+
* Usage: wrap at two levels —
|
|
18
|
+
* 1. Around <App /> in main.tsx (last-resort catch)
|
|
19
|
+
* 2. Around <Outlet /> in DashboardLayout (view-level isolation)
|
|
20
|
+
*/
|
|
21
|
+
export class ErrorBoundary extends Component<Props, State> {
|
|
22
|
+
state: State = { hasError: false, error: null };
|
|
23
|
+
|
|
24
|
+
static getDerivedStateFromError(error: Error): State {
|
|
25
|
+
return { hasError: true, error };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
componentDidCatch(error: Error, info: ErrorInfo) {
|
|
29
|
+
console.error('[ErrorBoundary]', error, info.componentStack);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private handleReload = () => {
|
|
33
|
+
this.setState({ hasError: false, error: null });
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
render() {
|
|
37
|
+
if (!this.state.hasError) return this.props.children;
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div className="flex h-full items-center justify-center p-8">
|
|
41
|
+
<div className="flex max-w-md flex-col items-center gap-4 text-center">
|
|
42
|
+
<div className="flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10">
|
|
43
|
+
<AlertTriangle className="h-6 w-6 text-destructive" />
|
|
44
|
+
</div>
|
|
45
|
+
<h2 className="text-sm font-medium text-foreground">
|
|
46
|
+
Something went wrong
|
|
47
|
+
</h2>
|
|
48
|
+
<p className="text-xs text-muted-foreground">
|
|
49
|
+
{this.state.error?.message ?? 'An unexpected error occurred.'}
|
|
50
|
+
</p>
|
|
51
|
+
<button
|
|
52
|
+
onClick={this.handleReload}
|
|
53
|
+
className="flex items-center gap-1.5 rounded bg-surface-light px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-border"
|
|
54
|
+
>
|
|
55
|
+
<RotateCcw className="h-3.5 w-3.5" />
|
|
56
|
+
Retry
|
|
57
|
+
</button>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ChevronDown } from 'lucide-react';
|
|
2
|
+
import { Popover, PopoverTrigger, PopoverContent } from '@/components/ui/popover';
|
|
3
|
+
import { Button } from '@/components/ui/button';
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
import { useTheme } from '@/hooks/useTheme';
|
|
6
|
+
import type { FilterField } from '@/types';
|
|
7
|
+
import type { FilterOption } from '@/hooks/useScopeFilters';
|
|
8
|
+
|
|
9
|
+
interface FilterChipProps {
|
|
10
|
+
field: FilterField;
|
|
11
|
+
label: string;
|
|
12
|
+
options: FilterOption[];
|
|
13
|
+
selected: Set<string>;
|
|
14
|
+
onToggle: (field: FilterField, value: string) => void;
|
|
15
|
+
glowClass?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const FIELD_COLORS: Record<string, string> = {
|
|
19
|
+
priority: 'text-warning-amber',
|
|
20
|
+
category: 'text-accent-blue',
|
|
21
|
+
tags: 'text-info-cyan',
|
|
22
|
+
effort: 'text-muted-foreground',
|
|
23
|
+
dependencies: 'text-ask-red',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export function FilterChip({
|
|
27
|
+
field,
|
|
28
|
+
label,
|
|
29
|
+
options,
|
|
30
|
+
selected,
|
|
31
|
+
onToggle,
|
|
32
|
+
glowClass,
|
|
33
|
+
}: FilterChipProps) {
|
|
34
|
+
const { neonGlass } = useTheme();
|
|
35
|
+
const isActive = selected.size > 0;
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Popover>
|
|
39
|
+
<PopoverTrigger asChild>
|
|
40
|
+
<Button
|
|
41
|
+
variant="outline"
|
|
42
|
+
size="sm"
|
|
43
|
+
className={cn(
|
|
44
|
+
'gap-1.5 capitalize backdrop-blur-sm bg-white/[0.03] border-white/10',
|
|
45
|
+
isActive && 'border-white/20 text-foreground',
|
|
46
|
+
isActive && neonGlass && glowClass
|
|
47
|
+
)}
|
|
48
|
+
>
|
|
49
|
+
{label}
|
|
50
|
+
{isActive && (
|
|
51
|
+
<span className="ml-0.5 rounded-full bg-white/10 px-1.5 text-[10px]">
|
|
52
|
+
{selected.size}
|
|
53
|
+
</span>
|
|
54
|
+
)}
|
|
55
|
+
<ChevronDown className="h-3 w-3 opacity-50" />
|
|
56
|
+
</Button>
|
|
57
|
+
</PopoverTrigger>
|
|
58
|
+
|
|
59
|
+
<PopoverContent className="filter-popover-glass !bg-transparent">
|
|
60
|
+
<div className="space-y-0.5">
|
|
61
|
+
{options.map((opt) => {
|
|
62
|
+
const checked = selected.has(opt.value);
|
|
63
|
+
return (
|
|
64
|
+
<button
|
|
65
|
+
key={opt.value}
|
|
66
|
+
onClick={() => onToggle(field, opt.value)}
|
|
67
|
+
className={cn(
|
|
68
|
+
'flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors',
|
|
69
|
+
'hover:bg-white/[0.06]',
|
|
70
|
+
checked && 'bg-white/[0.06]'
|
|
71
|
+
)}
|
|
72
|
+
>
|
|
73
|
+
{/* Checkbox indicator */}
|
|
74
|
+
<span
|
|
75
|
+
className={cn(
|
|
76
|
+
'flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border',
|
|
77
|
+
checked
|
|
78
|
+
? cn('border-primary bg-primary text-primary-foreground', FIELD_COLORS[field])
|
|
79
|
+
: 'border-white/15'
|
|
80
|
+
)}
|
|
81
|
+
>
|
|
82
|
+
{checked && (
|
|
83
|
+
<svg className="h-2.5 w-2.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={3}>
|
|
84
|
+
<path strokeLinecap="round" strokeLinejoin="round" d="M5 13l4 4L19 7" />
|
|
85
|
+
</svg>
|
|
86
|
+
)}
|
|
87
|
+
</span>
|
|
88
|
+
|
|
89
|
+
{/* Label */}
|
|
90
|
+
<span className={cn('capitalize', checked && 'text-foreground')}>
|
|
91
|
+
{opt.label}
|
|
92
|
+
</span>
|
|
93
|
+
|
|
94
|
+
{/* Count */}
|
|
95
|
+
<span className="ml-auto text-[10px] text-muted-foreground">
|
|
96
|
+
{opt.count}
|
|
97
|
+
</span>
|
|
98
|
+
</button>
|
|
99
|
+
);
|
|
100
|
+
})}
|
|
101
|
+
</div>
|
|
102
|
+
</PopoverContent>
|
|
103
|
+
</Popover>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CheckCircle2, XCircle, Loader2, MinusCircle } from 'lucide-react';
|
|
2
|
+
import { cn } from '@/lib/utils';
|
|
3
|
+
import type { GateStatus } from '@/types';
|
|
4
|
+
|
|
5
|
+
interface GateIndicatorProps {
|
|
6
|
+
status: GateStatus;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const STATUS_CONFIG: Record<GateStatus, {
|
|
11
|
+
icon: typeof CheckCircle2;
|
|
12
|
+
color: string;
|
|
13
|
+
label: string;
|
|
14
|
+
animate?: string;
|
|
15
|
+
glow: string;
|
|
16
|
+
}> = {
|
|
17
|
+
pass: { icon: CheckCircle2, color: 'text-bid-green', label: 'Pass', glow: 'gate-glow-pass glow-green' },
|
|
18
|
+
fail: { icon: XCircle, color: 'text-ask-red', label: 'Fail', glow: 'gate-glow-fail glow-red' },
|
|
19
|
+
running: { icon: Loader2, color: 'text-accent-blue', label: 'Running', animate: 'animate-spin', glow: 'glow-blue' },
|
|
20
|
+
skipped: { icon: MinusCircle, color: 'text-muted-foreground', label: 'Skipped', glow: '' },
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export function GateIndicator({ status, className }: GateIndicatorProps) {
|
|
24
|
+
const config = STATUS_CONFIG[status];
|
|
25
|
+
const Icon = config.icon;
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div className={cn('flex items-center gap-1.5', className)}>
|
|
29
|
+
<Icon className={cn('h-4 w-4', config.color, config.animate, config.glow)} />
|
|
30
|
+
<span className={cn('text-xs', config.color)}>{config.label}</span>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|