Add serial console with 5-state machine for debugging and ZMK log detection#28
Add serial console with 5-state machine for debugging and ZMK log detection#28Copilot wants to merge 5 commits into
Conversation
- Create useSerialConsole hook with Web Serial API support - Create SerialConsole component with filtering and replacement - Create DraggableWindow component for floating console - Create SerialConsoleContext for state management - Add DebugConsolePage with console tab integration - Integrate console into App with tab switching and fallback logic - Add Web Serial API type definitions Co-authored-by: cormoran <7994064+cormoran@users.noreply.github.com>
- Add SerialConsole component tests with full coverage - Add DraggableWindow component tests - Add DebugConsolePage tests - Fix accessibility warnings in DraggableWindow - Fix scrollIntoView optional chaining for test compatibility - All tests passing (150 passed, 1 skipped) Co-authored-by: cormoran <7994064+cormoran@users.noreply.github.com>
|
@copilot The UI sounds nice, but transitions are not expected. There are 3 status:
In state A: When connecting from splash screen, In state B: When user open Console tab and click connect, create new connection and goto state D In state C: Show serial console window and splash screen. In state D: Show console in the tab. In state E, Show console as window. To enable transition for state A, I think you have to somehow wrap If serial console connection closed, just close serial window. No need to try re-connect in any case. Finally please pass lint before submission, in addition to test. |
- Implement 5-state machine (A-E) as requested - State A: No connection - State B: Only ZMK Studio connection - State C: Only serial console (with splash screen) - State D: ZMK + serial, console tab active - State E: ZMK + serial, other tab active - Auto-detect serial logs from failed ZMK connections - Steal RpcTransport for serial console usage - Console tab only appears when serial connected - Fix lint errors and all tests passing Co-authored-by: cormoran <7994064+cormoran@users.noreply.github.com>
Co-authored-by: cormoran <7994064+cormoran@users.noreply.github.com>
I've completely redesigned the serial console feature to implement the 5-state machine (A-E) as requested: Key changes implemented (commit ace90db):
The log detection checks for patterns like |
🚀 Cloudflare Workers PreviewPreview URL: https://feb2a9da-dya-studio.cormoran707.workers.dev Deployed from commit c43db53 |
Implements Web Serial API integration for keyboard debugging with intelligent state management and automatic ZMK log detection.
Implementation
Serial Console Component
Draggable Window
5-State Machine
The application implements a precise state machine with 5 states:
ZMK Integration & Transport Stealing
When attempting ZMK Studio connection from splash screen:
Console Tab Behavior
State Transitions
Screenshots
Debug Console Tab

Settings Panel

Console Tab in Navigation

Notes
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.