upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorsyfyra <258908070+syfyra@users.noreply.github.com>2026-11-26 11:08:00 +0100
committersyfyra <258908070+syfyra@users.noreply.github.com>2026-11-26 11:08:00 +0100
commit393dab2e73473e232e1dc7f42eef70d4f4d1790d (patch)
treec6f143b008f3969f110d83c33be3535519811ebf /tests
parenta73a57e1339be072baf5522351c8ec7f1482b56b (diff)
viewer: slow flight on C instead of Ctrl (VIEWER-SLOW-KEY-CTRL-W)
The help line offered Ctrl as the slow modifier for W A S D and Q/E, but with a movement key held Ctrl makes a browser shortcut: Ctrl+W closes the tab (a page cannot cancel it in Chromium or Firefox), Ctrl+S and Ctrl+D open the save-page and bookmark dialogs and Ctrl+E moves the focus to the address bar. The keydown handler leaves modified keys to the browser, so slow flight forward lost the whole viewer, and every other slow direction left the page. Slow is now the C key, which no browser binds. Ctrl leaves the speed alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_viewer_streaming.cjs12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/test_viewer_streaming.cjs b/tests/test_viewer_streaming.cjs
index 8248181d8..5643c7c01 100644
--- a/tests/test_viewer_streaming.cjs
+++ b/tests/test_viewer_streaming.cjs
@@ -374,7 +374,11 @@ test('the bounds overlay creates helpers on the first G press and reuses them',
374 helpers.forEach((helper, i) => assert.equal(boundsGroup.children[i], helper)); 374 helpers.forEach((helper, i) => assert.equal(boundsGroup.children[i], helper));
375}); 375});
376 376
377test('Shift speeds the camera up and Ctrl slows it down, on either side of the keyboard', async () => { 377test('Shift (either side) speeds the camera up and C slows it down; Ctrl does not, and the help says so', async () => {
378 // With a movement key held, Ctrl makes browser shortcuts a page cannot all cancel: Ctrl+W closes the tab.
379 const help = html.match(/<div id="help">([\s\S]*?)<\/div>/)[1];
380 assert.match(help, /<kbd>C<\/kbd> slow/);
381 assert.doesNotMatch(help, /Ctrl/);
378 class Vector3 { 382 class Vector3 {
379 constructor(x = 0, y = 0, z = 0) { Object.assign(this, { x, y, z }); } 383 constructor(x = 0, y = 0, z = 0) { Object.assign(this, { x, y, z }); }
380 set(x, y, z) { return Object.assign(this, { x, y, z }); } 384 set(x, y, z) { return Object.assign(this, { x, y, z }); }
@@ -432,8 +436,10 @@ test('Shift speeds the camera up and Ctrl slows it down, on either side of the k
432 close(climb(), 4); 436 close(climb(), 4);
433 close(climb('ShiftLeft'), 20); 437 close(climb('ShiftLeft'), 20);
434 close(climb('ShiftRight'), 20); 438 close(climb('ShiftRight'), 20);
435 close(climb('ControlLeft'), 0.8); 439 close(climb('KeyC'), 0.8);
436 close(climb('ControlRight'), 0.8); 440 close(climb('ShiftLeft', 'KeyC'), 4);
441 close(climb('ControlLeft'), 4);
442 close(climb('ControlRight'), 4);
437 // A wheel changes the speed by 1.15 per notch; a sideways scroll (a trackpad pan, deltaX only) must not. 443 // A wheel changes the speed by 1.15 per notch; a sideways scroll (a trackpad pan, deltaX only) must not.
438 // A wheel changes the speed by 1.15 per notch; a sideways scroll (a trackpad pan, deltaX only) must not. 444 // A wheel changes the speed by 1.15 per notch; a sideways scroll (a trackpad pan, deltaX only) must not.
439 const wheel = handlers.get('wheel'); 445 const wheel = handlers.get('wheel');