feat: directional guidance towards svg element with mouse and touchscreen#587
feat: directional guidance towards svg element with mouse and touchscreen#587soundaryakp1999 wants to merge 2 commits intomainfrom
Conversation
Code ReviewThanks for the contribution! The feature concept is well thought-out — using pitch and stereo pan to guide users toward the nearest curve point is a meaningful accessibility improvement. Here are some issues to address before this is ready to merge. Critical: DOM Access in the Model Layer
const bbox = nearest.element.getBoundingClientRect();
const centerX = bbox.x + bbox.width / 2;
const centerY = bbox.y + bbox.height / 2;
Architecture: Service Calling Service Directly
const guidance = this.commandContext.context.getTouchGuidance(x, y);
this.commandContext.audioService.playTouchGuidance(guidance);
Suggested approach: compute guidance in the mouse listener, then route it through the existing command infrastructure rather than calling Bug: Incomplete Resource Cleanup in
|
| Severity | Issue |
|---|---|
| Critical | DOM access (getBoundingClientRect) in Model layer |
| High | Mousebindingservice calling AudioService directly (architecture bypass) |
| Medium | gainNode/stereoPanner not tracked → not disconnected in stopAll() |
| Low | Volume floor of 0.05 when muted — clarify intent |
| Low | Missing blank line in plot.ts interface |
| Low | No unit tests for new directional logic |
The directional guidance idea is solid and the audio implementation (frequency mapping, rate-limiting by distance, stereo pan) is well-structured. Addressing the architecture and DOM-access concerns will make this mergeable.
|
I have addressed the feedback of claude bot |
Pull Request
Description
When the user moves the mouse, auditory queues point them towards the nearest point in the curve.
Related Issues
Changes Made
Earlier behavior: the sonified (x,y) position is played if the mouse curser or touchscreen pointer touches any of the elements present in the svg. Nearby points provide no indication of proximity to the curve.
Current behavior: The relative direction to the nearest point from curser is represented with auditory notification. High pitch indicates that the point is above the curser. stereo panning to the right indicates that the point is to the right side. This is designed to guide the user towards the point, which will help the user physically draw the curve on the mouse, thus reinforcing a realistic shape of the curve.
Screenshots (if applicable)
Checklist
ManualTestingProcess.md, and all tests related to this pull request pass.Additional Notes