Skip to content

v0.8.0 — drag reliability round 2 + garden polish

Choose a tag to compare

@NovaRagnarok NovaRagnarok released this 16 May 00:23
· 87 commits to main since this release

Highlights

Round 2 of drag-and-drop reliability lands the interaction properly, with garden-rendering polish on top. Eight fixes — five drag-related, three visual.

Fixes

  • 🖱️ Drag survives any mid-flight re-render. syncGardenModel used to wipe dragPreviewPlacements and reset every wander state's manualOffset on every call. Combined with engineProps churning constantly (callbacks declared inline in cli.tsx), every parent re-render killed the in-flight drag. A toast appearing, a 30s background scan, a focus change — all enough to silently undo a drag mid-motion. The sync now carries dragPreviewPlacements across, and engine.setProps skips the sync entirely when only callback identities changed.
  • 🎯 Drag commit math no longer bakes in the wander bob. Press recorded grabX from the visual position (which includes the transient wander bob, up to ±2 cells), then commit math used the anchor — so single-cell drags landed 1–2 cells off the cursor's release point. Press now subtracts the wander offset, so cursor delta equals committed offset exactly.
  • 📐 Stale chrome measurement + post-tick hit-test miss. Two more drag misses: cached chrome row height was reused after layout shifts that changed it, and the 100ms wander tick could move a creature between paint and click so findCreatureDragHandleAtCell missed. Engine remeasures chrome on every press and falls back to a hit-test against the last-rendered snapshot.
  • 🧹 Pre-existing scene overlap no longer vetoes unrelated drags. When two creatures were already clipping somewhere in the scene, the drag solver refused any new motion until the unrelated overlap resolved itself. Body-overlap state is now scoped to the drag's footprint and immediate neighbours.
  • 🪟 Dismissing the focus card returns the bottom-right corner to the garden. Pressing c to hide the focus card used to leave the bottom-right slot reserved as a dead zone forever — creatures couldn't wander or be dragged into it. The dead zone now releases when the card is dismissed.
  • 🏷️ Names no longer disappear near the bottom of the garden. The wander/drag clamp reserved one row below the sprite, but the name strip is two rows (gap + name). Any creature that wandered or got dragged to within ~2 rows of the bottom border lost its name to a silent setCell bounds drop.
  • 🔲 Selection box hugs the visible creature instead of the sprite bounding box. The focus frame was sized to charW × charH (the sprite generator's full grid), but the body window typically allocates only 54–74% of that height and the contour walk doesn't fill every column either — so the box was puffed up with a row or two of empty cells. Now scans both animation frames for lit sub-pixels and shrinks to their union; stable through the body-bob.

Internal

  • Test count: 445 → 462.

See CHANGELOG.md for the full notes.


npm install -g @outsideheaven/repogarden