mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 00:49:41 +02:00
refactor: split app.js into focused frontend modules (phase 5)
Extract 8 modules from the 15K-line app.js monolith:
- constants.js: shared constants, timing, escapeHtml(), extractSyncSegments()
- mobile-handlers.js: MobileDetection, KeyboardHandler, SwipeHandler
- voice-input.js: DeepgramProvider, VoiceInput
- notification-manager.js: NotificationManager class
- keyboard-accessory.js: KeyboardAccessoryBar, FocusTrap
- api-client.js: _api(), _apiJson(), _apiPost(), _apiDelete() helpers
- subagent-windows.js: 13 subagent window methods (open, close, drag, lines)
- vendor/xterm-zerolag-input.js: IIFE build replacing inlined copy
app.js reduced from ~15,200 to ~11,500 lines. All modules use global
scope with <script defer> ordering. Prototype extensions use
Object.assign(CodemanApp.prototype, {...}) pattern.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -361,7 +361,7 @@ Object.assign(CodemanApp.prototype, {
|
||||
prompt += 'Output `<promise>BLOCKED</promise>` with explanation';
|
||||
|
||||
// Show preview with highlighting (escape first, then apply formatting)
|
||||
const escapedPrompt = this.escapeHtml(prompt);
|
||||
const escapedPrompt = escapeHtml(prompt);
|
||||
const highlightedPrompt = escapedPrompt
|
||||
.replace(/<promise>/g, '<span class="preview-highlight"><promise>')
|
||||
.replace(/<\/promise>/g, '</promise></span>')
|
||||
@@ -724,7 +724,7 @@ Object.assign(CodemanApp.prototype, {
|
||||
<input type="checkbox" class="plan-item-checkbox" ${item.enabled ? 'checked' : ''}
|
||||
onchange="app.togglePlanItem(${index})">
|
||||
${item.priority ? `<span class="plan-item-priority-badge">${item.priority}</span>` : ''}
|
||||
<span class="plan-item-text">${this.escapeHtml(item.content)}</span>
|
||||
<span class="plan-item-text">${escapeHtml(item.content)}</span>
|
||||
`;
|
||||
fragment.appendChild(row);
|
||||
});
|
||||
@@ -847,7 +847,7 @@ Object.assign(CodemanApp.prototype, {
|
||||
<div class="plan-subagent-header">
|
||||
<span>
|
||||
<span class="plan-subagent-icon">${typeIcons[agentType] || '🤖'}</span>
|
||||
<span class="plan-subagent-title">${typeLabels[agentType] || this.escapeHtml(agentType)}</span>
|
||||
<span class="plan-subagent-title">${typeLabels[agentType] || escapeHtml(agentType)}</span>
|
||||
</span>
|
||||
<span class="plan-subagent-model">${model}</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user