Skip to content

fix(#609): embedding level — tap-to-group (mobile-playable)#610

Merged
atlas-apex merged 1 commit into
devfrom
fix/GH-609-embedding-mobile
Jun 9, 2026
Merged

fix(#609): embedding level — tap-to-group (mobile-playable)#610
atlas-apex merged 1 commit into
devfrom
fix/GH-609-embedding-mobile

Conversation

@atlas-apex

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes the Embeddings level being unplayable on mobile. It used free-form drag of a word from a bottom tray up into a tall 2D plane — on a phone the plane is a near-empty scroll area (faint cluster zones invisible), the tray sits far below, and 2D drag-positioning doesn't work with touch+scroll.
  • New mechanic: tap-the-meaning-group. One .cut-card per word with three tappable buttons (🐾 Animals / 🍎 Fruits / 🚗 Vehicles), mirroring the mobile-proven levelCutoff pattern and reusing its .cut-* styling (so it inherits the existing mobile breakpoints — zero new CSS). Tap a group → submit (gated until all 9 picked) → reveal right/wrong per word + the correct group → showResult. Score = correct groups ÷ 9 × 100.
  • Same lesson, clearer delivery — "similar meanings cluster together" is now a direct grouping task instead of a fiddly 2D placement; the takeaway copy (puppy↔dog, semantic search, RAG) is unchanged.
  • Removed the now-dead .emb-* / .cluster-* CSS (including the two @media rules that propped up the old plane) — net −138 lines.

Testing

  1. node --check on the inline script — clean; LEVELS still 11.
  2. On a ~360–390px phone (and desktop): the Embeddings level renders a list of word cards, each fully tappable; picking all 9 enables "Check grouping"; submit reveals correct/incorrect and routes to the result. No horizontal scroll, no dragging.
  3. No regression to other levels (only level2 + its dead CSS touched).

Closes #609


Glossary

Term Definition
Tap-to-pick Touch-native interaction (tap a choice) replacing drag — the pattern the Knowledge-cutoff level already uses.
.cut-* The shared card/pick-button CSS (card, question, pick buttons, verdict) this level now reuses.
Embedding A model's mapping of text to points in space where similar meanings sit close — the concept this level teaches.

…p (mobile)

The Embeddings level used free-form drag of a word from a bottom tray into a tall
2D plane — unplayable on a phone (invisible cluster zones, tray far below the drop
area, 2D drag doesn't work with touch+scroll). Replaced the mechanic with a
tap-the-meaning-group picker: one card per word + Animals/Fruits/Vehicles buttons,
mirroring the mobile-proven levelCutoff pattern and reusing its .cut-* styling.
Same lesson (similar meanings group together), no dragging; score = correct
group per word. Removed the now-dead .emb-*/cluster-* CSS (incl. the @media rules).
JS node --check clean; LEVELS still 11.

Closes #609

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@atlas-apex atlas-apex left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: PR #610

Commit: 2ecbe380ce9591876d721dbc24e3bf6b19b7dd8d

Posted as a comment (cannot self-approve own PR). Verdict is APPROVED — Rex approval marker written.

Summary

Rewrites the Embeddings level (level2) in site/game.html from a free-form drag-into-2D-plane mechanic (unplayable on touch+scroll phones) to a tap-to-group picker cloned from the existing mobile-proven levelCutoff pattern, reusing its .cut-* styling. Removes the now-dead .emb-* / .cluster-* CSS and its two @media rules. Net +64/−202.

Checklist Results

  • ✅ Architecture & Design: Pass — reuses an existing, proven in-file pattern; no new abstraction
  • ✅ Code Quality: Pass
  • ✅ Testing: Pass — static site; node --check is the gate (clean)
  • ✅ Security: Pass — no auth/secrets/input-trust surface
  • ✅ Performance: Pass
  • ✅ PR Description & Glossary: Pass — Summary + Testing + Glossary all present, narrative bullets
  • ⚠ Summary Bullet Narrative: Pass — bullets carry what + why
  • ✅ Technical Decisions (AgDR): N/A — clones an existing level pattern, no new decision
  • ✅ Adopter Handbooks: N/A — no handbook triggers on a static HTML/inline-JS diff (migration-safety is blocking but matches no migration paths here)

Verification performed

  • Syntax: extracted the single inline <script> and ran node --check → clean.
  • Registry intact: LEVELS still has 11 entries; level2 still registered with its slide; foot text updated to the tap wording (Tap the meaning group each word belongs to.).
  • Completable + correct scoring: 9 word-cards (dog/cat/wolf, apple/banana/grape, car/truck/bicycle, shuffled), 3 pick buttons each. Submit is disabled until Object.keys(choice).length === WORDS.length. choice is keyed by the WORDS.forEach index i, and submit iterates list.children with the same index (children appended in the same order) — no off-by-one. got = choice[i] is guaranteed defined at submit time by the gate, so pickBtns[got] cannot be undefined — no crash. Score = Math.round(correct/9*100), writes state.levelScores[state.level] (same shape as every other level), calls addScore + showResult.
  • Class reuse is real: .cut-list/.cut-card/.cut-q/.cut-btns/.cut-pick(.sel/.right/.wrong/.truth)/.cut-verdict all still defined (lines 561–580) and live — levelCutoff (line 2269) uses the same set. The right+truth class composition on a correct pick is harmless (border/bg vs inset shadow).
  • Dead CSS genuinely gone: only remaining .emb-*/.cluster-* textual match is the removal comment; the new code's "cluster" prose is incidental. The dragify helper is NOT orphaned — still used by the prompt-builder level (line 1434).
  • Flow intact: hintBtn/footnote/skipBtn are global; skip is wired once to skipLevel() and re-shown per render, level2 sets the updated hint copy. Skip still works.
  • Scope clean: 5 diff hunks, all level2 + its dead CSS — no collateral edits to other levels.
  • Bookkeeping: PR body has Summary + Testing + Glossary; Closes #609 (verified OPEN); HEAD SHA matches.

Issues Found

None.

Suggestions

None blocking. Sound fix-forward.

Verdict

APPROVED


🤖 Reviewed by Rex (Code Reviewer Agent)
📌 Reviewed commit: 2ecbe380ce9591876d721dbc24e3bf6b19b7dd8d

@atlas-apex atlas-apex merged commit 583e8a6 into dev Jun 9, 2026
7 checks passed
@atlas-apex atlas-apex deleted the fix/GH-609-embedding-mobile branch June 9, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants