8000 perf: menus that show at once, one layout rule for every screen by alexiscolin · Pull Request #1 · alexiscolin/gnogolf · GitHub
[go: up one dir, main page]

Skip to content

perf: menus that show at once, one layout rule for every screen - #1

Merged
alexiscolin merged 35 commits into
mainfrom
ui-speed
Nov 25, 2026
Merged

alexiscolin merged 35 commits into
mainfrom
ui-speed

Conversation

@alexiscolin
Copy link
Copy Markdown
Owner

Menus that show at once, and the same layout rules on every screen.

Faster

  • Gnome portraits on cards are pictures (web/public/portraits/, made by the game's own renderer), not one WebGL scene each. Live 3D stays where a gnome moves (the picker), with its picture under it until the first frame.
  • The 90 course holes' maps are built from data/holes.txt at build time (course.json, 46 KB gzipped). A map is used only when the chain's hash of the hole's data matches the file's, so a republished hole never shows old lanes. Community maps are kept in the browser by id (versioned, checked when read back, 300 at most).
  • The Builder's start no longer waits for builder.wasm; it loads in the background and is awaited only to check, test or publish. If it fails, the screen says so with a retry.
  • The title warms what the next screens show, in idle moments: it holds only for the first screen's pictures when they are not in yet (2 s more at most), and everything else waits for idle time. Warm-ups stop when a round starts, skip on Save-Data or 2G, and never fetch the Builder on a phone.
  • Placeholders keep their final size, pulse in the cup's colours one after the other, and fade in. A map that fails stops pulsing.

Production build, 4x CPU, 120 ms a request, two visits (ms):

before after
Menu 141–150 17–29
Duel, gnomes and maps 1474–1483 93–105
Duel, whole 1479–1494 497–665
Builder start, cold 1929–1938 786–1513

Screens

  • Duel: "Yourself" has its own card (your gnome, no empty disc); "Or anyone who played" shows six tiles on the picks' grid, no inner scrollbar; a surprise never repeats the last player.
  • Builder start: building a hole comes first with one gold call to action; hole cards are shorter with Play, Export and Delete on one line; reward cards align and clamp to two lines.
  • Every menu screen: the head in the same place, the body centred, the same fade where content meets the frame's top and bottom.
  • The network, Feedback and Support chips show in a round only; Feedback joins Support in the About sheet.

Checked

  • SKIP_GNO=1 scripts/check.sh: all green, 1238 tests (new ones for the map cache, the course-map hash match, idle cancel, the phone gate and the rival picks' cache).
  • scripts/e2e-builder.sh: 211 passed.
  • Screens at 1440x900, 1280x800 and 390x844 before and after.

The 90 course holes' maps are made from data/holes.txt before dev and build (public/maps/course.json, 46 KB gzipped) and drawn with no read of the chain. Any other version's map is read once and kept in the browser's Cache under its id.
Cards show a picture of the gnome (public/portraits, drawn by media/gnomes/portraits.mjs) where each ran a WebGL scene: the menu's panels, the Duel's picks, the Builder's sign. The picker and the win card keep the live gnome, over his picture until the first frame. A pick's hole draws from the site's map at once, the ghost's path over it once replayed. Yourself is a card of its own (no empty map), the board's six first players are the cups' tiles on the picks' three columns, with no box that scrolls. A menu screen centres its content in its frame and fades what scrolls under its foot the same way everywhere.
The start screen no longer waits for builder.wasm: it loads behind it and is awaited where it runs (a draft's state, a file, a published hole, the editor). The sign carries the one gold button, Build a new hole, beside its world; the templates and your holes follow, on shorter cards with their links on one baseline, the badges all from their top.
In idle moments: the course's maps, the gnomes' pictures, the community's first maps, and builder.wasm on a computer only.
The course's maps and the gnomes' pictures are fetched beside the game. Click to start waits for them only while they are not in, 2 s past the game at most; then they finish behind it. builder.wasm stays an idle prefetch, on a computer only.
The start showed for a frame ahead of a first run's hole, and empty ahead of a player's drafts.
On the menu, in idle moments: the Duel's picks and their bests (kept a minute), so it opens with its gnomes and its holes' lanes. On a computer only, after builder.wasm: the Builder's page and its screens' code.
Fetched at the title it took the link from the game's own start: a first visit's title went from 3 s to 14 s and more on a slow link.
@netlify
netlify Bot commented Nov 25, 2026 •
Copy link
Copy Markdown

✅ Deploy Preview for gno-golf ready!

Name Link
🔨 Latest commit 922a839
🔍 Latest deploy log https://app.netlify.com/projects/gno-golf/deploys/6b066501c1420008b6295b02
😎 Deploy Preview https://deploy-preview-1--gno-golf.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@alexiscolin alexiscolin changed the title Menus that show at once, one layout rule for every screen perf: menus that show at once, one layout rule for every screen Nov 25, 2026
@alexiscolin
alexiscolin merged commit f082e41 into main Nov 25, 2026
5 checks passed
@alexiscolin
alexiscolin deleted the ui-speed branch November 25, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0