From 521ad8ab419376abd3040184fe86ec3294bdc5db Mon Sep 17 00:00:00 2001 From: Haileyesus Date: Mon, 2 Mar 2026 17:12:21 +0300 Subject: [PATCH] refactor(TaskMaster): Remove unused TaskMasterSetupWizard and TaskMasterStatus components --- src/components/TaskMasterSetupWizard.jsx | 604 ----------------------- src/components/TaskMasterStatus.jsx | 86 ---- 2 files changed, 690 deletions(-) delete mode 100644 src/components/TaskMasterSetupWizard.jsx delete mode 100644 src/components/TaskMasterStatus.jsx diff --git a/src/components/TaskMasterSetupWizard.jsx b/src/components/TaskMasterSetupWizard.jsx deleted file mode 100644 index 6bcb1738..00000000 --- a/src/components/TaskMasterSetupWizard.jsx +++ /dev/null @@ -1,604 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import { X, ChevronRight, ChevronLeft, CheckCircle, AlertCircle, Settings, Server, FileText, Sparkles, ExternalLink, Copy } from 'lucide-react'; -import { cn } from '../lib/utils'; -import { api } from '../utils/api'; -import { copyTextToClipboard } from '../utils/clipboard'; - -const TaskMasterSetupWizard = ({ - isOpen = true, - onClose, - onComplete, - currentProject, - className = '' -}) => { - const [currentStep, setCurrentStep] = useState(1); - const [loading, setLoading] = useState(false); - const [error, setError] = useState(null); - const [setupData, setSetupData] = useState({ - projectRoot: '', - initGit: true, - storeTasksInGit: true, - addAliases: true, - skipInstall: false, - rules: ['claude'], - mcpConfigured: false, - prdContent: '' - }); - - const totalSteps = 4; - - useEffect(() => { - if (currentProject) { - setSetupData(prev => ({ - ...prev, - projectRoot: currentProject.path || '' - })); - } - }, [currentProject]); - - const steps = [ - { - id: 1, - title: 'Project Configuration', - description: 'Configure basic TaskMaster settings for your project' - }, - { - id: 2, - title: 'MCP Server Setup', - description: 'Ensure TaskMaster MCP server is properly configured' - }, - { - id: 3, - title: 'PRD Creation', - description: 'Create or import a Product Requirements Document' - }, - { - id: 4, - title: 'Complete Setup', - description: 'Initialize TaskMaster and generate initial tasks' - } - ]; - - const handleNext = async () => { - setError(null); - - try { - if (currentStep === 1) { - // Validate project configuration - if (!setupData.projectRoot) { - setError('Project root path is required'); - return; - } - setCurrentStep(2); - } else if (currentStep === 2) { - // Check MCP server status - setLoading(true); - try { - const mcpStatus = await api.get('/mcp-utils/taskmaster-server'); - setSetupData(prev => ({ - ...prev, - mcpConfigured: mcpStatus.hasMCPServer && mcpStatus.isConfigured - })); - setCurrentStep(3); - } catch (err) { - setError('Failed to check MCP server status. You can continue but some features may not work.'); - setCurrentStep(3); - } - } else if (currentStep === 3) { - // Validate PRD step - if (!setupData.prdContent.trim()) { - setError('Please create or import a PRD to continue'); - return; - } - setCurrentStep(4); - } else if (currentStep === 4) { - // Complete setup - await completeSetup(); - } - } catch (err) { - setError(err.message || 'An error occurred'); - } finally { - setLoading(false); - } - }; - - const handlePrevious = () => { - if (currentStep > 1) { - setCurrentStep(currentStep - 1); - setError(null); - } - }; - - const completeSetup = async () => { - setLoading(true); - try { - // Initialize TaskMaster project - const initResponse = await api.post('/taskmaster/initialize', { - projectRoot: setupData.projectRoot, - initGit: setupData.initGit, - storeTasksInGit: setupData.storeTasksInGit, - addAliases: setupData.addAliases, - skipInstall: setupData.skipInstall, - rules: setupData.rules, - yes: true - }); - - if (!initResponse.ok) { - throw new Error('Failed to initialize TaskMaster project'); - } - - // Save PRD content if provided - if (setupData.prdContent.trim()) { - const prdResponse = await api.post('/taskmaster/save-prd', { - projectRoot: setupData.projectRoot, - content: setupData.prdContent - }); - - if (!prdResponse.ok) { - console.warn('Failed to save PRD content'); - } - } - - // Parse PRD to generate initial tasks - if (setupData.prdContent.trim()) { - const parseResponse = await api.post('/taskmaster/parse-prd', { - projectRoot: setupData.projectRoot, - input: '.taskmaster/docs/prd.txt', - numTasks: '10', - research: false, - force: false - }); - - if (!parseResponse.ok) { - console.warn('Failed to parse PRD and generate tasks'); - } - } - - onComplete?.(); - onClose?.(); - } catch (err) { - setError(err.message || 'Failed to complete TaskMaster setup'); - } finally { - setLoading(false); - } - }; - - const copyMCPConfig = () => { - const mcpConfig = `{ - "mcpServers": { - "": { - "command": "npx", - "args": ["-y", "--package=task-master-ai", "task-master-ai"], - "env": { - "ANTHROPIC_API_KEY": "your_anthropic_key_here", - "PERPLEXITY_API_KEY": "your_perplexity_key_here" - } - } - } -}`; - copyTextToClipboard(mcpConfig); - }; - - const renderStepContent = () => { - switch (currentStep) { - case 1: - return ( -
-
- -

- Project Configuration -

-

- Configure TaskMaster settings for your project -

-
- -
-
- - setSetupData(prev => ({ ...prev, projectRoot: e.target.value }))} - className="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-800 text-gray-900 dark:text-white" - placeholder="/path/to/your/project" - /> -
- -
-

Options

- - - - - - -
- -
- -
- {['claude', 'cursor', 'vscode', 'roo', 'cline', 'windsurf'].map(rule => ( - - ))} -
-
-
-
- ); - - case 2: - return ( -
-
- -

- MCP Server Setup -

-

- TaskMaster works best with the MCP server configured -

-
- -
-
- -
-

- MCP Server Configuration -

-

- To enable full TaskMaster integration, add the MCP server configuration to your Claude settings. -

- -
-
- .mcp.json - -
-
-{`{
-  "mcpServers": {
-    "task-master-ai": {
-      "command": "npx",
-      "args": ["-y", "--package=task-master-ai", "task-master-ai"],
-      "env": {
-        "ANTHROPIC_API_KEY": "your_anthropic_key_here",
-        "PERPLEXITY_API_KEY": "your_perplexity_key_here"
-      }
-    }
-  }
-}`}
-                    
-
- - -
-
-
- -
-

Current Status

-
- {setupData.mcpConfigured ? ( - <> - - MCP server is configured - - ) : ( - <> - - MCP server not detected (optional) - - )} -
-
-
- ); - - case 3: - return ( -
-
- -

- Product Requirements Document -

-

- Create or import a PRD to generate initial tasks -

-
- -
-
- -