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,255 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
2
|
+
import { ExternalLink, X as XIcon, Plus } from 'lucide-react';
|
|
3
|
+
import {
|
|
4
|
+
Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription,
|
|
5
|
+
} from '@/components/ui/dialog';
|
|
6
|
+
import { Badge } from '@/components/ui/badge';
|
|
7
|
+
import { Button } from '@/components/ui/button';
|
|
8
|
+
import { ScrollArea } from '@/components/ui/scroll-area';
|
|
9
|
+
import { Separator } from '@/components/ui/separator';
|
|
10
|
+
import { MarkdownRenderer } from '@/components/MarkdownRenderer';
|
|
11
|
+
import { SessionPanel } from '@/components/SessionPanel';
|
|
12
|
+
import { useScopeSessions } from '@/hooks/useScopeSessions';
|
|
13
|
+
import { useWorkflow } from '@/hooks/useWorkflow';
|
|
14
|
+
import { formatScopeId } from '@/lib/utils';
|
|
15
|
+
import type { Scope } from '@/types';
|
|
16
|
+
import { PRIORITY_OPTIONS, EFFORT_BUCKETS, CATEGORY_OPTIONS } from '@/types';
|
|
17
|
+
|
|
18
|
+
interface ScopeDetailModalProps {
|
|
19
|
+
scope: Scope | null;
|
|
20
|
+
open: boolean;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface EditableFields {
|
|
25
|
+
title: string;
|
|
26
|
+
status: string;
|
|
27
|
+
priority: string;
|
|
28
|
+
effort_estimate: string;
|
|
29
|
+
category: string;
|
|
30
|
+
tags: string[];
|
|
31
|
+
blocked_by: number[];
|
|
32
|
+
blocks: number[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const SELECT_CLS = 'h-6 rounded border border-border bg-muted/30 px-1.5 text-xxs text-foreground focus:outline-none focus:ring-1 focus:ring-primary/50';
|
|
36
|
+
|
|
37
|
+
function fieldsFromScope(scope: Scope): EditableFields {
|
|
38
|
+
return {
|
|
39
|
+
title: scope.title, status: scope.status,
|
|
40
|
+
priority: scope.priority ?? '', effort_estimate: scope.effort_estimate ?? '',
|
|
41
|
+
category: scope.category ?? '', tags: [...scope.tags],
|
|
42
|
+
blocked_by: [...scope.blocked_by], blocks: [...scope.blocks],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function fieldsEqual(a: EditableFields, b: EditableFields): boolean {
|
|
47
|
+
return a.title === b.title && a.status === b.status &&
|
|
48
|
+
a.priority === b.priority && a.effort_estimate === b.effort_estimate &&
|
|
49
|
+
a.category === b.category && JSON.stringify(a.tags) === JSON.stringify(b.tags) &&
|
|
50
|
+
JSON.stringify(a.blocked_by) === JSON.stringify(b.blocked_by) &&
|
|
51
|
+
JSON.stringify(a.blocks) === JSON.stringify(b.blocks);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function DepEditor({ label, ids, onRemove, onAdd }: {
|
|
55
|
+
label: string; ids: number[];
|
|
56
|
+
onRemove: (id: number) => void; onAdd: (val: string) => void;
|
|
57
|
+
}) {
|
|
58
|
+
const [editing, setEditing] = useState(false);
|
|
59
|
+
const [val, setVal] = useState('');
|
|
60
|
+
return (
|
|
61
|
+
<span className="inline-flex items-center gap-1">
|
|
62
|
+
{label}:
|
|
63
|
+
{ids.map((id) => (
|
|
64
|
+
<span key={id} className="group inline-flex items-center gap-0.5 rounded bg-muted px-1 py-0.5">
|
|
65
|
+
{formatScopeId(id)}
|
|
66
|
+
<button onClick={() => onRemove(id)} className="opacity-0 group-hover:opacity-100 transition-opacity">
|
|
67
|
+
<XIcon className="h-2.5 w-2.5" />
|
|
68
|
+
</button>
|
|
69
|
+
</span>
|
|
70
|
+
))}
|
|
71
|
+
{editing ? (
|
|
72
|
+
<input autoFocus className="h-5 w-12 rounded bg-muted/50 px-1 text-xxs border border-primary/30 focus:outline-none"
|
|
73
|
+
placeholder="ID" value={val}
|
|
74
|
+
onChange={(e) => setVal(e.target.value)}
|
|
75
|
+
onKeyDown={(e) => { if (e.key === 'Enter') { onAdd(val); setEditing(false); setVal(''); } if (e.key === 'Escape') setEditing(false); }}
|
|
76
|
+
onBlur={() => setEditing(false)} />
|
|
77
|
+
) : (
|
|
78
|
+
<button onClick={() => setEditing(true)} className="hover:text-foreground transition-colors"><Plus className="h-3 w-3" /></button>
|
|
79
|
+
)}
|
|
80
|
+
</span>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function ScopeDetailModal({ scope, open, onClose }: ScopeDetailModalProps) {
|
|
85
|
+
const { engine } = useWorkflow();
|
|
86
|
+
const { sessions, loading: sessionsLoading } = useScopeSessions(scope?.id ?? null);
|
|
87
|
+
const [fields, setFields] = useState<EditableFields | null>(null);
|
|
88
|
+
const [saved, setSaved] = useState<EditableFields | null>(null);
|
|
89
|
+
const [saving, setSaving] = useState(false);
|
|
90
|
+
const [error, setError] = useState<string | null>(null);
|
|
91
|
+
const [tagInput, setTagInput] = useState('');
|
|
92
|
+
|
|
93
|
+
const isDirty = fields && saved ? !fieldsEqual(fields, saved) : false;
|
|
94
|
+
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
if (scope && open) {
|
|
97
|
+
const f = fieldsFromScope(scope);
|
|
98
|
+
setFields(f); setSaved(f); setError(null); setTagInput('');
|
|
99
|
+
}
|
|
100
|
+
}, [scope?.id, scope?.updated_at, open]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
101
|
+
|
|
102
|
+
const save = useCallback(async () => {
|
|
103
|
+
if (!scope || !fields || !isDirty || saving) return;
|
|
104
|
+
setSaving(true); setError(null);
|
|
105
|
+
try {
|
|
106
|
+
const payload: Record<string, unknown> = {};
|
|
107
|
+
if (saved) {
|
|
108
|
+
if (fields.title !== saved.title) payload.title = fields.title;
|
|
109
|
+
if (fields.status !== saved.status) payload.status = fields.status;
|
|
110
|
+
if (fields.priority !== saved.priority) payload.priority = fields.priority || null;
|
|
111
|
+
if (fields.effort_estimate !== saved.effort_estimate) payload.effort_estimate = fields.effort_estimate || null;
|
|
112
|
+
if (fields.category !== saved.category) payload.category = fields.category || null;
|
|
113
|
+
if (JSON.stringify(fields.tags) !== JSON.stringify(saved.tags)) payload.tags = fields.tags;
|
|
114
|
+
if (JSON.stringify(fields.blocked_by) !== JSON.stringify(saved.blocked_by)) payload.blocked_by = fields.blocked_by;
|
|
115
|
+
if (JSON.stringify(fields.blocks) !== JSON.stringify(saved.blocks)) payload.blocks = fields.blocks;
|
|
116
|
+
}
|
|
117
|
+
const res = await fetch(`/api/orbital/scopes/${scope.id}`, {
|
|
118
|
+
method: 'PATCH', headers: { 'Content-Type': 'application/json' },
|
|
119
|
+
body: JSON.stringify(payload),
|
|
120
|
+
});
|
|
121
|
+
if (!res.ok) {
|
|
122
|
+
const body = await res.json().catch(() => ({ error: 'Save failed' }));
|
|
123
|
+
setError(body.error ?? `HTTP ${res.status}`); return;
|
|
124
|
+
}
|
|
125
|
+
setSaved({ ...fields });
|
|
126
|
+
} catch { setError('Network error — could not save'); }
|
|
127
|
+
finally { setSaving(false); }
|
|
128
|
+
}, [scope, fields, saved, isDirty, saving]);
|
|
129
|
+
|
|
130
|
+
function handleClose() {
|
|
131
|
+
if (isDirty && window.confirm('Save changes before closing?')) { save().then(onClose); return; }
|
|
132
|
+
onClose();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function update(partial: Partial<EditableFields>) {
|
|
136
|
+
setFields((prev) => prev ? { ...prev, ...partial } : prev); setError(null);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function addTag(tag: string) {
|
|
140
|
+
const t = tag.trim().toLowerCase();
|
|
141
|
+
if (!t || !fields) return;
|
|
142
|
+
if (!fields.tags.includes(t)) update({ tags: [...fields.tags, t] });
|
|
143
|
+
setTagInput('');
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function addDep(field: 'blocked_by' | 'blocks', value: string) {
|
|
147
|
+
const num = parseInt(value, 10);
|
|
148
|
+
if (isNaN(num) || num <= 0 || !fields) return;
|
|
149
|
+
if (!fields[field].includes(num)) update({ [field]: [...fields[field], num] });
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (!scope || !fields) return null;
|
|
153
|
+
|
|
154
|
+
const validTargets = engine.getValidTargets(scope.status);
|
|
155
|
+
const statusOptions = [scope.status, ...validTargets.filter((t) => t !== scope.status)];
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<Dialog open={open} onOpenChange={(isOpen) => { if (!isOpen) handleClose(); }}>
|
|
159
|
+
<DialogContent className="max-w-[min(72rem,calc(100vw_-_2rem))] h-[85vh] flex flex-col p-0 gap-0 overflow-hidden">
|
|
160
|
+
<DialogHeader className="px-4 pt-3 pb-2">
|
|
161
|
+
<div className="flex items-start gap-3 pr-8">
|
|
162
|
+
<span className="font-mono text-xxs text-muted-foreground mt-1.5">{formatScopeId(scope.id)}</span>
|
|
163
|
+
<div className="min-w-0 flex-1">
|
|
164
|
+
<DialogTitle asChild>
|
|
165
|
+
<input className="w-full bg-transparent text-sm font-normal text-foreground border-none focus:outline-none focus:ring-0 placeholder:text-muted-foreground leading-tight"
|
|
166
|
+
value={fields.title} onChange={(e) => update({ title: e.target.value })} placeholder="Scope title..." />
|
|
167
|
+
</DialogTitle>
|
|
168
|
+
<DialogDescription asChild>
|
|
169
|
+
<div className="mt-2 flex flex-wrap items-center gap-2">
|
|
170
|
+
<select className={SELECT_CLS} value={fields.status} onChange={(e) => update({ status: e.target.value })}>
|
|
171
|
+
{statusOptions.map((s) => <option key={s} value={s}>{s}</option>)}
|
|
172
|
+
</select>
|
|
173
|
+
<select className={SELECT_CLS} value={fields.priority} onChange={(e) => update({ priority: e.target.value })}>
|
|
174
|
+
<option value="">priority</option>
|
|
175
|
+
{PRIORITY_OPTIONS.map((p) => <option key={p} value={p}>{p}</option>)}
|
|
176
|
+
</select>
|
|
177
|
+
<select className={SELECT_CLS} value={fields.effort_estimate} onChange={(e) => update({ effort_estimate: e.target.value })}>
|
|
178
|
+
<option value="">effort</option>
|
|
179
|
+
{EFFORT_BUCKETS.map((e) => <option key={e} value={e}>{e}</option>)}
|
|
180
|
+
</select>
|
|
181
|
+
<select className={SELECT_CLS} value={fields.category} onChange={(e) => update({ category: e.target.value })}>
|
|
182
|
+
<option value="">category</option>
|
|
183
|
+
{CATEGORY_OPTIONS.map((c) => <option key={c} value={c}>{c}</option>)}
|
|
184
|
+
</select>
|
|
185
|
+
{fields.tags.map((tag) => (
|
|
186
|
+
<span key={tag} className="group inline-flex items-center gap-0.5 glass-pill rounded bg-muted px-1.5 py-0.5 text-xxs text-muted-foreground">
|
|
187
|
+
{tag}
|
|
188
|
+
<button onClick={() => update({ tags: fields.tags.filter((t) => t !== tag) })} className="opacity-0 group-hover:opacity-100 transition-opacity">
|
|
189
|
+
<XIcon className="h-2.5 w-2.5" />
|
|
190
|
+
</button>
|
|
191
|
+
</span>
|
|
192
|
+
))}
|
|
193
|
+
<input className="h-5 w-16 rounded bg-transparent text-xxs text-muted-foreground placeholder:text-muted-foreground/50 border-none focus:outline-none"
|
|
194
|
+
placeholder="+tag" value={tagInput} onChange={(e) => setTagInput(e.target.value)}
|
|
195
|
+
onKeyDown={(e) => { if (e.key === 'Enter') { e.preventDefault(); addTag(tagInput); } }}
|
|
196
|
+
onBlur={() => { if (tagInput.trim()) addTag(tagInput); }} />
|
|
197
|
+
</div>
|
|
198
|
+
</DialogDescription>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
<div className="mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-xxs text-muted-foreground">
|
|
202
|
+
<DepEditor label="Blocked by" ids={fields.blocked_by}
|
|
203
|
+
onRemove={(id) => update({ blocked_by: fields.blocked_by.filter((d) => d !== id) })}
|
|
204
|
+
onAdd={(v) => addDep('blocked_by', v)} />
|
|
205
|
+
<DepEditor label="Blocks" ids={fields.blocks}
|
|
206
|
+
onRemove={(id) => update({ blocks: fields.blocks.filter((d) => d !== id) })}
|
|
207
|
+
onAdd={(v) => addDep('blocks', v)} />
|
|
208
|
+
<span className="flex items-center gap-1">
|
|
209
|
+
<ExternalLink className="h-3 w-3" />
|
|
210
|
+
<span className="truncate max-w-[300px]">{scope.file_path}</span>
|
|
211
|
+
</span>
|
|
212
|
+
</div>
|
|
213
|
+
</DialogHeader>
|
|
214
|
+
|
|
215
|
+
<Separator />
|
|
216
|
+
|
|
217
|
+
{error && (
|
|
218
|
+
<div className="mx-4 mt-2 flex items-center gap-2 rounded border border-red-500/30 bg-red-500/10 px-3 py-1.5 text-xs text-red-400">
|
|
219
|
+
<span className="flex-1">{error}</span>
|
|
220
|
+
<button onClick={() => setError(null)} className="shrink-0 hover:text-red-200 transition-colors"><XIcon className="h-3.5 w-3.5" /></button>
|
|
221
|
+
</div>
|
|
222
|
+
)}
|
|
223
|
+
|
|
224
|
+
<div className="flex flex-1 min-h-0">
|
|
225
|
+
<div className="flex-[6] min-w-0 border-r bg-[#0a0a12]">
|
|
226
|
+
<ScrollArea className="h-full">
|
|
227
|
+
<div className="px-6 py-5">
|
|
228
|
+
{scope.raw_content ? <MarkdownRenderer content={scope.raw_content} /> : (
|
|
229
|
+
<p className="text-xs text-muted-foreground italic">No content available</p>
|
|
230
|
+
)}
|
|
231
|
+
</div>
|
|
232
|
+
</ScrollArea>
|
|
233
|
+
</div>
|
|
234
|
+
<div className="flex-[4] min-w-0">
|
|
235
|
+
<div className="flex h-full flex-col p-4">
|
|
236
|
+
<SessionPanel sessions={sessions} loading={sessionsLoading} />
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
{isDirty && (
|
|
242
|
+
<div className="mx-4 mb-2 flex items-center gap-2 rounded border border-border bg-card px-3 py-2">
|
|
243
|
+
<Badge variant="outline">Unsaved changes</Badge>
|
|
244
|
+
<div className="flex-1" />
|
|
245
|
+
<Button variant="ghost" size="sm" onClick={() => { setFields(saved); setError(null); }}>Discard</Button>
|
|
246
|
+
<Button size="sm" onClick={() => save()} disabled={saving}>
|
|
247
|
+
{saving ? 'Saving...' : 'Save'}
|
|
248
|
+
</Button>
|
|
249
|
+
{error && <span className="text-xs text-destructive ml-2">{error}</span>}
|
|
250
|
+
</div>
|
|
251
|
+
)}
|
|
252
|
+
</DialogContent>
|
|
253
|
+
</Dialog>
|
|
254
|
+
);
|
|
255
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { FilterChip } from './FilterChip';
|
|
2
|
+
import { SearchInput } from './SearchInput';
|
|
3
|
+
import { Badge } from '@/components/ui/badge';
|
|
4
|
+
import { X } from 'lucide-react';
|
|
5
|
+
import { cn } from '@/lib/utils';
|
|
6
|
+
import { useTheme } from '@/hooks/useTheme';
|
|
7
|
+
import type { FilterField, ScopeFilterState } from '@/types';
|
|
8
|
+
import type { FilterOption } from '@/hooks/useScopeFilters';
|
|
9
|
+
import type { SearchMode } from '@/hooks/useSearch';
|
|
10
|
+
|
|
11
|
+
interface ScopeFilterBarProps {
|
|
12
|
+
filters: ScopeFilterState;
|
|
13
|
+
optionsWithCounts: Record<FilterField, FilterOption[]>;
|
|
14
|
+
onToggle: (field: FilterField, value: string) => void;
|
|
15
|
+
onClearField: (field: FilterField) => void;
|
|
16
|
+
onClearAll: () => void;
|
|
17
|
+
hasActiveFilters: boolean;
|
|
18
|
+
searchQuery?: string;
|
|
19
|
+
searchMode?: SearchMode;
|
|
20
|
+
searchIsStale?: boolean;
|
|
21
|
+
onSearchChange?: (query: string) => void;
|
|
22
|
+
onSearchModeChange?: (mode: SearchMode) => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const CHIP_CONFIG: { field: FilterField; label: string; glowClass: string }[] = [
|
|
26
|
+
{ field: 'priority', label: 'Priority', glowClass: 'glow-amber' },
|
|
27
|
+
{ field: 'category', label: 'Category', glowClass: 'glow-blue' },
|
|
28
|
+
{ field: 'tags', label: 'Tags', glowClass: 'glow-blue' },
|
|
29
|
+
{ field: 'effort', label: 'Effort', glowClass: '' },
|
|
30
|
+
{ field: 'dependencies', label: 'Deps', glowClass: 'glow-red' },
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const FIELD_LABEL: Record<FilterField, string> = {
|
|
34
|
+
priority: 'Priority',
|
|
35
|
+
category: 'Category',
|
|
36
|
+
tags: 'Tag',
|
|
37
|
+
effort: 'Effort',
|
|
38
|
+
dependencies: 'Dep',
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const CATEGORY_COLOR: Record<string, string> = {
|
|
42
|
+
feature: '#536dfe',
|
|
43
|
+
bugfix: '#ff1744',
|
|
44
|
+
refactor: '#8B5CF6',
|
|
45
|
+
infrastructure: '#40c4ff',
|
|
46
|
+
docs: '#6B7280',
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export function ScopeFilterBar({
|
|
50
|
+
filters,
|
|
51
|
+
optionsWithCounts,
|
|
52
|
+
onToggle,
|
|
53
|
+
onClearField,
|
|
54
|
+
onClearAll,
|
|
55
|
+
hasActiveFilters,
|
|
56
|
+
searchQuery = '',
|
|
57
|
+
searchMode = 'filter',
|
|
58
|
+
searchIsStale,
|
|
59
|
+
onSearchChange,
|
|
60
|
+
onSearchModeChange,
|
|
61
|
+
}: ScopeFilterBarProps) {
|
|
62
|
+
const { neonGlass } = useTheme();
|
|
63
|
+
|
|
64
|
+
// Group active values by field
|
|
65
|
+
const activeFields: { field: FilterField; values: { value: string; label: string }[] }[] = [];
|
|
66
|
+
for (const { field } of CHIP_CONFIG) {
|
|
67
|
+
if (filters[field].size === 0) continue;
|
|
68
|
+
const values: { value: string; label: string }[] = [];
|
|
69
|
+
for (const value of filters[field]) {
|
|
70
|
+
const opt = optionsWithCounts[field].find((o) => o.value === value);
|
|
71
|
+
values.push({ value, label: opt?.label ?? value });
|
|
72
|
+
}
|
|
73
|
+
activeFields.push({ field, values });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div className="mb-4 space-y-2">
|
|
78
|
+
{/* Chip row */}
|
|
79
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
80
|
+
{CHIP_CONFIG.map(({ field, label, glowClass }) => (
|
|
81
|
+
<FilterChip
|
|
82
|
+
key={field}
|
|
83
|
+
field={field}
|
|
84
|
+
label={label}
|
|
85
|
+
options={optionsWithCounts[field]}
|
|
86
|
+
selected={filters[field]}
|
|
87
|
+
onToggle={onToggle}
|
|
88
|
+
glowClass={glowClass}
|
|
89
|
+
/>
|
|
90
|
+
))}
|
|
91
|
+
|
|
92
|
+
{hasActiveFilters && (
|
|
93
|
+
<button
|
|
94
|
+
onClick={onClearAll}
|
|
95
|
+
className="ml-2 text-xxs text-muted-foreground hover:text-foreground transition-colors"
|
|
96
|
+
>
|
|
97
|
+
Clear all
|
|
98
|
+
</button>
|
|
99
|
+
)}
|
|
100
|
+
|
|
101
|
+
{onSearchChange && onSearchModeChange && (
|
|
102
|
+
<SearchInput
|
|
103
|
+
query={searchQuery}
|
|
104
|
+
mode={searchMode}
|
|
105
|
+
isStale={searchIsStale}
|
|
106
|
+
onQueryChange={onSearchChange}
|
|
107
|
+
onModeChange={onSearchModeChange}
|
|
108
|
+
/>
|
|
109
|
+
)}
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
{/* Active filter summary — field label + individual value badges + clear-field */}
|
|
113
|
+
{activeFields.length > 0 && (
|
|
114
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
115
|
+
{activeFields.map(({ field, values }) => (
|
|
116
|
+
<div key={field} className="flex items-center gap-1">
|
|
117
|
+
<span className="text-[10px] text-muted-foreground capitalize">{FIELD_LABEL[field]}:</span>
|
|
118
|
+
{values.map(({ value, label }) => {
|
|
119
|
+
const isCat = field === 'category';
|
|
120
|
+
return (
|
|
121
|
+
<Badge
|
|
122
|
+
key={value}
|
|
123
|
+
variant={isCat ? 'outline' : 'secondary'}
|
|
124
|
+
className={cn(
|
|
125
|
+
'gap-0.5 capitalize cursor-pointer hover:bg-secondary/60 py-0 px-1 text-[10px] font-light',
|
|
126
|
+
neonGlass && !isCat && 'glass-pill',
|
|
127
|
+
neonGlass && isCat && 'bg-[rgba(var(--neon-blue),0.08)]'
|
|
128
|
+
)}
|
|
129
|
+
style={isCat ? { borderColor: CATEGORY_COLOR[value] } : undefined}
|
|
130
|
+
onClick={() => onToggle(field, value)}
|
|
131
|
+
>
|
|
132
|
+
{label}
|
|
133
|
+
<X className="h-2 w-2 opacity-60" />
|
|
134
|
+
</Badge>
|
|
135
|
+
);
|
|
136
|
+
})}
|
|
137
|
+
{values.length > 1 && (
|
|
138
|
+
<button
|
|
139
|
+
onClick={() => onClearField(field)}
|
|
140
|
+
className="rounded p-0.5 text-muted-foreground hover:bg-surface-light hover:text-foreground"
|
|
141
|
+
aria-label={`Clear all ${FIELD_LABEL[field]} filters`}
|
|
142
|
+
>
|
|
143
|
+
<X className="h-2.5 w-2.5" />
|
|
144
|
+
</button>
|
|
145
|
+
)}
|
|
146
|
+
</div>
|
|
147
|
+
))}
|
|
148
|
+
</div>
|
|
149
|
+
)}
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { useRef, useEffect, useCallback } from 'react';
|
|
2
|
+
import { Search, X } from 'lucide-react';
|
|
3
|
+
import { cn } from '@/lib/utils';
|
|
4
|
+
import { useTheme } from '@/hooks/useTheme';
|
|
5
|
+
import type { SearchMode } from '@/hooks/useSearch';
|
|
6
|
+
|
|
7
|
+
interface SearchInputProps {
|
|
8
|
+
query: string;
|
|
9
|
+
mode: SearchMode;
|
|
10
|
+
isStale?: boolean;
|
|
11
|
+
onQueryChange: (query: string) => void;
|
|
12
|
+
onModeChange: (mode: SearchMode) => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function SearchInput({ query, mode, isStale, onQueryChange, onModeChange }: SearchInputProps) {
|
|
16
|
+
const { neonGlass } = useTheme();
|
|
17
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
18
|
+
|
|
19
|
+
// Global `/` shortcut to focus search
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
function handleKeyDown(e: KeyboardEvent) {
|
|
22
|
+
if (e.key === '/' && !(e.target instanceof HTMLInputElement) && !(e.target instanceof HTMLTextAreaElement)) {
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
inputRef.current?.focus();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
28
|
+
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
29
|
+
}, []);
|
|
30
|
+
|
|
31
|
+
const handleKeyDown = useCallback((e: React.KeyboardEvent) => {
|
|
32
|
+
if (e.key === 'Escape') {
|
|
33
|
+
if (query) {
|
|
34
|
+
onQueryChange('');
|
|
35
|
+
} else {
|
|
36
|
+
inputRef.current?.blur();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}, [query, onQueryChange]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div className="flex items-center gap-1.5 ml-auto" role="search" aria-label="Search scopes">
|
|
43
|
+
{/* Search input */}
|
|
44
|
+
<div className={cn(
|
|
45
|
+
'flex items-center gap-1.5 rounded-md border px-2 py-1 backdrop-blur-sm bg-white/[0.03] border-white/10 transition-colors',
|
|
46
|
+
'focus-within:border-white/20',
|
|
47
|
+
neonGlass && 'focus-within:glow-blue',
|
|
48
|
+
)}>
|
|
49
|
+
<Search className={cn('h-3 w-3 shrink-0 text-muted-foreground', isStale && 'animate-pulse')} />
|
|
50
|
+
<input
|
|
51
|
+
ref={inputRef}
|
|
52
|
+
type="text"
|
|
53
|
+
value={query}
|
|
54
|
+
onChange={(e) => onQueryChange(e.target.value.slice(0, 100))}
|
|
55
|
+
onKeyDown={handleKeyDown}
|
|
56
|
+
placeholder="Search scopes..."
|
|
57
|
+
className="w-32 bg-transparent text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none"
|
|
58
|
+
aria-label="Search scopes"
|
|
59
|
+
/>
|
|
60
|
+
{query && (
|
|
61
|
+
<button
|
|
62
|
+
onClick={() => onQueryChange('')}
|
|
63
|
+
className="shrink-0 text-muted-foreground hover:text-foreground transition-colors"
|
|
64
|
+
aria-label="Clear search"
|
|
65
|
+
>
|
|
66
|
+
<X className="h-3 w-3" />
|
|
67
|
+
</button>
|
|
68
|
+
)}
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
{/* Mode toggle */}
|
|
72
|
+
<div className={cn(
|
|
73
|
+
'flex rounded-md border backdrop-blur-sm bg-white/[0.03] border-white/10 overflow-hidden',
|
|
74
|
+
)}>
|
|
75
|
+
<button
|
|
76
|
+
onClick={() => onModeChange('filter')}
|
|
77
|
+
className={cn(
|
|
78
|
+
'px-2 py-1 text-[10px] transition-colors',
|
|
79
|
+
mode === 'filter'
|
|
80
|
+
? 'bg-white/10 text-foreground'
|
|
81
|
+
: 'text-muted-foreground hover:text-foreground hover:bg-white/[0.04]',
|
|
82
|
+
)}
|
|
83
|
+
aria-pressed={mode === 'filter'}
|
|
84
|
+
>
|
|
85
|
+
Filter
|
|
86
|
+
</button>
|
|
87
|
+
<button
|
|
88
|
+
onClick={() => onModeChange('highlight')}
|
|
89
|
+
className={cn(
|
|
90
|
+
'px-2 py-1 text-[10px] transition-colors',
|
|
91
|
+
mode === 'highlight'
|
|
92
|
+
? 'bg-white/10 text-foreground'
|
|
93
|
+
: 'text-muted-foreground hover:text-foreground hover:bg-white/[0.04]',
|
|
94
|
+
)}
|
|
95
|
+
aria-pressed={mode === 'highlight'}
|
|
96
|
+
>
|
|
97
|
+
Highlight
|
|
98
|
+
</button>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
);
|
|
102
|
+
}
|