feat: experimental 3D controller configurator (behind flag) - #412
Open
ryanmagoon wants to merge 4 commits into
Open
feat: experimental 3D controller configurator (behind flag)#412ryanmagoon wants to merge 4 commits into
ryanmagoon wants to merge 4 commits into
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Install the CloudAI-X threejs-skills (.claude/skills/threejs-*) for 3D guidance, and add three, @react-three/fiber, and @react-three/drei to @gamelord/ui to support a 3D controller view. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vitest 4's happy-dom environment installs a file-backed localStorage stub missing getItem/removeItem/clear, breaking any code under test that touches localStorage (5 ui + 21 desktop failures surfaced by the dep-bump lockfile churn). Install a spec-compliant in-memory Storage in both package test setups, reset between tests. Also cast the useGamepad test mock through unknown — the updated lib.dom Gamepad type no longer overlaps the partial mock. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a staged 3D Super Nintendo controller to the Controllers settings tab, gated behind a new gamelord:experimental:controller3d flag (toggled from Settings > General > Experimental). - Controller3D: react-three-fiber canvas with key/fill/rim lighting, IBL, contact shadow, and orbit controls. Presentational and Storybook-able. - SnesController: procedurally modeled from primitives — wide/thin dog-bone shell with rounded ends, domed face buttons in an angled well, cross d-pad, angled Start/Select pills, shoulder bumpers. Per-button emissive highlight and press-depth, wired for future live buttonStates. - useExperimentalFlag: localStorage-backed flag hook (gamelord:experimental:*). - Storybook stories for staged/static/highlighted states. - oxlint: scope-disable react/no-unknown-property for r3f JSX intrinsics. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rebuild the 3D controller from primitives into a realistic model: - extruded dog-bone (stadium) shell with smooth welded normals and real proportions, replacing the rounded-box body - domed face-button caps (lathe profile) in dark socket rings - beveled extruded d-pad cross in a circular recess - Select/Start pills on angled recessed track plates - cable strain-relief boss and cord off the top edge - softer key light + moderated gloss so cap colors read instead of washing out; higher default camera for a proper hero angle Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ryanmagoon
force-pushed
the
feat/controller-3d-configurator
branch
from
July 12, 2026 03:28
a06437f to
cd953d3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Spikes a 3D controller configurator behind an experimental feature flag, as a foundation toward #81. When the flag is on, a staged, orbitable 3D Super Nintendo controller renders above the existing 2D mapping UI in Settings → Controllers. The proven 2D mapping UI is untouched — the 3D view is purely additive.
Toggle it from Settings → General → Experimental → "3D controller view" (persisted as
gamelord:experimental:controller3d).What's included
Controller3D— a react-three-fiber canvas (key/fill/rim lighting, studio IBL, contact shadow, orbit controls). Presentational and Storybook-able; zero IPC /window.gamelordcoupling.preserveDrawingBufferis on so the canvas is screenshottable.SnesController— the controller modeled procedurally from primitives, with per-button emissive highlight + press-depth already wired to ahighlightedButtonsprop (ready for livebuttonStatesin a follow-up).useExperimentalFlag— a small localStorage-backed flag hook establishing thegamelord:experimental:*convention (no flag infra existed before).react/no-unknown-property); a happy-domlocalStoragepolyfill in both test setups (vitest 4's stub lacksgetItem/removeItem/clear, which the dep bump surfaced as 26 failures) and aGamepadtest-mock cast fix.Status / honesty
This is a spike, not the finished feature. The procedural model is a first-pass placeholder — proportions and framing need work (the capture below is at an unflattering near-edge-on angle). The plan is to swap in a license-vetted realistic
.glband wire per-button mesh highlighting + the click-to-assign flow described in #81 as follow-ups.Procedural first-pass fallback (placeholder, framing/proportions WIP). Verify it live via Storybook:
Components/Controller3D.Testing
pnpm typecheck✅pnpm lint✅pnpm --filter @gamelord/ui test✅ (21 files / 325 tests)pnpm --filter @gamelord/desktop test✅ (32 files)Relates to
Partial progress toward #81 (staged 3D foundation + flag). Realistic model and click-to-assign remain.
🤖 Generated with Claude Code