fix: unblock the underside, make the cross-section real and movable, replace the selection heart (#8) - #9
Open
PouyanJay wants to merge 3 commits into
Open
Conversation
…tion Addresses the three reports in issue thebuggeddev#8. 1. The plinth walled off the bottom of every specimen, so a full 360° orbit was impossible. It is gone. The contact shadow that grounded the organ stays, but is now anchored to each organ's own footprint and fades out as the camera drops toward its plane, so it can never sit between the viewer and the specimen. Isolate used to be defined as "fade the plinth"; it now dims the remaining staging — shadow, particles, accent glow. Home framing drops to near eye level, since there is no longer a disc that needs to be seen at an angle. 2. "Layers" only toggled wireframe, and the tool that does cut — Cross- section — was broken in ways that hid it: the sweep started fully clipped so the organ blinked out, turning it off dropped the planes before the reverse tween, and front-face-only shells left the cut reading as a hole through to the background. The cut now wipes in from whole, wipes back out before releasing, renders both sides so the interior is actually exposed, aims itself away from the camera so it opens toward the viewer from any orbit, and holds auto-rotate while it is active. The wireframe tool keeps its behaviour under an honest label. 3. The selected organ was marked with a filled heart, which reads as "favourited" — a meaning the Bookmark control in the panel heading already owns. It is a check mark now, and the list carries radio semantics so selection is exposed to assistive tech rather than being colour and an icon alone. Also makes the three viewer tools independent toggles instead of one "active tool" that could only ever describe one of them, and has reset() clear them in the viewer as well as in the toolbar.
The cut had no controls at all: one fixed plane, no way to change where it sat or which way it faced. That also meant it could not be aimed at anything in particular, and on a paired organ it removed a whole kidney rather than sectioning one. The plane now lives in the organ's own space and is carried out to world space through the pivot each frame, because three.js only clips in world space. That is what lets a plane be *named*: a sagittal cut stays sagittal while the specimen is turned, so the presets mean what they say and the viewer teaches the vocabulary rather than just making a cut. On top of that: - Sagittal, coronal and axial presets, plus Free, which squares the plane up to the current view and then leaves it there — the previous behaviour, kept as one option rather than the only one. - A depth slider whose travel is measured against each organ's own bounding box projected onto the plane normal. The same slider position means "halfway through" for an eyeball and for a pair of lungs, and every position lands inside the specimen. This is what fixes the kidneys. - Flip, so both faces are reachable without orbiting around. - Markers on the discarded half fade out with it instead of floating in the gap, which was unnoticeable with a fixed plane and glaring once it sweeps. Opening a cut now switches auto-rotate off through the normal control rather than overriding it in applyAutoRotate. The old override left the toggle claiming to be on while nothing moved, and locked out anyone who did want to turn a sectioned specimen.
|
@PouyanJay is attempting to deploy a commit to the thebuggeddev-9222's projects Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Aug 6, 2026
|
@PouyanJay thank you for picking up the issue, can you please add screenshots of how the UI/UX looking now, after the changes? |
The cross-section now shows the plane doing the cutting: a translucent, accent-tinted pane with an outlined rim, posed in organ space so it rides the specimen through the intro, orbit, axis changes, depth drags, flips, and the open/close sweep. A Plane checkbox in the section controls shows or hides it; Reset restores it.
Author
PouyanJay
force-pushed
the
fix/issue-8-viewer-ux
branch
from
August 7, 2026 07:46
136467e to
cf99e88
Compare
|
Looking good! |
Author
|
@thebuggeddev just a reminder about this PR :) |
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.


Fixes #8. Thanks @Phantom-VK — all three reports were valid, and two of them turned out to be covering deeper bugs.
1. The view-blocking platform
Removed. The opaque plinth walled off the bottom of every specimen, so a full 360° orbit was impossible.
Three things leaned on it, so this wasn't a one-line delete:
HOME_CAMERA.ydrops 1.05 → 0.3, since nothing needs to be seen at an angle any more.2. "Layers" doesn't cut the object
Correct, and the tool that does cut — Cross-section — was broken in four ways that would have hidden it even if found:
side = FrontSidemeant the cut read as a hole through to the background rather than exposing anythingAll four fixed, and
Layersis nowWireframe, so no button promises something it doesn't do. The layered metaphor moved onto the tool that actually opens the organ up.The cut is also now movable, which it wasn't before at all:
Known limit, stated plainly
The models are single closed surface shells with no interior geometry (
meshCount: 1). So the cut reveals whatever a given model actually contains — which is genuinely good for skin, eye, lungs and heart, and empty for brain and kidneys. No rendering technique can section anatomy that isn't in the file.I prototyped a stencil-buffer cap that fills the cut face, and removed it: with shell geometry the parity test reports "solid" across the whole silhouette, so it painted a heart as a solid block of myocardium and hid the real modelled atria underneath. For a teaching tool that's worse than an honest hollow. Proper interiors need segmented assets (per-structure closed meshes); that's tracked separately.
3. The heart icon
Replaced with a check mark. The heart read as "favourited", a meaning the Bookmark control in the panel heading already owns. The list also carries
role="radiogroup"/aria-checkednow — selection previously had no programmatic representation at all, only a CSS class.Also fixed along the way
The toolbar tracked a single
activeTool: string | nullwhile Isolate, Cross-section and Wireframe are independent toggles — so two could be on with only one lit, andResetcleared the highlight while leaving the cut applied in the viewer. Tool state is now a record, andreset()clears the viewer as well as the buttons.Verification
Driven in a real browser with Playwright, not just typechecked:
prefers-reduced-motiontsc --noEmitandeslint appcleanNote:
npm testis already failing onmain—tests/rendered-html.test.mjsstill asserts the deleted starter skeleton (app/_sites-preview/,react-loading-skeleton,title: "Starter Project"). Pre-existing, untouched here.