You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TrailView: the road meshes wait 4 s after a warm open on the phone (minor, optional) #3796
Priority: minor and optional. This can stay as it is. Fix it only if the owner sees the pop in the phone session of #3656 and finds it disturbing.
Related: #3656 (the phone tier), #3795 (the fix of waitForIdle() that found this).
What a rider sees
On the phone (tier=phone) with ground=plan, after a warm open (the device cache holds the view), the road near the eye draws plain for up to 4 s. Then its detailed surface (the plan's road meshes) appears. The rest of the view is correct.
Why
After a frame in which a mesh cell rests on a page coarser than level 17, the meshes draw again only after CALM (120) calm frames (meshLevel in plan/pieces.ts). The wait stops the meshes from flickering on and off when the terrain is at the edge of level 17.
On the phone, the half-size terrain pool (terrainShare: 0.5) leaves pages out while it fills, so the first frames of a load rest, and the count starts again.
CALM counts frames. At 30 fps the wait is 4 s; on the desktop at 60 fps it is 2 s.
With a warm cache, the rest of the view is ready after about 2.3 s, so the wait shows.
The desktop is not affected: with the full pool, the first frames of a load do not rest (warm runs: 0 bad of 6).
Possible changes
Count the meshes' wait in seconds (about 2 s), not in frames, so that the frame rate does not change it. CALM is also the calm before the terrain's quality rises (terrain.ts); decide if that one moves too.
Optional: do not start the wait for the rests at the start of a load, where no flicker can occur.
Done when
On the phone tier with a warm cache, the near road meshes draw within about 2 s of the open, and they do not flicker at the edge of level 17.
npx vitest run src/lib/trailview and npm run check pass in builder/web.
Activity