Add rise and fadeAndRise paragraph animation styles - #152
Draft
Jun Yan (junyan72) wants to merge 1 commit into
Draft
Add rise and fadeAndRise paragraph animation styles#152Jun Yan (junyan72) wants to merge 1 commit into
Jun Yan (junyan72) wants to merge 1 commit into
Conversation
Introduce a pluggable per-word/per-character animation engine for streamed paragraphs, reusing the existing CADisplayLink pipeline. - Add ParagraphAnimationStyle enum (.fade, .rise, .fadeAndRise) and rise/wave constants in ParagraphAnimation.swift - Add paragraphAnimationStyle to MarkdownRenderConfig with a builder - Generalize per-frame mutation in ParagraphUIView/ParagraphNSView to apply alpha (fade) and/or .baselineOffset (rise) - Animate rise per composed-character sequence with a continuous, capped stagger so glyphs ripple in instead of moving as rigid word blocks - Wire the style through the SwiftUI wrappers and demo it in the sample app Refs #149 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ef6fbb1d-45ac-44b9-9430-86a8f6163326
4 tasks
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.
Summary
Adds vertical-offset ("rise") streaming animations alongside the existing fade, by generalizing the paragraph animation engine so its per-frame mutation is pluggable. This is a step toward character-level streaming animation.
ParagraphAnimationStyleenum (.fade,.rise,.fadeAndRise) plus rise/wave constants inParagraphAnimation.swift.paragraphAnimationStyleonMarkdownRenderConfigwith awithParagraphAnimationStyle(value:)builder (defaults to.fade, so existing behavior is unchanged).updateTextViewWithCurrentAnimations()inParagraphUIViewandParagraphNSViewto apply foreground-color alpha (fade) and/or.baselineOffset(rise) per range.delayBetweenCharacters,maxWaveLead) so glyphs ripple in instead of whole words moving as rigid blocks. AddedsplitIntoCharacters(withIn:)..fadeAndRisein the sample app.Note: intrinsic size is kept cached during animation, so surrounding blocks don't reflow; a negative
baselineOffsetcan slightly clip descenders (tunable viariseDistance). Pure.fadestill uses the original per-word path.This does not yet implement the buffered "release one grapheme at a time" sequential mode described in the issue.
Refs #149
Validation
swift build— succeeds (only pre-existing deprecation warnings).swiftlint --stricton the changed files — clean.make generate-sample-project— regenerates the sample app project..fadeAndRise.OSS readiness