Skip to content

Render Tree and Terrain verbatim against fixture data #9

Description

@Dillpickleschmidt

Part of #1

Question

Get mindwalk's two scenes rendering inside apps/web against fixture data, before any adaptation. This is the known-good baseline everything else is judged against.

Copy near-verbatim from .repos/mindwalk/web/src, under the MIT notice:

  • scene/ — CityScene.tsx (638), TreeScene.tsx (656), treeLayout.ts (169), sceneUtils.ts (144), dirLabels.ts (145), trail.ts (79), textures.ts (60)
  • playback/ — reducer.ts, recorder.ts (251 total)
  • types.ts (271)

Do not copy App.tsx (876), state/ (123), or api/ (74) — that is mindwalk's shell talking to its Go server, and T3 has its own. Do not copy styles.css wholesale; styling is the next ticket.

Why verbatim. This code is where mistranslation renders almost right — squarified rect math, instanced-mesh buffer indexing, coordinate conventions, colour-space handling. Those cost days to bisect. A mistranslated shell just fails to compile.

Set-up constraints from charting: three.js + react-three-fiber, lazy-loaded as its own chunk, frameloop="demand" by default with a continuous loop only while playback runs. There are no 3D dependencies in the repo today, so this ticket adds them.

Reference to compare against: a local mindwalk serve renders the same repo. Compare screenshot by screenshot — Tree and Terrain both, they have equal billing. Fixture data can come from GET /api/sessions/<key>/citymap and /trace on that instance, or from the citymap service once it lands.

Resolved when both views render this repo's citymap in T3's web app and visibly match the reference.

Activity

  1. Dillpickleschmidt commented on Aug 1, 2026

    @Dillpickleschmidt
    OwnerAuthor

    Resolution

    Both scenes render this repo's citymap inside the T3 web app and visibly match a live mindwalk serve reference. Landed on branch feat/3d-scenes-verbatim.

    T3 web app mindwalk reference (?map=1)
    Terrain t3 terrain ref terrain
    Tree t3 tree ref tree

    Same structure, palette, labels, and camera behavior in both views. The T3 side has no HUD, timeline, or repo header — that chrome is Restyle the ported UI to T3 conventions scope.

    What landed

    • Copy — scene/ (all seven files), playback/ (both files), and types.ts into apps/web/src/mindwalk/, preserving relative structure so imports survived unchanged. MIT attribution in apps/web/THIRD_PARTY_NOTICES.md plus a provenance README in the directory. App.tsx, state/, api/, and styles.css were not copied, per the ticket.
    • Deviations from verbatim (all behavior-preserving): ~20 non-null assertions and 2 casts forced by this repo's noUncheckedIndexedAccess + exactOptionalPropertyTypes (mindwalk compiles without either), and the repo's pre-commit vp fmt autoformat. Everything erases at runtime.
    • Deps — three@^0.182.0 (mindwalk's exact minor) + @types/three.
    • Harness — a throwaway /mindwalk-3d?threadId=<id> route. React.lazy splits three.js and the scenes into their own chunk; the citymap comes from GET /api/citymap/threads/:threadId via PrimaryEnvironmentHttpClient. No trace yet, so playback is permanently empty and CityScene runs locHeights — exactly mindwalk's ?map=1 static-map mode, which is also what the reference screenshots use.
    • Two load-bearing CSS rules (.city-scene fill, .scene-tip chip) copied into a scoped harness.css; the 2,452-line styles.css stays untouched for Restyle the ported UI to T3 conventions #10.

    Surprise worth recording

    The map's standing decision said "three.js + react-three-fiber", but mindwalk does not use react-three-fiber — its scenes are plain three.js components driving their own requestAnimationFrame loops (auto-rotate, damping, label easing). So no r3f was added, and the frameloop="demand" constraint doesn't map onto anything as-is. Of the three charting constraints: lazy chunk done, the other two now mean pausing mindwalk's own rAF loops when the tab is hidden or the surface inactive — sharpened in the map's fog.

    Verification notes

    • Verified via Playwright headless Chromium against a vp run dev --home-dir .t3 stack seeded with a snapshot of real userdata (the t3-code preview MCP surface was down; snapshot/evaluate failed even on about:blank).
    • Thread used: one rooted at /home/dylank/Projects/t3code, so both sides mapped the identical tree.
    • pnpm typecheck clean in apps/web.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions