fix: polish pass for traffic, nav, icons, contact email reveal and dashcam robustness

This commit is contained in:
2026-10-11 15:11:44 +03:00
parent ca12cfda44
commit 1326cee886
49 changed files with 809 additions and 226 deletions

View File

@@ -1,6 +1,7 @@
import { describe, expect, it } from 'vitest';
import { SceneResourceBag } from '@/scene/resources';
import {
MILESTONE_FLASH_MAX_RATE,
createMilestones,
MILESTONE_FAR_Z,
MILESTONE_NEAR_Z,
@@ -100,6 +101,24 @@ describe('mile marker mesh', () => {
resources.dispose();
});
it('does not flash posts swept past by a navigator jump or a fling', () => {
const resources = new SceneResourceBag();
const markers = createMilestones(resources, true);
// A navigator long-scroll crosses the whole chapter in about 0.6 s.
let peak = 0;
for (let frame = 0; frame <= 36; frame += 1) {
markers.update('experience', frame / 36, 0, 1 / 60);
peak = Math.max(peak, ...markers.flashes());
}
expect(peak).toBe(0);
// Parked, then a single wheel tick at reading pace still flashes the post it crosses.
for (let i = 0; i < 90; i += 1) markers.update('experience', passPoint(3, 4) + 0.01, 0, 1 / 60);
markers.update('experience', passPoint(3, 4) - 0.01, 0, 1 / 60);
expect(markers.flashes()[3]).toBe(1);
expect(MILESTONE_FLASH_MAX_RATE).toBeGreaterThan(0.5);
resources.dispose();
});
it('never flashes on the low tier or touch', () => {
const resources = new SceneResourceBag();
const markers = createMilestones(resources, false);