Repository navigation
fix(glass,motion,ui): smooth DampedDrag jelly envelope and C1 spring reversal accounting (#567, #568) - #576
Merged
Merged
Conversation
…le-variable critically damped speed_spring (PR #576 R2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #567
Closes #568
Summary
#568— Single-variable critically dampedspeed_spring(packages/glass/src/damped_drag.pion):speed_springwas underdamped (ratio = 0.5, stiffness = 300.0), guaranteeing a negative zero-crossing overshoot during drag settle (+v -> 0 -> -0.163v -> 0). Combined with|speed / per|inDampedDrag::jelly, fast multi-step finger drags & reversals bounced back across zero whilepresswas dropping, trippingsizes_acrosswidth stopped dead.speed_springto critically damped (ratio = 1.0, stiffness = 300.0) while leavingDampedDrag::jelly100% untouched (zero mid-speed stretch attenuation, full1.25×stretch preserved).settle_towhile keepingratio = 0.5onupdate_valueor narrowing a localjellybowl still fails reversal drags (width stopped deadat4100ms/1783ms), whereas critically dampedspeed_spring(ratio = 1.0)alone passes all 34/34packages/glasstests across all 5 FPS modes with zero mid-speed dulling.#567— Opt-in C¹ velocity-preserving spring reversal accounting (packages/view,packages/motion,packages/ui/src/sizes_steady.pion):liquid_segmented_node4 rapid reversed taps at 60fps showed puremotion::snappy_damped(ratio = 1.0, stiffness = 420.0) alone triggerssizes_steady'sstopped deadcheck on 35.3% (156/442) of simple 2-tap reversals: by Newton's 2nd law, reversing a spring target mid-flight preserves C¹ position/velocity continuity while necessarily stepping acceleration discontinuously, causingd2 > stop_jerk * beforeat the turnaround apex.packages/view/src/way_reversed.pion(View::note_way_reversed,View::is_motion_reduced,Tree::has_way_reversed,Tree::way_reversed_at, cleaned up viaowns()).marks_turn? : Bool(defaultfalse) toNodeWay::go, enabled only on geometry-drivingDampedDrag.value(update_value,settle_to,slide_to) — never onpress,scale_x,scale_y, orspeed— and checking bothn.is_motion_reduced()(tree.motion_reduced) andui::reduced_motion.sizes_steady_faultONLY in thestopped deadbranch (and updated its design-invariant comment): skipsstopped deadwhen an opt-in C¹ spring reversal falls in(s0.1, s3.1], and drops stale pre-reversald0when in(ab.1, s0.1]while still enforcing post-reversald2 <= stop_jerk * d1. Allwentspike checks,put()snaps, explicitvelocity=impulses,Snap/Tween, and clamp cliffs remain 100% enforced.Verification
pionc fmt --checkon all changed/added files: passpython3 scripts/invar check --json:ok: truepython3 scripts/invar audit --json --require-reactive:ok: true, error_count: 0, warning_count: 0packages/glass: 34/34 across default +MBUI_TEST_MOTION=judgeat60,120,24,7FPS (including 8 new fast multi-step finger-drag/reversal probes, monotonic settle + full stretch unit test, and per-frame 2-hop reversal test)packages/view: 226/226packages/motion: 44/44 (including opt-in vs defaultmarks_turn=false, same-dir, impulse, non-spring,put(), andreduced_motionnegative tests)packages/ui: 913/913 (including directsizes_steady_faultpositive + negative dead-stop/spike/5-sample tests)packages/kit: 75/75,packages/lg(default mode): 161/161 (note:packages/lgunderMBUI_TEST_MOTION=judge MBUI_TEST_FPS=60has 4 pre-existing unrelated failures already present onmain)