Skip to content

Commit b6f3317

Browse files
author
DavidQ
committed
Enforce fullscreen rule across all samples and fix sample 0713 scaling.
Locks fullscreen capability to sample 0713 only. Adds requirement to fully fill screen while maintaining aspect ratio. PR: LEVEL 23.8 FULLSCREEN REGRESSION LOCK + FIX
1 parent 464182f commit b6f3317

8 files changed

Lines changed: 106 additions & 22 deletions

docs/dev/codex_commands.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
MODEL: GPT-5.3-codex
2+
REASONING: high
3+
4+
COMMAND:
5+
- Scan all samples
6+
- Remove fullscreen usage except sample 0713
7+
- Fix sample 0713 fullscreen scaling:
8+
- Must fill entire screen
9+
- Must preserve aspect ratio
10+
- No letterboxing or unused space
11+
- Do NOT modify engine core
12+
- Package results into repo structure

docs/dev/commit_comment.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Enforce fullscreen rule across all samples and fix sample 0713 scaling.
2+
3+
Locks fullscreen capability to sample 0713 only.
4+
Adds requirement to fully fill screen while maintaining aspect ratio.
5+
6+
PR: LEVEL 23.8 FULLSCREEN REGRESSION LOCK + FIX
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Fullscreen Audit Report
2+
3+
- Sample 0713: VALID (allowed fullscreen) — FIX REQUIRED: does not fully fill screen while maintaining aspect ratio
4+
- All other samples: MUST NOT include fullscreen
5+
6+
Violations:
7+
- Any sample using engine.fullscreen = TRUE must be removed
8+
9+
Status: LOCK ENFORCED + FIX REQUIRED
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
- [ ] fullscreen usage audit completed across samples
2-
- [ ] unauthorized fullscreen removed from all non-0713 samples
3-
- [ ] sample 0713 fullscreen fills screen correctly
4-
- [ ] sample 0713 maintains aspect ratio
5-
- [ ] fullscreen enter/exit validated for 0713
6-
- [ ] no unauthorized fullscreen behavior remains
7-
- [ ] no start_of_day changes
8-
- [ ] unrelated working-tree changes preserved
1+
Validation Checklist
2+
3+
[ ] Only sample 0713 has fullscreen
4+
[ ] No other sample contains fullscreen flags
5+
[ ] Sample 0713 fills screen fully (no unused space)
6+
[ ] Aspect ratio preserved correctly
7+
[ ] No engine-level fullscreen enforcement added
8+
[ ] Codex respects rule in future PRs
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# BUILD PR LEVEL 23.8
2+
## Fullscreen Regression Lock and Audit
3+
4+
### Purpose
5+
Lock fullscreen behavior rules and prevent future regression outside sample 0713.
6+
7+
### Scope
8+
- Enforce rule: fullscreen ONLY allowed in sample 0713
9+
- Audit all samples for violations
10+
- Prevent Codex from introducing fullscreen elsewhere
11+
- Fix sample 0713 to correctly fill screen while maintaining aspect ratio
12+
13+
### Constraints
14+
- No engine changes
15+
- No rendering changes outside sample 0713 behavior fix
16+
- No gameplay impact
17+
18+
### Acceptance
19+
- Only sample 0713 contains fullscreen logic
20+
- All other samples explicitly exclude fullscreen
21+
- Sample 0713 fills screen correctly while preserving aspect ratio (no letterboxing gaps)

