mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-06 16:31:12 +08:00
feat: add terminal panel components and Zustand store for state management
- Created a barrel export file for terminal panel components. - Implemented Zustand store for managing terminal panel UI state, including visibility, active terminal, view mode, and terminal ordering. - Added actions for opening/closing the terminal panel, setting the active terminal, changing view modes, and managing terminal order. - Introduced selectors for accessing terminal panel state properties.
This commit is contained in:
@@ -108,7 +108,6 @@ export function useActiveCliExecutions(
|
||||
const removeExecution = useCliStreamStore(state => state.removeExecution);
|
||||
const executions = useCliStreamStore(state => state.executions);
|
||||
const setCurrentExecution = useCliStreamStore(state => state.setCurrentExecution);
|
||||
const markExecutionClosedByUser = useCliStreamStore(state => state.markExecutionClosedByUser);
|
||||
const isExecutionClosedByUser = useCliStreamStore(state => state.isExecutionClosedByUser);
|
||||
const cleanupUserClosedExecutions = useCliStreamStore(state => state.cleanupUserClosedExecutions);
|
||||
|
||||
|
||||
@@ -44,10 +44,8 @@ import {
|
||||
type ProviderCredential,
|
||||
type CustomEndpoint,
|
||||
type CacheStats,
|
||||
type GlobalCacheSettings,
|
||||
type ModelPoolConfig,
|
||||
type ModelPoolType,
|
||||
type DiscoveredProvider,
|
||||
type CliSettingsEndpoint,
|
||||
type SaveCliSettingsRequest,
|
||||
} from '../lib/api';
|
||||
|
||||
@@ -9,15 +9,10 @@ import {
|
||||
fetchGraphImpact,
|
||||
type GraphDependenciesRequest,
|
||||
type GraphDependenciesResponse,
|
||||
type GraphImpactRequest,
|
||||
type GraphImpactResponse,
|
||||
} from '../lib/api';
|
||||
import type {
|
||||
GraphData,
|
||||
GraphNode,
|
||||
GraphEdge,
|
||||
GraphFilters,
|
||||
GraphMetadata,
|
||||
NodeType,
|
||||
EdgeType,
|
||||
} from '../types/graph-explorer';
|
||||
@@ -132,7 +127,7 @@ function filterGraphData(
|
||||
|
||||
// Filter by minimum complexity
|
||||
if (filters.minComplexity !== undefined) {
|
||||
filteredNodes = filteredNodes.filter(node => {
|
||||
filteredNodes = filteredNodes.filter(_node => {
|
||||
// This would require complexity data to be available
|
||||
// For now, we'll skip this filter
|
||||
return true;
|
||||
@@ -239,7 +234,6 @@ export function useGraphData(options: UseGraphDataOptions = {}): UseGraphDataRet
|
||||
rootPath,
|
||||
maxDepth,
|
||||
nodeTypes,
|
||||
edgeTypes,
|
||||
} = options;
|
||||
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
@@ -8,7 +8,6 @@ import { renderHook, waitFor } from '@testing-library/react';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import {
|
||||
useIssueQueue,
|
||||
useIssueMutations,
|
||||
useQueueMutations,
|
||||
useIssueDiscovery,
|
||||
} from './useIssues';
|
||||
|
||||
@@ -25,7 +25,6 @@ import {
|
||||
exportDiscoveryFindingsAsIssues,
|
||||
type Issue,
|
||||
type IssueQueue,
|
||||
type IssuesResponse,
|
||||
type QueueHistoryIndex,
|
||||
type DiscoverySession,
|
||||
type Finding,
|
||||
|
||||
@@ -24,7 +24,6 @@ import {
|
||||
type McpProjectConfigType,
|
||||
type McpTemplate,
|
||||
type McpTemplateInstallRequest,
|
||||
type AllProjectsResponse,
|
||||
type OtherProjectsServersResponse,
|
||||
type CrossCliCopyRequest,
|
||||
type CrossCliCopyResponse,
|
||||
@@ -439,7 +438,7 @@ export function useCodexMutations(): UseCodexMutationsReturn {
|
||||
// Optimistic update could be added here if needed
|
||||
return { serverName, enabled };
|
||||
},
|
||||
onError: (_error, _vars, context) => {
|
||||
onError: (_error, _vars, _context) => {
|
||||
// Rollback on error
|
||||
console.error('Failed to toggle Codex MCP server:', _error);
|
||||
},
|
||||
|
||||
@@ -168,7 +168,7 @@ export function useCreateSession(): UseCreateSessionReturn {
|
||||
|
||||
const mutation = useMutation({
|
||||
mutationFn: createSession,
|
||||
onSuccess: (newSession) => {
|
||||
onSuccess: () => {
|
||||
// Invalidate sessions cache to trigger refetch
|
||||
queryClient.invalidateQueries({ queryKey: ['workspace'] });
|
||||
// Invalidate dashboard stats
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
enableSkill,
|
||||
disableSkill,
|
||||
type Skill,
|
||||
type SkillsResponse,
|
||||
} from '../lib/api';
|
||||
import { useWorkflowStore, selectProjectPath } from '@/stores/workflowStore';
|
||||
import { workspaceQueryKeys } from '@/lib/queryKeys';
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
type ExecutionLog,
|
||||
} from '../types/execution';
|
||||
import { SurfaceUpdateSchema } from '../packages/a2ui-runtime/core/A2UITypes';
|
||||
import type { ToolCallKind } from '../types/toolCall';
|
||||
import type { ToolCallKind, ToolCallExecution } from '../types/toolCall';
|
||||
|
||||
// Constants
|
||||
const RECONNECT_DELAY_BASE = 1000; // 1 second
|
||||
@@ -242,7 +242,7 @@ export function useWebSocket(options: UseWebSocketOptions = {}): UseWebSocketRet
|
||||
const currentNodeId = stores.currentExecution?.currentNodeId;
|
||||
if (currentNodeId && (unitType === 'stdout' || unitType === 'stderr')) {
|
||||
const toolCalls = stores.getToolCallsForNode?.(currentNodeId);
|
||||
const activeCall = toolCalls?.find(c => c.status === 'executing');
|
||||
const activeCall = toolCalls?.find((c: ToolCallExecution) => c.status === 'executing');
|
||||
|
||||
if (activeCall) {
|
||||
stores.updateToolCall(currentNodeId, activeCall.callId, {
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
// ========================================
|
||||
// TanStack Query hook for fetching workflow status distribution
|
||||
|
||||
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useWorkflowStore, selectProjectPath } from '@/stores/workflowStore';
|
||||
import { workspaceQueryKeys } from '@/lib/queryKeys';
|
||||
|
||||
/**
|
||||
* Workflow status count data structure
|
||||
|
||||
Reference in New Issue
Block a user