Skip to content

Commit f32b2a1

Browse files
author
DavidQ
committed
PR_BREAKOUT_DEBUG_SHOWCASE_POLISH_FULL
Polishes Breakout as a Debug Showcase sample. Includes: - header-level Debug Showcase label - unique showcase color - debug ON/OFF badge - default preset auto-load - Open Debug Panel button - inline mini help
1 parent ed28ef3 commit f32b2a1

13 files changed

+466
-39
lines changed

docs/dev/CODEX_COMMANDS.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
MODEL: GPT-5.3-codex
2-
REASONING: low
2+
REASONING: medium
33

44
COMMAND:
5-
Execute PLAN + BUILD + APPLY for ASTEROIDS_SHOWCASE_LABEL_UPDATE
5+
Execute PLAN + BUILD + APPLY for BREAKOUT_DEBUG_SHOWCASE_POLISH.
6+
7+
IN SCOPE:
8+
- add `Debug Showcase` to the Breakout header in `games/index.html`
9+
- apply a unique color for the showcase label
10+
- add `Debug: ON/OFF` badge
11+
- add default preset auto-load behavior
12+
- add `Open Debug Panel` button
13+
- add 1-2 lines of inline mini help
14+
15+
RULES:
16+
- Breakout only
17+
- preserve existing formatting patterns
18+
- no unrelated runtime refactors
19+
- no unrelated game entry edits
620

721
OUTPUT:
8-
<project folder>/tmp/PR_ASTEROIDS_SHOWCASE_LABEL_UPDATE_FULL_bundle.zip
22+
Create:
23+
<project folder>/tmp/PR_BREAKOUT_DEBUG_SHOWCASE_POLISH_FULL_bundle.zip

docs/dev/COMMIT_COMMENT.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
PR_ASTEROIDS_SHOWCASE_LABEL_UPDATE_FULL
2-
Add Debug Showcase label + update engine classes.
1+
PR_BREAKOUT_DEBUG_SHOWCASE_POLISH_FULL
2+
polish(breakout): add debug showcase label/UI affordances and debug preset bootstrap without unrelated refactors

docs/dev/NEXT_COMMAND.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Continue Asteroids productization polish
1+
PLAN_PR_BREAKOUT_DEBUG_SHOWCASE_DEEPER_PANEL_PRESETS

docs/dev/reports/change_summary.txt

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,24 @@ David Quesenberry
33
04/05/2026
44
change_summary.txt
55

6-
Executed PLAN + BUILD + APPLY for ASTEROIDS_SHOWCASE_LABEL_UPDATE.
6+
Executed PLAN + BUILD + APPLY for BREAKOUT_DEBUG_SHOWCASE_POLISH.
77

8-
Applied updates:
9-
- Added `Debug Showcase` badge to Asteroids card on games hub.
10-
- Updated Asteroids card/list wording to call out showcase role.
11-
- Updated Asteroids landing page title and heading to `Asteroids - Debug Showcase`.
12-
- Updated Engine Classes section label and added debug integration references.
8+
Implemented:
9+
- Updated Breakout card in `games/index.html` to include `Debug Showcase` in header/tag area.
10+
- Added unique Breakout showcase badge color style.
11+
- Updated `games/Breakout/index.html` with:
12+
- `Debug: ON/OFF` badge
13+
- `Open Debug Panel` button
14+
- 2-line inline mini-help
15+
- Debug showcase title/header adjustments
16+
- Updated `games/Breakout/main.js` with:
17+
- URL-based debug enablement
18+
- default preset auto-load behavior (`preset.apply preset.gameplay` fallback safe)
19+
- overlay hidden by default until explicit open
20+
- UI state wiring for badge/button/help text
21+
- Updated `games/Breakout/game/BreakoutScene.js` to render debug integration surface last and update diagnostics snapshots.
1322

1423
Scope guard:
15-
- Text/metadata updates only.
16-
- No runtime logic changes.
24+
- Breakout runtime only + Breakout card in games hub.
25+
- No engine core API changes.
26+
- No unrelated game entry edits.

docs/dev/reports/file_tree.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ David Quesenberry
33
04/05/2026
44
file_tree.txt
55

6-
docs/pr/PLAN_PR_ASTEROIDS_SHOWCASE_LABEL_UPDATE.md
7-
docs/pr/BUILD_PR_ASTEROIDS_SHOWCASE_LABEL_UPDATE.md
8-
docs/pr/APPLY_PR_ASTEROIDS_SHOWCASE_LABEL_UPDATE.md
6+
docs/pr/PLAN_PR_BREAKOUT_DEBUG_SHOWCASE_POLISH.md
7+
docs/pr/BUILD_PR_BREAKOUT_DEBUG_SHOWCASE_POLISH.md
8+
docs/pr/APPLY_PR_BREAKOUT_DEBUG_SHOWCASE_POLISH.md
99
docs/dev/codex_commands.md
1010
docs/dev/commit_comment.txt
1111
docs/dev/next_command.txt
1212
docs/dev/reports/change_summary.txt
1313
docs/dev/reports/validation_checklist.txt
1414
docs/dev/reports/file_tree.txt
1515
games/index.html
16-
games/Asteroids/index.html
16+
games/Breakout/index.html
17+
games/Breakout/main.js
18+
games/Breakout/game/BreakoutScene.js

docs/dev/reports/validation_checklist.txt

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@ David Quesenberry
33
04/05/2026
44
validation_checklist.txt
55

6-
[x] Asteroids labeled as Debug Showcase on games hub
7-
[x] Asteroids page title updated
8-
[x] Asteroids page heading updated
9-
[x] Engine/classes section reflects debug integration
10-
[x] No runtime logic files changed for this PR purpose
11-
[x] Bundle ZIP created at requested path
6+
[x] PLAN, BUILD, APPLY docs created and aligned
7+
[x] Breakout card includes `Debug Showcase` in `games/index.html`
8+
[x] Breakout showcase badge uses unique color class
9+
[x] Breakout page includes `Debug: ON/OFF` badge
10+
[x] Breakout page includes `Open Debug Panel` button
11+
[x] Breakout page includes 1-2 lines of inline mini-help
12+
[x] Debug preset auto-load behavior implemented for debug-enabled mode
13+
[x] Overlay remains hidden by default after preset auto-load
14+
[x] Breakout scene renders debug integration HUD last
15+
[x] No engine core changes
16+
[x] No unrelated game entry edits
1217

