cockpit: fork GeoHelix from BodyHelix — isolate the map/terrain renderer#92
Conversation
The map scenes (/geo, /ice, /garmin/:location) were sharing BodyHelix.tsx with the /helix anatomy body, branching internally via pathScene()/isGeoScene/uGeo. That means map-shader work (incoming: hypsometric tint, kurvenlineal brightness, sunset lighting, Ice/Ocean specular) would risk regressing the working anatomy body — the "already amazing" /helix. Fork GeoHelix.tsx as a verbatim copy of BodyHelix (exactly as BodyHelix itself was forked from BodyV3 to protect /body, #64) and repoint the three map routes to it. /helix stays on BodyHelix, now completely untouched by any future geo work. Same BSO2 decoder + per-vertex helix-normal Gouraud shading; GeoHelix still resolves scenes via pathScene() from the path. Behaviourally a no-op today (GeoHelix is a byte-for-byte copy, so /geo /ice /garmin render identically) — this is the isolation scaffold the map-shader improvements land on. tsc --noEmit clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012jEwwaT5JZ5x8qWvcnaMYC
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_61cc0540-9ab7-4402-90fa-c34f1dd4cd1d) |
📝 WalkthroughWalkthroughIntroduces ChangesGeoHelix Viewer
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Router as main.tsx Router
participant GeoHelix
participant fetchSoa
participant Decoder as decode/decodeGrid
participant Mount as mount()
Router->>GeoHelix: navigate to /geo, /ice, or /garmin/:location
GeoHelix->>fetchSoa: request bake for resolved scene
fetchSoa->>fetchSoa: read /body.manifest.json, resolve bake name
fetchSoa->>fetchSoa: fetch + inflate bytes
fetchSoa-->>GeoHelix: return raw bake buffer
GeoHelix->>Decoder: decode(buffer) or decodeGrid(buffer)
Decoder-->>GeoHelix: positions, normals, colors, index, concepts
GeoHelix->>Mount: mount(geometry data)
Mount->>Mount: build Three.js scene, shaders, LOD polling
Mount-->>GeoHelix: render loop active
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cockpit/src/GeoHelix.tsx (1)
243-375: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftExtract the shared BSO2 decoder
decodeGrid,decode,HALF_LUT, the Signed360 helpers, andconceptColorare duplicated incockpit/src/BodyHelix.tsxandcockpit/src/GeoHelix.tsx. Pull the pure decode path into a shared module so future bake-format changes only land once and both viewers stay in sync.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cockpit/src/GeoHelix.tsx` around lines 243 - 375, The BSO2 decode logic is duplicated between GeoHelix and BodyHelix, so future bake-format changes will drift; extract the shared pure decoder into a common module and have both viewers call it. Move the shared pieces from decode, decodeGrid, HALF_LUT, the Signed360 helpers, and conceptColor into one reusable implementation, then keep GeoHelix and BodyHelix as thin wrappers that only handle view-specific behavior. Ensure the shared decoder still returns the same Decoded shape and preserves the version-specific handling already in decode.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@cockpit/src/GeoHelix.tsx`:
- Around line 243-375: The BSO2 decode logic is duplicated between GeoHelix and
BodyHelix, so future bake-format changes will drift; extract the shared pure
decoder into a common module and have both viewers call it. Move the shared
pieces from decode, decodeGrid, HALF_LUT, the Signed360 helpers, and
conceptColor into one reusable implementation, then keep GeoHelix and BodyHelix
as thin wrappers that only handle view-specific behavior. Ensure the shared
decoder still returns the same Decoded shape and preserves the version-specific
handling already in decode.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 541b8336-b1f1-42ed-ae4f-b070ce4d4ff7
📒 Files selected for processing (2)
cockpit/src/GeoHelix.tsxcockpit/src/main.tsx
Isolation scaffold so incoming map-shader work can't regress the working anatomy body.
The map scenes (
/geo,/ice,/garmin/:location) were sharingBodyHelix.tsxwith the/helixanatomy body, branching internally viapathScene()/isGeoScene/uGeo. That means map-shader work — hypsometric tint, kurvenlineal brightness, sunset lighting, Ice/Ocean specular — would risk regressing the "already amazing"/helix.This forks
GeoHelix.tsxas a verbatim copy ofBodyHelix(exactly asBodyHelixitself was forked fromBodyV3to protect/body, #64) and repoints the three map routes to it./helixstays onBodyHelix, now completely untouched by any future geo work. Same BSO2 decoder + per-vertex helix-normal Gouraud shading;GeoHelixstill resolves scenes viapathScene()from the path.Behaviourally a no-op today —
GeoHelixis a byte-for-byte copy, so/geo//ice//garminrender identically. This is purely the isolation scaffold the map-shader improvements (a follow-up PR) land on, so those can iterate freely with zero risk to the anatomy body.Verify
npx tsc --noEmitclean. Cockpit-only change (nothub-client/), so no changelog entry required.🤖 Generated with Claude Code
https://claude.ai/code/session_012jEwwaT5JZ5x8qWvcnaMYC
Generated by Claude Code
Summary by CodeRabbit
New Features
/helix,/geo,/ice, and location-based Garmin views.Bug Fixes