Add internationalization support for help view and implement help rendering logic

- Introduced `help-i18n.js` for managing translations in Chinese and English for the help view.
- Created `help.js` to render the help view, including command categories, workflow diagrams, and CodexLens quick-start.
- Implemented search functionality with debounce for command filtering.
- Added workflow diagram rendering with Cytoscape.js integration.
- Developed tests for write-file verification, ensuring proper handling of small and large JSON files.
This commit is contained in:
catlog22
2025-12-16 22:24:29 +08:00
parent b702791c2c
commit 154a9283b5
21 changed files with 2003 additions and 303 deletions

View File

@@ -20,6 +20,7 @@ import { handleRulesRoutes } from './routes/rules-routes.js';
import { handleSessionRoutes } from './routes/session-routes.js';
import { handleCcwRoutes } from './routes/ccw-routes.js';
import { handleClaudeRoutes } from './routes/claude-routes.js';
import { handleHelpRoutes } from './routes/help-routes.js';
// Import WebSocket handling
import { handleWebSocketUpgrade, broadcastToClients } from './websocket.js';
@@ -65,12 +66,14 @@ const MODULE_CSS_FILES = [
'12-skills-rules.css',
'13-claude-manager.css',
'14-graph-explorer.css',
'15-mcp-manager.css'
'15-mcp-manager.css',
'16-help.css'
];
// Modular JS files in dependency order
const MODULE_FILES = [
'i18n.js', // Must be loaded first for translations
'help-i18n.js', // Help page translations
'utils.js',
'state.js',
'api.js',
@@ -113,6 +116,7 @@ const MODULE_FILES = [
'views/rules-manager.js',
'views/claude-manager.js',
'views/graph-explorer.js',
'views/help.js',
'main.js'
];
@@ -300,6 +304,11 @@ export async function startServer(options: ServerOptions = {}): Promise<http.Ser
if (await handleRulesRoutes(routeContext)) return;
}
// Help routes (/api/help/*)
if (pathname.startsWith('/api/help/')) {
if (await handleHelpRoutes(routeContext)) return;
}
// Session routes (/api/session-detail, /api/update-task-status, /api/bulk-update-task-status)
if (pathname.includes('session') || pathname.includes('task-status')) {
if (await handleSessionRoutes(routeContext)) return;