|
| 1 | +Toolbox Aid |
| 2 | +David Quesenberry |
| 3 | +04/05/2026 |
| 4 | +PLAN_PR_INTERACTIVE_DEV_CONSOLE_UI.md |
| 5 | + |
| 6 | +# PLAN PR |
| 7 | +Interactive Dev Console UI |
| 8 | + |
| 9 | +## Objective |
| 10 | +Plan a sample-safe interactive on-screen developer console UI that builds on the existing dev console runtime, |
| 11 | +combo-key system, and canvas debug HUD so commands can be typed and executed directly inside the running sample. |
| 12 | + |
| 13 | +## Scope |
| 14 | +- Add an interactive console UI layer above the existing runtime |
| 15 | +- Support text input, command submission, output history, and simple focus behavior |
| 16 | +- Reuse the current command execution pipeline |
| 17 | +- Keep implementation isolated to tools/dev and one sample integration target |
| 18 | +- Preserve engine core boundaries and current debug controls |
| 19 | + |
| 20 | +## Non-Goals |
| 21 | +- No engine core rewrite |
| 22 | +- No DOM-only console dependency |
| 23 | +- No full editor framework |
| 24 | +- No autocomplete requirement in this PR |
| 25 | +- No multi-sample rollout |
| 26 | + |
| 27 | +## Existing Foundation |
| 28 | +Already in place: |
| 29 | +- dev console runtime |
| 30 | +- combo-key debug controls |
| 31 | +- canvas HUD renderer |
| 32 | +- sample-level integration path |
| 33 | + |
| 34 | +## Planned Behavior |
| 35 | +- Shift + ` toggles console UI visibility |
| 36 | +- Ctrl + Shift + ` toggles HUD visibility |
| 37 | +- Console accepts typed input while open |
| 38 | +- Enter submits a command |
| 39 | +- Escape closes the console UI |
| 40 | +- Up/Down browse recent command history |
| 41 | +- Output is rendered in a visible console region on-canvas |
| 42 | +- Existing runtime commands are reused, not reimplemented |
| 43 | + |
| 44 | +## Candidate Files |
| 45 | +Expected future implementation focus: |
| 46 | +- tools/dev/interactiveDevConsoleRenderer.js |
| 47 | +- tools/dev/devConsoleIntegration.js |
| 48 | +- one sample entry file only |
| 49 | +- optional test file for input/history behavior |
| 50 | + |
| 51 | +## UI Requirements |
| 52 | +- On-canvas console surface |
| 53 | +- Fixed anchor, default bottom-left or top-left |
| 54 | +- Separate input line from output history |
| 55 | +- Readable font and padding |
| 56 | +- Transparent/dim background |
| 57 | +- Safe clipping for long output |
| 58 | +- Max visible history window |
| 59 | +- Distinct prompt marker |
| 60 | +- Non-destructive when closed |
| 61 | + |
| 62 | +## Input Requirements |
| 63 | +- Capture character input only while console is open |
| 64 | +- Do not interfere with sample controls while closed |
| 65 | +- Backspace edits current line |
| 66 | +- Enter executes command |
| 67 | +- Escape closes console |
| 68 | +- Up/Down cycle command history |
| 69 | +- Tab reserved for future autocomplete; no required behavior now |
| 70 | + |
| 71 | +## Integration Rules |
| 72 | +- Reuse existing runtime executeConsoleInput() |
| 73 | +- Reuse current combo-key bindings already implemented |
| 74 | +- Do not spread input handling into engine core |
| 75 | +- Do not duplicate command registry |
| 76 | +- Keep console rendering after world render |
| 77 | +- Keep HUD and console rendering coordinated but separate |
| 78 | + |
| 79 | +## Acceptance Criteria |
| 80 | +- Console opens and closes reliably |
| 81 | +- Typed characters appear on screen |
| 82 | +- Enter executes commands |
| 83 | +- Output history is visible |
| 84 | +- Up/Down history navigation works |
| 85 | +- Escape closes without crashing |
| 86 | +- Sample still runs normally |
| 87 | +- No F-key bindings reintroduced |
| 88 | +- No engine core file changes |
| 89 | + |
| 90 | +## Validation |
| 91 | +- node --check on touched JS files |
| 92 | +- manual browser run |
| 93 | +- verify console typing |
| 94 | +- verify command execution for: |
| 95 | + - help |
| 96 | + - status |
| 97 | + - scene.info |
| 98 | +- verify invalid command output is shown safely |
| 99 | +- verify console input does not remain captured after close |
| 100 | + |
| 101 | +## Risks |
| 102 | +- key handling collisions with gameplay input |
| 103 | +- text rendering overflow |
| 104 | +- duplicate listener setup |
| 105 | +- runtime/UI state drift |
| 106 | + |
| 107 | +## Deliverable |
| 108 | +Create BUILD_PR_INTERACTIVE_DEV_CONSOLE_UI as a docs-only, repo-structured delta. |
0 commit comments