13-
Validation checks:
14-
- `games/index.html` contains `Debug Showcase` badge for Asteroids
15-
- `games/Asteroids/index.html` title/H1 updated
18+
Validation commands:
19+
- `node --check games/Breakout/main.js`
20+
- `node --check games/Breakout/game/BreakoutScene.js`
21+
- `node --check tools/dev/devConsoleIntegration.js`
22+
- `node tests/games/BreakoutValidation.test.mjs`
23+
- `rg -n "Debug Showcase|Debug: ON|Debug: OFF|Open Debug Panel|preset.apply" games/index.html games/Breakout/index.html games/Breakout/main.js`
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Toolbox Aid
2+
David Quesenberry
3+
04/05/2026
4+
APPLY_PR_BREAKOUT_DEBUG_SHOWCASE_POLISH.md
5+
6+
# APPLY_PR_BREAKOUT_DEBUG_SHOWCASE_POLISH
7+
8+
## Apply Decision
9+
BUILD_PR_BREAKOUT_DEBUG_SHOWCASE_POLISH is applied as approved with Breakout-only scope.
10+
11+
## Applied Scope
12+
- `games/index.html`
13+
- Breakout header/tag now includes `Debug Showcase` with unique color.
14+
- `games/Breakout/index.html`
15+
- Added `Debug: ON/OFF` badge, `Open Debug Panel` button, and inline mini-help.
16+
- `games/Breakout/main.js`
17+
- Added debug state wiring, default preset auto-load, and button open behavior.
18+
- `games/Breakout/game/BreakoutScene.js`
19+
- Added optional debug integration update/render hooks.
20+
21+
## Validation Summary
22+
- Breakout hub card reflects debug showcase status.
23+
- Breakout page exposes ON/OFF state and explicit open-panel control.
24+
- Default preset behavior applies only in debug-enabled mode.
25+
- Overlay remains hidden by default until explicit open action.
26+
- No unrelated runtime refactors or unrelated game entry edits.
27+
28+
## Output Artifact
29+
`<project folder>/tmp/PR_BREAKOUT_DEBUG_SHOWCASE_POLISH_FULL_bundle.zip`
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Toolbox Aid
2+
David Quesenberry
3+
04/05/2026
4+
BUILD_PR_BREAKOUT_DEBUG_SHOWCASE_POLISH.md
5+
6+
# BUILD_PR_BREAKOUT_DEBUG_SHOWCASE_POLISH
7+
8+
## Build Summary
9+
Implemented Breakout-only debug showcase polish with no engine-core modifications.
10+
11+
## Implemented Changes
12+
1. Games Hub (`games/index.html`)
13+
- Added Breakout `Debug Showcase` badge in the card tag row.
14+
- Added `(Debug Showcase)` marker in Breakout card title.
15+
- Added a unique Breakout showcase badge color style.
16+
17+
2. Breakout Page (`games/Breakout/index.html`)
18+
- Updated title and H1 to `Breakout - Debug Showcase`.
19+
- Added `Debug: ON/OFF` badge placeholder.
20+
- Added `Open Debug Panel` button entry point.
21+
- Added two inline mini-help lines for activation and controls.
22+
- Expanded class list to include debug integration reference.
23+
24+
3. Breakout Runtime Wiring (`games/Breakout/main.js`)
25+
- Added URL-based debug config resolution (`?debug=1`, optional `debugMode`).
26+
- Added default preset auto-load behavior when debug is enabled.
27+
- Kept overlay/console hidden by default after preset load.
28+
- Added badge/button/help UI state updates based on debug status.
29+
- Added Open Debug Panel click behavior that opens overlay via public runtime API.
30+
31+
4. Breakout Scene Integration (`games/Breakout/game/BreakoutScene.js`)
32+
- Added optional `devConsoleIntegration`/`debugConfig` support.
33+
- Added diagnostics context mapping for runtime/input/entities/render.
34+
- Added debug integration update path during scene update.
35+
- Added debug integration render call at end of scene render to keep HUD last.
36+
37+
## Scope Control
38+
- Breakout-only runtime changes.
39+
- Single games hub entry updated (Breakout).
40+
- No engine core changes.
41+
- No unrelated game entry edits.
42+
43+
## Validation Performed
44+
- `node --check games/Breakout/main.js`
45+
- `node --check games/Breakout/game/BreakoutScene.js`
46+
- `node --check tools/dev/devConsoleIntegration.js`
47+
- `node tests/games/BreakoutValidation.test.mjs`
48+
- `rg` checks for showcase label, debug badge, and helper text presence.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Toolbox Aid
2+
David Quesenberry
3+
04/05/2026
4+
PLAN_PR_BREAKOUT_DEBUG_SHOWCASE_POLISH.md
5+
6+
# PLAN_PR_BREAKOUT_DEBUG_SHOWCASE_POLISH
7+
8+
## Goal
9+
Execute a small, Breakout-only polish slice that presents Breakout as a debug showcase while keeping gameplay behavior stable.
10+
11+
## Workflow
12+
PLAN_PR -> BUILD_PR -> APPLY_PR
13+
14+
## In Scope
15+
- `games/index.html`
16+
- Add `Debug Showcase` to the Breakout card header area.
17+
- Apply a unique color treatment for the Breakout showcase label.
18+
- `games/Breakout/index.html`
19+
- Add visible `Debug: ON/OFF` badge.
20+
- Add `Open Debug Panel` button.
21+
- Add 1-2 lines of inline mini help.
22+
- `games/Breakout/main.js`
23+
- Add debug ON/OFF UI state wiring.
24+
- Add default preset auto-load behavior when debug is enabled.
25+
- `games/Breakout/game/BreakoutScene.js`
26+
- Render debug surface integration safely on top of game rendering.
27+
28+
## Out of Scope
29+
- Engine core API changes.
30+
- Non-Breakout gameplay refactors.
31+
- Unrelated games hub entry edits.
32+
33+
## Behavior Contract
34+
1. Breakout listing shows `Debug Showcase` in the header/tag region with a unique badge color.
35+
2. Breakout page shows `Debug: OFF` by default unless debug is explicitly enabled.
36+
3. Enabling debug (`?debug=1`) sets badge to `Debug: ON`, enables the button, and auto-applies the default preset.
37+
4. Overlay remains hidden by default even after preset load; user opens it explicitly via button or key combo.
38+
5. Inline help remains concise and focused on activation/opening instructions.
39+
40+
## Validation Targets
41+
- Breakout card updated in `games/index.html` only.
42+
- Unique showcase color is visible and readable.
43+
- Debug badge and button present on Breakout page.
44+
- Default preset auto-load executes only when debug is enabled.
45+
- Open Debug Panel button opens overlay only when debug is enabled.
46+
- No unrelated runtime refactors.

games/breakout/game/BreakoutScene.js

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,37 +47,101 @@ function wrapText(text, maxCharacters = 34) {
4747
}
4848

