Repository navigation
feat: skip editor animation for deleted and renamed files - #36
Conversation
Skip file opening dialog and editor typing animation for deleted files. For deleted files, only show rm and git add commands in terminal. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
WalkthroughAdds handling for Deleted and Renamed file statuses in the commit animation flow: skips the editor-opening animation for those cases and emits terminal/git command sequences (rm/mv and git add) with pauses around commands. Changes
Sequence Diagram(s)sequenceDiagram
participant Loader as CommitLoader
participant Anim as Animation
participant Terminal as Terminal
participant Git as Git
Loader->>Anim: load_commit(file_change)
Anim->>Anim: inspect FileStatus
alt status == Deleted
Anim->>Anim: pause
Anim->>Terminal: rm <path>
Anim->>Anim: pause
Anim->>Git: git add <path>
Anim->>Anim: pause
else status == Renamed
Anim->>Anim: pause
Anim->>Terminal: mv <old_path> <new_path>
Anim->>Anim: pause
Anim->>Git: git add <new_path>
Anim->>Anim: pause
else other statuses
Anim->>Anim: open editor animation and apply edits
end
Anim-->>Loader: file animation complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/animation.rs (1)
340-354: Logic is correct; consider adding explanatory output for consistency.The deleted file handling correctly skips editor animation and executes
rm+git addcommands. The early return withcontinueproperly prevents editor steps.For consistency with the animation style used elsewhere (e.g., time-travel at lines 295-315, git push at lines 435-464), consider adding an explanatory terminal output before the
rmcommand:// For deleted files, skip editor animation and only run rm + git add if matches!(change.status, FileStatus::Deleted) { self.steps.push(AnimationStep::Pause { duration_ms: (self.speed_ms as f64 * GIT_ADD_PAUSE) as u64, }); + self.steps.push(AnimationStep::TerminalOutput { + text: format!("🗑️ Removing {}", change.path), + }); + self.steps.push(AnimationStep::Pause { + duration_ms: (self.speed_ms as f64 * OPEN_CMD_PAUSE) as u64, + }); self.add_terminal_command(&format!("rm {}", change.path));
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/animation.rs(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Build (windows-latest)
- GitHub Check: Build (macos-latest)
- GitHub Check: Build (ubuntu-latest)
🔇 Additional comments (1)
src/animation.rs (1)
1-1: LGTM! Import is necessary for deleted file handling.The
FileStatusimport is correctly added to support the new deletion check at line 341.
Skip file opening dialog and editor typing animation for renamed/moved files. For renamed files, only show mv and git add commands in terminal. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Replace multiple if-continue statements with a single match expression for better readability and maintainability. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Summary
rmandgit addcommands in terminalmvandgit addcommands in terminalChanges
load_commitmethod for deleted filesload_commitmethod for renamed filesFileStatusenum in animation moduleFileStatus::DeletedorFileStatus::RenamedTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Improvements