mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-28 09:23:08 +08:00
feat: add CLI Viewer Page with multi-pane layout and state management
- Implemented the CliViewerPage component for displaying CLI outputs in a configurable multi-pane layout. - Integrated Zustand for state management, allowing for dynamic layout changes and tab management. - Added layout options: single, split horizontal, split vertical, and 2x2 grid. - Created viewerStore for managing layout, panes, and tabs, including actions for adding/removing panes and tabs. - Added CoordinatorPage barrel export for easier imports.
This commit is contained in:
@@ -177,6 +177,41 @@ async function fetchApi<T>(
|
||||
|
||||
// ========== Transformation Helpers ==========
|
||||
|
||||
/**
|
||||
* Infer session type from session_id pattern (matches backend logic)
|
||||
* Used as fallback when backend.type field is missing
|
||||
*
|
||||
* @param sessionId - Session ID to analyze
|
||||
* @returns Inferred session type
|
||||
*
|
||||
* @see ccw/src/core/session-scanner.ts:inferTypeFromName for backend implementation
|
||||
*/
|
||||
function inferTypeFromName(sessionId: string): SessionMetadata['type'] {
|
||||
const name = sessionId.toLowerCase();
|
||||
|
||||
if (name.includes('-review-') || name.includes('-code-review-')) {
|
||||
return 'review';
|
||||
}
|
||||
if (name.includes('-tdd-') || name.includes('-test-driven-')) {
|
||||
return 'tdd';
|
||||
}
|
||||
if (name.includes('-test-') || name.includes('-testing-')) {
|
||||
return 'test';
|
||||
}
|
||||
if (name.includes('-docs-') || name.includes('-doc-') || name.includes('-documentation-')) {
|
||||
return 'docs';
|
||||
}
|
||||
if (name.includes('-lite-plan-')) {
|
||||
return 'lite-plan';
|
||||
}
|
||||
if (name.includes('-lite-fix-') || name.includes('-fix-')) {
|
||||
return 'lite-fix';
|
||||
}
|
||||
|
||||
// Default to workflow for standard sessions
|
||||
return 'workflow';
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform backend session data to frontend SessionMetadata interface
|
||||
* Maps backend schema (project, status: 'active') to frontend schema (title, description, status: 'in_progress', location)
|
||||
@@ -212,8 +247,14 @@ function transformBackendSession(
|
||||
description = parts.slice(1).join(':').trim();
|
||||
}
|
||||
|
||||
// Preserve type field from backend, or infer from session_id pattern
|
||||
// Multi-level type detection: backend.type > infer from name
|
||||
const sessionType = (backendSession.type as SessionMetadata['type']) ||
|
||||
inferTypeFromName(backendSession.session_id);
|
||||
|
||||
return {
|
||||
session_id: backendSession.session_id,
|
||||
type: sessionType,
|
||||
title,
|
||||
description,
|
||||
status: transformedStatus,
|
||||
|
||||
Reference in New Issue
Block a user