-
Notifications
You must be signed in to change notification settings - Fork 1
feat(transition | tui): add expand, collapse and fade transition animations #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThree new animated text transitions— Changes
Sequence Diagram(s)sequenceDiagram
participant UI
participant Transition (collapse/expand/fade)
participant SpringPhysics
UI->>Transition (collapse/expand/fade): Start(width, height, direction)
loop Animation frames
Transition (collapse/expand/fade)->>SpringPhysics: Update(progress, velocity)
SpringPhysics-->>Transition (collapse/expand/fade): New progress, velocity
Transition (collapse/expand/fade)->>UI: View(prev, next)
UI-->>Transition (collapse/expand/fade): Schedule next frame (if animating)
end
Transition (collapse/expand/fade)->>UI: Animation complete
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
eea6a9d
to
c41b60a
Compare
- add `expand.go` with center-outward expanding transition effect - register expand transition in transition factory function - implement spring-based animation with harmonica library
- add new `collapse.go` with collapse transition implementation - implement edge-to-center collapsing animation with spring physics - fix `expand.go` opposite method to return collapse instead of expand - register collapse transition in transition factory
- add `fade.go` with fade transition effect - register fade transition in transition factory function - implement spring-based animation with harmonica library
be62190
to
9219329
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
collapse transition flashes the next slide on the first frame
Huh? Can you post a screen recording of it? |
@ploMP4 Can't replicate it on Alacritty |
output.mp4Here is a video that replicates the issue. After further investigation I noticed that it only happens on ghostty and kitty, alacritty works fine. Running it inside and outside tmux gives the same results so tmux does not affect it. Compositor: Wayland |
2025-06-14.01-04-56.mp4What in the....? |
TLDR
Add center-based expand/collapse transitions with spring physics animation.
Change Summary
Added Features:
New Transition in
collapse.go
:newCollapse()
: Creates collapse transition with spring-based animationView()
: Implements edge-to-center collapsing effect using harmonica spring physicsNew Transition in
expand.go
:newExpand()
: Creates expand transition with spring-based animationView()
: Implements center-outward expanding effectNew Transition in
fade.go
:fade
struct: implements tile-based fade transition with spring physicsnewFade()
: creates fade transition with configurable FPS and spring parameterstileGrid
struct: manages randomized tile reveal order for fade effectnewTileGrid()
: creates grid with shuffled tile order for organic fade animationbuildFadeLine()
: constructs each line by combining revealed/unrevealed tilesextractTileSegment()
: handles proper text truncation for tile boundariesCode Changes:
In
collapse.go
:Transition
interface withStart()
,Update()
,View()
,Animating()
methodsIn
expand.go
:Summary by CodeRabbit
Summary by CodeRabbit