fix(team): resolve TypeScript errors in team collaboration module

- Remove unused imports and variables in Team components
- Fix CollaborationEvent type import in useTeamEvents
- Add proper type guards for Hand status in gatewayStore
- Fix Session status type compatibility in gateway-client
- Remove unused getGatewayClient import from teamStore
- Handle unknown payload types in TeamCollaborationView

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-03-15 09:20:58 +08:00
parent 4802eb7d6a
commit fc30290b1c
9 changed files with 93 additions and 47 deletions

View File

@@ -7,11 +7,11 @@
* @module components/DevQALoop
*/
import { useState, useEffect } from 'react';
import { useState } from 'react';
import { useTeamStore } from '../store/teamStore';
import type { DevQALoop as DevQALoopType, ReviewFeedback, ReviewIssue } from '../types/team';
import {
RefreshCw, CheckCircle, XCircle, AlertTriangle, ArrowRight,
RefreshCw, CheckCircle, XCircle, AlertTriangle,
Clock, MessageSquare, FileCode, Bug, Lightbulb, ChevronDown, ChevronUp,
Send, ThumbsUp, ThumbsDown, AlertOctagon,
} from 'lucide-react';
@@ -126,7 +126,7 @@ interface ReviewFormProps {
onCancel: () => void;
}
function ReviewForm({ loopId, teamId, onSubmit, onCancel }: ReviewFormProps) {
function ReviewForm({ loopId: _loopId, teamId: _teamId, onSubmit, onCancel }: ReviewFormProps) {
const [verdict, setVerdict] = useState<ReviewFeedback['verdict']>('needs_work');
const [comment, setComment] = useState('');
const [issues, setIssues] = useState<ReviewIssue[]>([]);
@@ -316,10 +316,6 @@ export function DevQALoopPanel({ loop, teamId, developerName, reviewerName, task
setShowReviewForm(false);
};
const handleStartRevising = async () => {
await updateLoopState(teamId, loop.id, 'revising');
};
const handleCompleteRevision = async () => {
await updateLoopState(teamId, loop.id, 'reviewing');
};

View File

@@ -11,7 +11,7 @@ import { useState, useEffect, useRef } from 'react';
import { useTeamStore } from '../store/teamStore';
import type { Team, TeamMember, TeamTask, CollaborationEvent } from '../types/team';
import {
Activity, Users, CheckCircle, Clock, AlertTriangle, Play, Pause,
Activity, Users, CheckCircle, AlertTriangle, Play,
ArrowRight, GitBranch, MessageSquare, FileCode, Bot, Zap,
TrendingUp, TrendingDown, Minus, Circle,
} from 'lucide-react';
@@ -56,7 +56,9 @@ function EventFeedItem({ event, team }: EventFeedItemProps) {
</span>
</div>
<p className="text-sm text-gray-600 dark:text-gray-400 mt-0.5 line-clamp-2">
{event.payload.description || JSON.stringify(event.payload).slice(0, 100)}
{typeof event.payload.description === 'string'
? event.payload.description
: JSON.stringify(event.payload).slice(0, 100)}
</p>
</div>
<span className="text-xs text-gray-400 whitespace-nowrap">

View File

@@ -7,11 +7,10 @@
* @module components/TeamOrchestrator
*/
import { useState, useEffect, useCallback } from 'react';
import { useState, useEffect } from 'react';
import { useTeamStore } from '../store/teamStore';
import { useGatewayStore } from '../store/gatewayStore';
import type {
Team,
TeamMember,
TeamTask,
TeamMemberRole,
@@ -19,9 +18,9 @@ import type {
CollaborationPattern,
} from '../types/team';
import {
Users, Plus, Trash2, Edit2, Check, X, ChevronDown, ChevronUp,
Bot, GitBranch, ArrowRight, Clock, AlertTriangle, CheckCircle,
Play, Pause, Settings, UserPlus, FileText, Activity,
Users, Plus, Trash2, X,
Bot, Clock, AlertTriangle, CheckCircle,
Play, UserPlus, FileText,
} from 'lucide-react';
// === Sub-Components ===
@@ -115,7 +114,7 @@ interface TaskCardProps {
onStatusChange: (status: TeamTask['status']) => void;
}
function TaskCard({ task, members, isSelected, onSelect, onAssign, onStatusChange }: TaskCardProps) {
function TaskCard({ task, members, isSelected, onSelect, onAssign, onStatusChange: _onStatusChange }: TaskCardProps) {
const [showAssignMenu, setShowAssignMenu] = useState(false);
const priorityColors: Record<TaskPriority, string> = {
@@ -216,7 +215,6 @@ export function TeamOrchestrator({ isOpen, onClose }: TeamOrchestratorProps) {
teams,
activeTeam,
metrics,
isLoading,
error,
selectedTaskId,
selectedMemberId,