Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
src/guest-names.ts gives each anonymous viewer a tasteful colour-and-animal name, stable per browser, never held by two at once - module and test only #311
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
I added Software/so101/src/guest-names.ts and its test, with no wiring into the page or lobby and forge.json untouched. The new tests pass (5 of 5). I did not run the type check, and I did not run the rest of the suite.
shipped merged
Module and test only, as the issue asked. nameFor is deterministic (FNV-1a start in a 16x16 colour/animal grid), skips names in use, and only numbers a name once all 256 are taken. It takes no input beyond a string and has no I/O, no dependencies, and no dead code. The tests cover stability, the in-use skip, the last free name, list membership, hex colour and the full-grid case. There is nothing to see in the preview, since nothing is wired in yet.
Two things I would do next:
- When the module is wired into /live, pass the names currently held by connected viewers as inUse. Show the name as text next to the dot, so the colour is never the only signal for screen readers or colour-blind viewers.
- Add a test for the numbered fallback when "X 2" is also taken (it should give "X 3"). The loop handles it but nothing proves it.
I added
Software/so101/src/guest-names.tsand its test, with no wiring into the page or lobby andforge.jsonuntouched. The new tests pass (5 of 5). I did not run the type check, and I did not run the rest of the suite.bun installfailed in the sandbox with a read-only temp directory, sonode_modulesis missing andtschas no types to check against. The forge's check will run both on this push.nameFor(browserId, inUse)returns{ name, colour }. The name is a colour plus an animal ("Teal Heron", "Amber Fox") from curated lists of 16 colours and 16 animals.colouris the hex for the dot.inUsealways gets the same name.The tests cover stability, two ids getting different names, every name coming from the lists, a hex colour for the dot, and the grid being full or one name short.
🤖 Generated with Claude Code
Closes #290