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:
arkon
2026-03-01 04:57:37 +01:00
co-authored by Claude Opus 4.6
parent e7a9cbe442
commit f44f0a912f
14 changed files with 4660 additions and 3800 deletions
+10 -2
View File
@@ -20,6 +20,7 @@
<script defer src="vendor/xterm-addon-fit.min.js"></script>
<script defer src="vendor/xterm-addon-webgl.min.js"></script>
<script defer src="vendor/xterm-addon-unicode11.min.js"></script>
<script defer src="vendor/xterm-zerolag-input.js?v=0.2.9"></script>
<!-- Synchronous mobile detection — runs before first paint to prevent panel flash -->
<script>if(window.innerWidth<768||(('ontouchstart' in window||navigator.maxTouchPoints>0)&&window.innerWidth<1024))document.documentElement.classList.add('mobile-init');</script>
<!-- Inline critical CSS for instant skeleton paint (before styles.css loads) -->
@@ -1669,7 +1670,14 @@
<!-- Lines drawn dynamically -->
</svg>
<script defer src="app.js?v=0.1631"></script>
<script defer src="ralph-wizard.js?v=0.1631"></script>
<script defer src="constants.js?v=0.2.9"></script>
<script defer src="mobile-handlers.js?v=0.2.9"></script>
<script defer src="voice-input.js?v=0.2.9"></script>
<script defer src="notification-manager.js?v=0.2.9"></script>
<script defer src="keyboard-accessory.js?v=0.2.9"></script>
<script defer src="app.js?v=0.2.9"></script>
<script defer src="ralph-wizard.js?v=0.2.9"></script>
<script defer src="api-client.js?v=0.2.9"></script>
<script defer src="subagent-windows.js?v=0.2.9"></script>
</body>
</html>