8000 fix(fx): make ADSR knots reliably grabbable on mobile by johannboehme · Pull Request #11 · johannboehme/tk-1 · GitHub
[go: up one dir, main page]

Skip to content

fix(fx): make ADSR knots reliably grabbable on mobile - #11

< 8000 /span>
Merged
johannboehme merged 1 commit into
mainfrom
claude/gifted-darwin-515537
May 2, 2026
Merged

johannboehme merged 1 commit into
mainfrom
claude/gifted-darwin-515537

Conversation

@johannboehme
Copy link
Copy Markdown
Owner

Summary

ADSR-Knots im FX-LCD waren auf Mobile kaum bedienbar, sobald sie ihr Datenmaximum erreichten — bei sustain=1 klebte der D/S-Knot oben auf der Bezel-Kante, der r=14 Hit-Kreis wurde halb vom SVG-Default overflow:hidden abgeschnitten, und der Finger verdeckte den 5 px großen Dot komplett.

Drei kombinierte Fixes:

  • Inner-Padding im Plot-Mapping (computeAdsrGeom) — neue PAD_X / PAD_Y Insets (6/8 auf Mobile, 4/4 auf Desktop) sorgen dafür, dass ein Knot an jedem Daten-Extremum sichtbar innerhalb des LCD bleibt. Origin (ox/oy) wandert mit, buildAdsrPath und curvePointAtTime lesen den neuen Origin aus dem Geom statt hardcodiertem (0, plotH).
  • overflow="visible" auf der SVG — der unsichtbare Hit-Kreis darf jetzt über die LCD-Bezel hinausragen, falls der Finger 1–2 px daneben landet.
  • PlotProxyZone — eine plot-weite <rect> Touch-Surface unter den AdsrNodes, die per Distanz-Check den nächstgelegenen Knot grabbt und denselben Drag-Loop ansteuert. Damit muss der Finger den Dot überhaupt nicht mehr treffen — irgendwo in der Nähe tippen reicht. SVG-Paint-Order sorgt dafür, dass direkte Knot-Treffer weiterhin Vorrang haben.

Drag-Logik in einen useAdsrDrag Hook extrahiert, den die per-Knot-Nodes und die Proxy-Zone gemeinsam nutzen — single source of truth für startRef und Active-Axis.

Test plan

  • Editor öffnen, FX-Pad anwählen, ENV-Mode aktivieren
  • Mobile-Viewport (iPhone 14, 390 px breit): D-Knot per Drag auf sustain=1 (oben) und sustain=0 (unten) — beide müssen visuell deutlich vom Bezel abgesetzt sein und greifbar bleiben
  • Attack auf 2 s maxen → A-Knot weiterhin grabbar
  • Release auf 3 s maxen → S-Knot weiterhin grabbar (auch bei sustain=1 an der oberen Kante)
  • Tap-Anywhere: Empty-Bereich des LCD antippen → nächstgelegener Knot wird gegrabbt, Drag funktioniert flüssig
  • Direkter Knot-Hit funktioniert weiterhin (Z-Order korrekt)
  • Doppelklick auf Knot resettet Envelope auf Kind-Default
  • Desktop-Regression (≥640 px): Knots an gewohnten Stellen, Padding minimal (4/4 SVG-Units), kein neuer Look
  • Playhead-Animation läuft weiterhin sauber unter dem Curve

🤖 Generated with Claude Code

Knots pinned at their data-maximum (sustain=1 hugged the LCD top, max
attack/release hugged the bezel) were nearly impossible to grab on
phones — half the r=14 hit-area was clipped by the SVG bezel and the
finger covered the visible dot.

Three combined changes:

- computeAdsrGeom now reserves an inner-padding inset (PAD_X/PAD_Y),
  so a knot at any data-extreme stays visibly inside the LCD with
  breathing room for the touch target.
- The SVG gets overflow="visible" so the invisible hit-circle can
  extend past the LCD bezel — a finger landing a few px outside the
  glass still grabs.
- A new PlotProxyZone renders behind the AdsrNodes and grabs the
  nearest knot when the user taps anywhere on the LCD. Removes the
  need for finger-precision; tapping in the general area is enough.

Drag logic refactored into a useAdsrDrag hook so the per-knot nodes
and the plot-wide proxy share one start-snapshot and active-axis
controller.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@johannboehme
johannboehme merged commit 329abdd into main May 2, 2026
1 check passed
@johannboehme
johannboehme deleted the claude/gifted-darwin-515537 branch May 2, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0