samples/phase-07/0713/fullscreenViewportFit.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ David Quesenberry
44
04/18/2026
55
fullscreenViewportFit.js
66
*/
7-
export function computeContainSize({
7+
export function computeCoverSize({
88
viewportWidth,
99
viewportHeight,
1010
designWidth,
@@ -14,7 +14,7 @@ export function computeContainSize({
1414
const baseHeight = Number.isFinite(designHeight) && designHeight > 0 ? designHeight : 540;
1515
const width = Number.isFinite(viewportWidth) && viewportWidth > 0 ? viewportWidth : baseWidth;
1616
const height = Number.isFinite(viewportHeight) && viewportHeight > 0 ? viewportHeight : baseHeight;
17-
const scale = Math.min(width / baseWidth, height / baseHeight);
17+
const scale = Math.max(width / baseWidth, height / baseHeight);
1818
return {
1919
width: Math.max(1, Math.floor(baseWidth * scale)),
2020
height: Math.max(1, Math.floor(baseHeight * scale)),
@@ -47,24 +47,32 @@ export function attachFullscreenViewportFit({
4747
maxHeight: canvas.style.maxHeight,
4848
margin: canvas.style.margin,
4949
display: canvas.style.display,
50+
position: canvas.style.position,
51+
left: canvas.style.left,
52+
top: canvas.style.top,
53+
transform: canvas.style.transform,
5054
};
5155

5256
function apply() {
5357
if (!readFullscreenState(documentRef)) {
5458
return;
5559
}
56-
const containSize = computeContainSize({
60+
const coverSize = computeCoverSize({
5761
viewportWidth: windowRef.innerWidth,
5862
viewportHeight: windowRef.innerHeight,
5963
designWidth,
6064
designHeight,
6165
});
62-
canvas.style.width = `${containSize.width}px`;
63-
canvas.style.height = `${containSize.height}px`;
66+
canvas.style.width = `${coverSize.width}px`;
67+
canvas.style.height = `${coverSize.height}px`;
6468
canvas.style.maxWidth = 'none';
6569
canvas.style.maxHeight = 'none';
66-
canvas.style.margin = '0 auto';
70+
canvas.style.margin = '0';
6771
canvas.style.display = 'block';
72+
canvas.style.position = 'fixed';
73+
canvas.style.left = '50%';
74+
canvas.style.top = '50%';
75+
canvas.style.transform = 'translate(-50%, -50%)';
6876
}
6977

7078
function reset() {
@@ -74,6 +82,10 @@ export function attachFullscreenViewportFit({
7482
canvas.style.maxHeight = baselineStyles.maxHeight;
7583
canvas.style.margin = baselineStyles.margin;
7684
canvas.style.display = baselineStyles.display;
85+
canvas.style.position = baselineStyles.position;
86+
canvas.style.left = baselineStyles.left;
87+
canvas.style.top = baselineStyles.top;
88+
canvas.style.transform = baselineStyles.transform;
7789
}
7890

7991
function syncWithFullscreenState() {

samples/phase-07/0713/main.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ const engine = new Engine({
1919
canvas,
2020
width: 960,
2121
height: 540,
22+
// Sample 0713 owns fullscreen sizing behavior directly. Disable bezel-driven
23+
// canvas relayout so cover-fit fullscreen can fill the viewport.
24+
fullscreenBezelLayer: {
25+
attach() {},
26+
detach() {},
27+
sync() {
28+
return {
29+
visible: false,
30+
reason: 'sample-managed-fullscreen-layout',
31+
};
32+
},
33+
},
2234
});
2335

2436
const scene = new FullscreenAbilityScene();

tests/samples/FullscreenAbility0713ViewportFit.test.mjs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from "node:assert/strict";
22
import {
33
attachFullscreenViewportFit,
4-
computeContainSize,
4+
computeCoverSize,
55
} from "../../samples/phase-07/0713/fullscreenViewportFit.js";
66
import FullscreenAbilityScene from "../../samples/phase-07/0713/FullscreenAbilityScene.js";
77

@@ -22,21 +22,21 @@ function createEventTarget(initialState = {}) {
2222
}
2323

2424
export function run() {
25-
const exactFit = computeContainSize({
25+
const exactFit = computeCoverSize({
2626
viewportWidth: 1920,
2727
viewportHeight: 1080,
2828
designWidth: 960,
2929
designHeight: 540,
3030
});
3131
assert.deepEqual(exactFit, { width: 1920, height: 1080 });
3232

33-
const letterboxed = computeContainSize({
33+
const covered = computeCoverSize({
3434
viewportWidth: 1920,
3535
viewportHeight: 1200,
3636
designWidth: 960,
3737
designHeight: 540,
3838
});
39-
assert.deepEqual(letterboxed, { width: 1920, height: 1080 });
39+
assert.deepEqual(covered, { width: 2133, height: 1200 });
4040

4141
const canvas = {
4242
style: {
@@ -46,6 +46,10 @@ export function run() {
4646
maxHeight: "",
4747
margin: "",
4848
display: "",
49+
position: "",
50+
left: "",
51+
top: "",
52+
transform: "",
4953
},
5054
};
5155
const documentRef = createEventTarget({ fullscreenElement: null });
@@ -60,21 +64,29 @@ export function run() {
6064

6165
documentRef.fullscreenElement = canvas;
6266
fit.apply();
63-
assert.equal(canvas.style.width, "1920px");
64-
assert.equal(canvas.style.height, "1080px");
67+
assert.equal(canvas.style.width, "2133px");
68+
assert.equal(canvas.style.height, "1200px");
6569
assert.equal(canvas.style.maxWidth, "none");
70+
assert.equal(canvas.style.position, "fixed");
71+
assert.equal(canvas.style.left, "50%");
72+
assert.equal(canvas.style.top, "50%");
73+
assert.equal(canvas.style.transform, "translate(-50%, -50%)");
6674

6775
windowRef.innerWidth = 1280;
6876
windowRef.innerHeight = 1024;
6977
windowRef.trigger("resize");
70-
assert.equal(canvas.style.width, "1280px");
71-
assert.equal(canvas.style.height, "720px");
78+
assert.equal(canvas.style.width, "1820px");
79+
assert.equal(canvas.style.height, "1024px");
7280

7381
documentRef.fullscreenElement = null;
7482
documentRef.trigger("fullscreenchange");
7583
assert.equal(canvas.style.width, "");
7684
assert.equal(canvas.style.height, "");
7785
assert.equal(canvas.style.maxWidth, "960px");
86+
assert.equal(canvas.style.position, "");
87+
assert.equal(canvas.style.left, "");
88+
assert.equal(canvas.style.top, "");
89+
assert.equal(canvas.style.transform, "");
7890

7991
const scene = new FullscreenAbilityScene();
8092
let requestCount = 0;

0 commit comments

Comments
 (0)