Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/field.md
Original file line number Diff line number Diff line change
Expand Up @@ -843,3 +843,14 @@ Four of smoke part 1's checks had been failing since the Nov 28 changes, on `mai
the board lock check); the next double click, on the board square and in place, shows it full screen. The board lock check is as it was.
The same run's failures in part 4 (blockout's drag, Lights Out's clicks, Soma's tilt, a different one each run) came with other parts
running beside it; part 4 alone passed all 49.
- **A full screen chip where the double click is the game's** (1 Dec 2026, "1 3": "A full-screen button … for games that keep the double click
for themselves"; A FULL SCREEN CHIP, in `toolBarTick`). While a game takes the double click for its own play (`noDoubleTap()` saying so now:
Sudoku, Simon, Lights Out, Whack-a-mole with a board in play, an editor open; or an `onDoubleTap`, which none has today), the field adds one
chip of its own at the end of the game's ring, ⛶, which shows the board you are on full screen (THE BOARD YOU ARE ON, FULL SCREEN, turned
forward first, as the double does) and is pressed (draw's gold) while it is; a press again comes back. It stays up while full screen is on,
whatever the game, so there is always a way back; the labs (their own view) and games whose double click is the field's have none. The chip
is marked `field`, so the game's own chips keep their numbers for `onToolTap`. Part 5 checks it in Sudoku by real clicks (in, pressed, a tap
still Sudoku's, back) and that checkers has none.
Also measured the same day (part 4 failing under load after the full screen's change, passing alone): blockout's and Soma's frames over 20 s,
today's page against the one before the day's changes, two rounds each: blockout 2.4 against 3.0–3.6 s a frame in the software renderer,
Soma 73–75 against 119–147 ms. No frame is slower; the failures under load were the load's.
16 changes: 14 additions & 2 deletions games.html
Original file line number Diff line number Diff line change
Expand Up @@ -6362,6 +6362,7 @@
let _focusCover = null;
function focusOpen(){
if (FOCUS.on || !target.shown) return;
try { if (Math.abs(_offFwd()) > 1) target.yaw = fwdYaw(); } catch {} // (forward, as the double click turns it first: the chip has no double)
FOCUS.on = true; FOCUS.fs = false; document.body.classList.add('focus');
if (window.__fieldFabric) window.__fieldFabric.visible = false; // (and the far field's picture of the boards past the tiles: none either)
if (!_focusCover){ _focusCover = document.createElement('div'); _focusCover.id = 'focusCover';
Expand Down Expand Up @@ -14035,7 +14036,17 @@
if (L && L.length){ _toolBarLast = { app: a, L }; }
else if (_toolBarLast && _toolBarLast.app === a) L = _toolBarLast.L.map(q => ({ ...q, on: false, dim: true, idle: true }));
else _toolBarLast = null;
const sig = L && L.length ? L.map(q => q.glyph + '|' + (q.title || '') + (q.on ? '+' : '') + (q.dim ? '-' : '') + (q.idle ? '~' : '')).join(',') : '';
/* A FULL SCREEN CHIP, WHERE THE DOUBLE CLICK IS THE GAME'S (Dec 1, "What's next", then "1 3": "A full-screen button … for games that keep the
double click for themselves"). A game that takes the double click for its own play (`noDoubleTap()` saying so now, as Sudoku, Simon,
Lights Out and Whack-a-mole do while a board is in play, or an editor while it is open; or `onDoubleTap`) cannot reach THE BOARD YOU ARE ON, FULL SCREEN by it, so the field puts one
chip of its own at the end of the game's ring: ⛶, pressed (draw's gold) while the board is full screen; a press goes in or comes back. It is
the field's, not the game's (`field`), so the game's own chips keep their numbers. The labs, with their own view, and the games whose double
click is the field's have none. */
let _dblGame = false; try { _dblGame = !!(a && (a.onDoubleTap || (a.noDoubleTap && a.noDoubleTap()))); } catch {}
// (shown while the double click is the game's now, and while the board is full screen, so there is always a way back)
if (a && f && !a.soloOnDouble && (_dblGame || FOCUS.on)){
L = (L || []).concat([{ glyph: '⛶', title: FOCUS.on ? 'Leave full screen' : 'This board full screen', on: FOCUS.on, field: 'focus' }]); }
const sig = L && L.length ? L.map(q => q.glyph + '|' + (q.title || '') + (q.on ? '+' : '') + (q.dim ? '-' : '') + (q.idle ? '~' : '') + (q.field || '')).join(',') : '';
if (sig === _toolBarSig) return;
_toolBarSig = sig;
const ring = document.getElementById('gameBar'); if (!ring) return;
Expand All @@ -14046,12 +14057,13 @@
L.forEach((q, i) => { const b = document.createElement('button'); b.type = 'button'; b.className = 'panel chip tchip'; b.dataset.i = i;
b.addEventListener('click', e => { e.stopPropagation();
if (b.dataset.idle === '1') return; // (a button kept while its game gives none: nothing to do)
if (b.dataset.field === 'focus'){ if (FOCUS.on) focusClose(); else focusOpen(); _toolBarSig = null; try { toolBarTick(window.getFieldApp && window.getFieldApp()); } catch {} try { restWake(); } catch {} return; }
try { const a2 = window.getFieldApp && window.getFieldApp(), f2 = bbFramedCell(); if (a2 && a2.onToolTap && f2) a2.onToolTap(f2.c, f2.r, +b.dataset.i); }
catch (err){ _reportError('tool bar', err); }
_toolBarSig = null; try { toolBarTick(window.getFieldApp && window.getFieldApp()); } catch {} try { restWake(); } catch {} });
ring.appendChild(b); old.push(b); }); }
L.forEach((q, i) => { const b = old[i]; b.textContent = q.glyph; b.title = q.title || ''; b.setAttribute('aria-label', b.title);
b.setAttribute('aria-pressed', q.on ? 'true' : 'false'); b.classList.toggle('dim', !!q.dim); b.dataset.idle = q.idle ? '1' : ''; });
b.setAttribute('aria-pressed', q.on ? 'true' : 'false'); b.classList.toggle('dim', !!q.dim); b.dataset.idle = q.idle ? '1' : ''; b.dataset.field = q.field || ''; });
try { window.__gameRing && window.__gameRing.layout(); } catch {}
}
let _bbQuickSig = null;
Expand Down
25 changes: 25 additions & 0 deletions tests/part5.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2098,6 +2098,31 @@ const game = { title: 'Words', size: l => 5 + Math.ceil(l / 2),
console.log(`${ok ? 'ok ' : 'FAIL'} ${id}, a double click on the board you are on shows it full screen: ${on.on ? 'on' : 'off'}, the menu ${on.menu}; taps reaching the game ${taps}; ${id === 'tetris' ? 'Escape' : 'a double click'} back: ${off.on ? 'still on' : 'off'}`);
}

// (Dec 1, "1 3": a full screen chip where the double click is the game's): Sudoku in play keeps its double clicks, so the ring carries the field's
// ⛶; a real press shows the board full screen (the chip pressed), a real tap on the board is still Sudoku's, and the chip again brings it back;
// checkers, whose double click is the field's, has no such chip
{
current = 'sudoku';
await page.evaluate(() => window.setFieldApp(window.FIELD_APPS.find(a => a.id === 'sudoku')));
await drawn(page, 2500); await page.evaluate(() => window.__settle());
let p = await page.evaluate(() => window.__aim(9, 4, 4)); await page.mouse.click(p.x, p.y); await drawn(page, 1200);
const chip = () => page.evaluate(() => { const b = [...document.querySelectorAll('#gameBar > .tchip')].find(x => x.dataset.field === 'focus'); if (!b) return null; const r = b.getBoundingClientRect();
return { x: r.x + r.width / 2, y: r.y + r.height / 2, on: b.getAttribute('aria-pressed') === 'true', seen: r.width > 0 }; });
let c = null; for (let k = 0; k < 12 && !(c && c.seen); k++){ c = await chip(); if (!(c && c.seen)) await drawn(page, 400); }
const out = { live: await page.evaluate(() => !!window.getFieldApp().noDoubleTap()), chip: !!(c && c.seen) };
if (c && c.seen){ await page.mouse.click(c.x, c.y); await drawn(page, 2000); out.on = await page.evaluate(() => window.fieldFocus.on); out.pressed = (await chip() || {}).on;
await page.evaluate(() => { const A = window.getFieldApp(); window.__taps = 0; window.__tapOrig = A.onCellTap; A.onCellTap = function(...a){ window.__taps++; return window.__tapOrig.apply(this, a); }; });
p = await page.evaluate(() => window.__aim(9, 5, 5)); await page.mouse.click(p.x, p.y); await drawn(page, 800);
out.taps = await page.evaluate(() => { window.getFieldApp().onCellTap = window.__tapOrig; return window.__taps; });
const c2 = await chip(); if (c2) await page.mouse.click(c2.x, c2.y); await drawn(page, 1500); out.off = await page.evaluate(() => !window.fieldFocus.on); }
current = 'checkers';
await page.evaluate(() => window.setFieldApp(window.FIELD_APPS.find(a => a.id === 'checkers'))); await drawn(page, 2000);
out.checkers = !(await chip());
const ok = out.live && out.chip && out.on && out.pressed && out.taps >= 1 && out.off && out.checkers;
if (!ok) failures.push('[full screen chip] ' + JSON.stringify(out));
console.log(`${ok ? 'ok ' : 'FAIL'} the full screen chip: Sudoku in play carries it (${out.chip}), a real press shows the board full screen (${out.on}, pressed ${out.pressed}), a tap still Sudoku's (${out.taps}), pressed again back (${out.off}); checkers without it (${out.checkers})`);
}

} catch (e){
failures.push(`[${current}] ${e.message}`);
}
Expand Down