Separate geometry from the canvas renderer
Pure coordinate and measurement functions can be tested without Konva, while the interface focuses on interaction and presentation.
A human-in-the-loop clinical workspace for reviewing recorded movement frames and correcting AI-generated lines, angles, key points, and measurement values before results are saved.
Automated movement analysis can place measurement geometry on an imperfect frame or anatomical position. Clinical reviewers need a precise, explainable way to choose the right frame, correct lines and angles, compare reference guidance, and save revised measurements without losing the original exercise context.
Measurement geometry must remain correct while media is scaled, points are dragged, and line types restrict movement to one axis.
The workflow depends on multiple tenant-specific legacy APIs and session values whose payloads can be missing, stale, or inconsistent.
Large video frames and rendered canvas images must be validated and processed without freezing the review interface.
Clinical reviewers need explicit unavailable, loading, validation, save, retake, and completion states rather than ambiguous canvas failures.
A Next.js and React review shell separates workflow state from Konva geometry, validates upstream payloads through Zod, maps legacy responses into typed domain models, and coordinates frame selection, alignment, verification, and persistence through a reducer-driven controller.
A reducer and controller own frame selection, alignment, verification, loading, failure, save, and completion transitions.
Typed points, lines, angles, plumb references, scaling rules, and measurement calculations stay independent of rendering components.
React Konva renders the patient frame, draggable key points, measurement geometry, reference guidance, and responsive controls.
Schema validation, response mappers, diagnostics, and an API client normalize tenant and session-specific upstream contracts.
Pure coordinate and measurement functions can be tested without Konva, while the interface focuses on interaction and presentation.
Frame selection, alignment, and verification form a controlled sequence so save behavior cannot run against incomplete media or geometry.
Upstream payloads are parsed and mapped before reaching UI state, turning malformed contracts into diagnosable unavailable states instead of downstream exceptions.
Line type, direction, measurement type, left and right values, and plumb-line relationships remain explicit throughout editing and persistence.
Share your challenge, scope, and timeline to start a focused conversation.