Skip to content

Add configurable contour appearance and disappearance - #19

Draft
KickNext wants to merge 2 commits into
codex/morph-performance-precachefrom
codex/configurable-morph-motion
Draft

KickNext wants to merge 2 commits into
codex/morph-performance-precachefrom
codex/configurable-morph-motion

Conversation

@KickNext

@KickNext KickNext commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Behavior

Unmatched contours currently shrink almost immediately under polar interpolation. Add contourTransition: MorphContourTransition.linear to MorphIcon, AnimatedMorphIcon, and precacheMorph so appearing/disappearing contours change size linearly with morph progress. Unmatched contours clamp spring overshoot at their endpoints.

MorphContourTransition.legacy remains the default and preserves existing visuals. Cache keys include the policy. Changing the policy during an implicit transition replans from the visible shape; pending old results cannot replace the new plan, and changing policy while idle preserves the settled frame.

The existing playground Curves.linear choice controls progress over time; the new Linear size switch controls unmatched-contour shape at a given progress and is available in both spring and manual modes. Generated playground code reflects both choices. This is the first, opt-in step toward better motion. Matched-contour rotation and correspondence are unchanged; it does not solve the semantic menu → close trajectory. The new mode was visually inspected and is not a universal replacement for legacy motion.

Dependency

Stacked on #18 to integrate the option with precaching. This PR targets codex/morph-performance-precache so its diff contains only the motion configuration change. Retarget to main after #18 merges.

Validation

  • 149 package tests and 28 example tests passed; package line coverage 91.77%.
  • Five new widget tests passed in Chrome. Windows Flutter test-server CanvasKit 404s were bypassed by serving the identical SDK assets through CDP; no package, test, or SDK code was altered for that workaround.
  • Static analysis, formatting, release web build, and Chrome hot reload passed.
  • All 108 default-mode captures match main at 361f54d pixel-for-pixel. Another 108 captures exercise the opt-in mode; side-by-side inspection confirms gradual hole closure and dot disappearance.
  • Regression coverage includes mode changes during pending loads and running transitions, cache isolation/precache reuse, reduced motion, symmetric appearance/disappearance, overshoot, and unchanged matched contours.

Capture opt-in visuals with --dart-define=VISUAL_LINEAR=true when running tool/visual_ab_test.dart.

This branch has not been deployed

No deployments
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