// Right panel — real results gallery, measurements with deltas, anatomy notes, real history. const RightPanel = ({ ctx }) => { const { state, set } = ctx; const session = state.session; if (!session) return ; return (
{/* 04 RESULTS */}
04Results {state.results.length} of ∞
{state.results.map((r) => (
set({ activeResult: r.id })} >
{r.label} {r.kind === "warp" && (
)}
{r.label}
{r.kind !== "original" && (
e.stopPropagation()}>
)}
{r.time} {r.metric}
))}
{/* 05 MEASUREMENTS */}
05Measurements Δ from baseline
mm anchored on IPD ≈ 63mm · {session.measurements.mm_per_px} mm/px · {session.measurements.ipd_px}px detected.
{/* 06 ANATOMY */}
06Anatomy Reference
{[ { label: "Radix", desc: "Root of the nose, between the eyes." }, { label: "Dorsum", desc: "Bridge — bony upper, cartilaginous lower." }, { label: "Tip", desc: "Lower lateral cartilage assembly." }, { label: "Ala", desc: "Lateral wall of the nostril; controls width." }, { label: "Columella", desc: "Vertical strip between the nostrils." }, ].map(a => (
{a.label} {a.desc}
))}
{/* 07 HISTORY */}
07History {session.history.length}
{session.history.map((h, i) => (
{h.time}
{h.desc} {h.detail && {h.detail}}
{h.kind}
))}
); }; const MeasurementGrid = ({ baseline, deltas }) => { const fmt = (key, unit) => { const v = baseline[key]; const d = deltas[key]; return { val: v, unit, delta: d }; }; const cells = [ { label: "Nasolabial", ...fmt("nasolabial", "°") }, { label: "Dorsal hump", ...fmt("dorsal_mm", " mm") }, { label: "Bridge width", ...fmt("bridge_mm", " mm") }, { label: "Tip width", ...fmt("tip_w_mm", " mm") }, { label: "Nose length", ...fmt("nose_len_mm", " mm") }, { label: "Alar width", ...fmt("alar_mm", " mm") }, { label: "Projection", ...fmt("projection_mm", " mm") }, { label: "Tip rotation", ...fmt("tip_rotation", "°") }, { label: "Symmetry", ...fmt("symmetry", "") }, ]; return (
{cells.map(c => { const showDelta = typeof c.delta === "number" && c.delta !== 0; const dColor = showDelta ? (c.delta > 0 ? "var(--ok)" : "var(--warn)") : "var(--ink-3)"; return (
{c.label} {c.val}{c.unit} {showDelta ? `${c.delta > 0 ? "+" : ""}${c.delta.toFixed(2)}${c.unit}` : (c.delta === 0 ? "no change" : "baseline")}
); })}
); }; const EmptyRightPanel = () => (
04Results
Results, measurements, and session history appear here once you load a portrait.
); Object.assign(window, { RightPanel, MeasurementGrid, EmptyRightPanel });