From 2fffe78dc9af451f96d8c3b821b87b0d3e94b690 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Thu, 22 Jan 2026 15:30:35 +0800 Subject: [PATCH] fix(multi-cli): complete solution details display in summary tab (#98) Fixed issue where multi-CLI planning solution cards only showed count, feasibility, effort, and risk badges but had empty content area. Changes: - Enhanced renderMultiCliSummaryContent() to extract and display all solution fields - Solution name (name/title) - Feasibility score (feasibility) - Effort level (effort) - Risk level (risk) - Summary/description (summary) - Pros list (pros) - Cons list (cons) - Added CSS styles for solution cards - .solution-details, .details-label, .details-list - .solution-header, .solution-title-row, .solution-badges - .badge with variants for feasibility/effort/risk - Fixed related issues: - Added multiCliPlan support to backend data structures - Exposed liteTaskDataStore to window for global access - Fixed header left-alignment in detail pages - Added 'active' class to tab content for visibility Files modified: - ccw/src/templates/dashboard-js/views/lite-tasks.js - ccw/src/templates/dashboard-css/04-lite-tasks.css - ccw/src/core/server.ts - ccw/src/core/routes/system-routes.ts - ccw/src/templates/dashboard-js/state.js - ccw/src/templates/dashboard-css/02-session.css - ccw/src/config/litellm-api-config-manager.ts (fix homedir import) Closes #98 --- ccw/src/config/litellm-api-config-manager.ts | 5 +- ccw/src/core/routes/system-routes.ts | 5 +- ccw/src/core/server.ts | 9 +- .../templates/dashboard-css/02-session.css | 2 + .../templates/dashboard-css/04-lite-tasks.css | 104 +++++++++++++++++- ccw/src/templates/dashboard-js/state.js | 2 + .../dashboard-js/views/lite-tasks.js | 66 +++++++++-- 7 files changed, 174 insertions(+), 19 deletions(-) diff --git a/ccw/src/config/litellm-api-config-manager.ts b/ccw/src/config/litellm-api-config-manager.ts index 8f3b614c..6110920c 100644 --- a/ccw/src/config/litellm-api-config-manager.ts +++ b/ccw/src/config/litellm-api-config-manager.ts @@ -4,9 +4,10 @@ */ import { existsSync, mkdirSync, readFileSync, writeFileSync, chmodSync } from 'fs'; -import { homedir } from 'os'; import { join } from 'path'; +import { homedir } from 'os'; import { StoragePaths, GlobalPaths, ensureStorageDir } from './storage-paths.js'; +import { getCodexLensDataDir } from '../utils/codexlens-path.js'; import type { LiteLLMApiConfig, ProviderCredential, @@ -798,7 +799,7 @@ export function syncCodexLensConfig(baseDir: string): { success: boolean; messag const rotationConfig = config.codexlensEmbeddingRotation; // Get CodexLens settings path - const codexlensDir = join(homedir(), '.codexlens'); + const codexlensDir = getCodexLensDataDir(); const settingsPath = join(codexlensDir, 'settings.json'); // Ensure directory exists diff --git a/ccw/src/core/routes/system-routes.ts b/ccw/src/core/routes/system-routes.ts index ab509276..f4260fa3 100644 --- a/ccw/src/core/routes/system-routes.ts +++ b/ccw/src/core/routes/system-routes.ts @@ -145,7 +145,7 @@ async function getWorkflowData(projectPath: string): Promise { generatedAt: new Date().toISOString(), activeSessions: [], archivedSessions: [], - liteTasks: { litePlan: [], liteFix: [] }, + liteTasks: { litePlan: [], liteFix: [], multiCliPlan: [] }, reviewData: { dimensions: {} }, projectOverview: null, statistics: { @@ -155,7 +155,8 @@ async function getWorkflowData(projectPath: string): Promise { completedTasks: 0, reviewFindings: 0, litePlanCount: 0, - liteFixCount: 0 + liteFixCount: 0, + multiCliPlanCount: 0 }, projectPath: normalizePathForDisplay(resolvedPath), recentPaths: getRecentPaths() diff --git a/ccw/src/core/server.ts b/ccw/src/core/server.ts index de8de2c3..5b5be4d9 100644 --- a/ccw/src/core/server.ts +++ b/ccw/src/core/server.ts @@ -29,7 +29,7 @@ import { handleLiteLLMApiRoutes } from './routes/litellm-api-routes.js'; import { handleNavStatusRoutes } from './routes/nav-status-routes.js'; import { handleAuthRoutes } from './routes/auth-routes.js'; import { handleLoopRoutes } from './routes/loop-routes.js'; -import { handleLoopV2Routes } from './routes/loop-v2-routes.js'; +import { handleLoopV2Routes, initializeCliToolsCache } from './routes/loop-v2-routes.js'; import { handleTestLoopRoutes } from './routes/test-loop-routes.js'; import { handleTaskRoutes } from './routes/task-routes.js'; @@ -383,10 +383,10 @@ function generateServerDashboard(initialPath: string): string { generatedAt: new Date().toISOString(), activeSessions: [], archivedSessions: [], - liteTasks: { litePlan: [], liteFix: [] }, + liteTasks: { litePlan: [], liteFix: [], multiCliPlan: [] }, reviewData: { dimensions: {} }, projectOverview: null, - statistics: { totalSessions: 0, activeSessions: 0, totalTasks: 0, completedTasks: 0, reviewFindings: 0, litePlanCount: 0, liteFixCount: 0 } + statistics: { totalSessions: 0, activeSessions: 0, totalTasks: 0, completedTasks: 0, reviewFindings: 0, litePlanCount: 0, liteFixCount: 0, multiCliPlanCount: 0 } }; // Replace JS placeholders @@ -723,6 +723,9 @@ export async function startServer(options: ServerOptions = {}): Promise -
+
${renderMultiCliTasksTab(session)}
@@ -653,12 +653,17 @@ function switchMultiCliDetailTab(tabName) { break; case 'context': loadAndRenderMultiCliContextTab(session, contentArea); + contentArea.classList.add('active'); return; // Early return as this is async case 'summary': loadAndRenderMultiCliSummaryTab(session, contentArea); + contentArea.classList.add('active'); return; // Early return as this is async } + // Add active class to show content + contentArea.classList.add('active'); + // Re-initialize after tab switch setTimeout(() => { if (typeof lucide !== 'undefined') lucide.createIcons(); @@ -1097,13 +1102,52 @@ function renderMultiCliSummaryContent(summary, session) { `); @@ -2722,12 +2766,12 @@ function showLiteTaskDetailPage(sessionKey) {
-

${session.type === 'lite-plan' ? '' : ''} ${escapeHtml(session.id)}

+

${session.type === 'lite-plan' ? '' : session.type === 'lite-fix' ? '' : ''} ${escapeHtml(session.id)}

- ${session.type} + ${session.type === 'multi-cli-plan' ? 'MULTI-CLI' : session.type}