Skip to content

feat: skip editor animation for deleted and renamed files - #36

Merged
unhappychoice merged 3 commits into
mainfrom
feat/skip-deleted-files-animation
Nov 11, 2025
Merged

unhappychoice merged 3 commits into
mainfrom
feat/skip-deleted-files-animation

Conversation

@unhappychoice

@unhappychoice unhappychoice commented Nov 11, 2025 •

Copy link
Copy Markdown
Owner

Summary

  • Skip file opening dialog and editor typing animation for deleted and renamed files
  • For deleted files, only show rm and git add commands in terminal
  • For renamed/moved files, only show mv and git add commands in terminal
  • Improve animation experience by avoiding unnecessary editor operations for file deletions and renames

Changes

  • Add early return in load_commit method for deleted files
  • Add early return in load_commit method for renamed files
  • Import FileStatus enum in animation module
  • Check file status and skip editor steps when FileStatus::Deleted or FileStatus::Renamed

Test plan

  • cargo check
  • cargo test
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo fmt

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Fixed animation handling for deleted files during commit playback — deletions now show terminal command sequences instead of editor interactions.
    • Fixed animation handling for renamed files — renames now show move/add command sequences and skip editor-opening animations.
  • Improvements

    • Preserves existing editor-open animations for edits and additions; adds short pauses around command animations for clearer playback.

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]>
@coderabbitai

coderabbitai Bot commented Nov 11, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Adds 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

Cohort / File(s) Summary
Animation flow: Deleted & Renamed handling
src/animation.rs
Import FileStatus; in load_commit detect Deleted and Renamed file statuses and early-continue to run alternative animation sequences: for Deleted run pauses → rm <path> → pause → git add <path>; for Renamed run pauses → mv <old_path> <new_path> → pause → git add <new_path>; preserve existing editor-open flow for other change types.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify correct use and matching of FileStatus enum variants.
  • Confirm old_path availability and null/None handling for renamed entries.
  • Ensure command strings are escaped/validated and pauses preserve UX expectations.
  • Check early-continue control flow doesn't skip necessary bookkeeping elsewhere.

Possibly related PRs

Poem

🐇 I hop through diffs with nimble feet,
Deleted paths I do not greet.
A pause, a mv, a quiet add—
The screen keeps tidy, never sad.
Thump-thump, the rabbit signs the patch with glee.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: skipping editor animation for deleted and renamed files, which matches the core implementation that adds FileStatus handling and bypasses editor animation for these file types.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/skip-deleted-files-animation

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be7a325 and 5470911.

📒 Files selected for processing (1)
  • src/animation.rs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/animation.rs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 add commands. The early return with continue properly 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 rm command:

         // 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

📥 Commits

Reviewing files that changed from the base of the PR and between e8c1dee and be7a325.

📒 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 FileStatus import 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]>
@unhappychoice unhappychoice changed the title feat: skip editor animation for deleted files feat: skip editor animation for deleted and renamed files Nov 11, 2025
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]>
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