4949
export default class BreakoutScene extends Scene {
50-
constructor() {
50+
constructor(options = {}) {
5151
super();
52+
this.devConsoleIntegration = options.devConsoleIntegration || null;
53+
this.debugConfig = options.debugConfig || {
54+
debugMode: 'prod',
55+
debugEnabled: Boolean(this.devConsoleIntegration),
56+
};
5257
this.world = new BreakoutWorld(VIEW);
5358
this.inputController = null;
5459
this.audio = new BreakoutAudio();
5560
this.isPaused = false;
61+
this.engineRef = null;
5662
}
5763

5864
enter(engine) {
65+
this.engineRef = engine || null;
5966
this.inputController = new BreakoutInputController(engine.input);
6067
this.audio.setAudioService(engine.audio ?? null);
6168
this.world.resetGame();
6269
this.isPaused = false;
6370
}
6471

65-
update(dt) {
72+
exit() {
73+
this.devConsoleIntegration?.dispose?.();
74+
}
75+
76+
buildDebugDiagnosticsContext(engine, dt) {
77+
const safeDt = Number.isFinite(dt) && dt > 0 ? dt : 1 / 60;
78+
const fps = Math.round(1 / safeDt);
79+
const input = engine?.input ?? this.inputController?.input ?? null;
80+
81+
return {
82+
runtime: {
83+
sceneId: 'breakout-debug-showcase',
84+
status: this.world.status,
85+
fps,
86+
frameTimeMs: Math.round(safeDt * 1000 * 100) / 100,
87+
debugMode: this.debugConfig.debugMode,
88+
debugEnabled: this.debugConfig.debugEnabled === true,
89+
},
90+
entities: {
91+
count: this.world.remainingBricks + 2,
92+
bricksRemaining: this.world.remainingBricks,
93+
lives: this.world.lives,
94+
score: this.world.score,
95+
},
96+
input: {
97+
left: input?.isDown?.('ArrowLeft') === true || input?.isDown?.('KeyA') === true,
98+
right: input?.isDown?.('ArrowRight') === true || input?.isDown?.('KeyD') === true,
99+
launch: input?.isDown?.('Space') === true || input?.isDown?.('Enter') === true,
100+
pause: input?.isDown?.('KeyP') === true,
101+
},
102+
render: {
103+
stages: ['entities', 'vector-overlay'],
104+
debugSurfaceTail: ['debug-overlay', 'dev-console-surface'],
105+
},
106+
validation: {
107+
errorCount: 0,
108+
warningCount: 0,
109+
},
110+
};
111+
}
112+
113+
updateDebugIntegration(engine, dt) {
114+
if (!this.devConsoleIntegration) {
115+
return;
116+
}
117+
118+
this.devConsoleIntegration.update({
119+
engine,
120+
scene: this,
121+
diagnosticsContext: this.buildDebugDiagnosticsContext(engine, dt),
122+
});
123+
}
124+
125+
update(dt, engine = null) {
126+
const engineRef = engine || this.engineRef || { input: this.inputController?.input ?? null };
66127
const frame = this.inputController.getFrameState();
67128

68129
if (frame.exitPressed && this.isPaused) {
69130
this.isPaused = false;
70131
this.world.resetGame();
132+
this.updateDebugIntegration(engineRef, dt);
71133
return;
72134
}
73135

74136
const canPause = this.world.status === 'playing' || this.world.status === 'serve';
75137
if (canPause && frame.pausePressed) {
76138
this.isPaused = !this.isPaused;
139+
this.updateDebugIntegration(engineRef, dt);
77140
return;
78141
}
79142

80143
if (this.isPaused) {
144+
this.updateDebugIntegration(engineRef, dt);
81145
return;
82146
}
83147

@@ -101,6 +165,8 @@ export default class BreakoutScene extends Scene {
101165
if (event.won) {
102166
this.audio.playWin();
103167
}
168+
169+
this.updateDebugIntegration(engineRef, dt);
104170
}
105171

106172
render(renderer) {
@@ -121,6 +187,12 @@ export default class BreakoutScene extends Scene {
121187
} else if (this.world.status !== 'playing') {
122188
this.drawOverlay(renderer);
123189
}
190+
191+
if (this.devConsoleIntegration) {
192+
this.devConsoleIntegration.render(renderer, {
193+
worldStages: ['entities', 'vector-overlay'],
194+
});
195+
}
124196
}
125197

126198
drawWalls(renderer) {

0 commit comments

Comments
 (0)