Skip to content

Conversation

@MH4GF
Copy link
Contributor

@MH4GF MH4GF commented Nov 18, 2025

Summary

  • Display the wtp cd guidance message after executing post-create hooks instead of before
  • Improves UX when hooks take time to execute

Changes

  • Reordered output in addCommandWithCommandExecutor to show hooks execution first, then success message

Benefits

  • Users can immediately see which worktree to navigate to without scrolling up
  • The most relevant information appears at the most relevant time (right when you're ready to use it)

Testing

  • All existing tests pass
  • No behavioral changes to hook execution or worktree creation

Closes #46

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Improved operation sequencing by displaying the success confirmation after background operations complete, rather than before, ensuring proper order of execution.

Display the 'wtp cd' guidance message after executing post-create
hooks instead of before. This improves UX when hooks take time to
execute, as users can immediately see the navigation command without
scrolling up.

Closes satococoa#46

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Nov 18, 2025

Walkthrough

The success message for worktree creation has been reordered to display after post-creation hooks execute, rather than before. Hook execution and error handling remain unchanged; only the timing of the success message display has shifted.

Changes

Cohort / File(s) Summary
Success Message Reordering
cmd/wtp/add.go
Moved success message display to occur after executePostCreateHooks instead of before; hook error handling remains unchanged

Sequence Diagram

sequenceDiagram
    participant User
    participant add.go
    participant Hooks

    rect rgb(200, 220, 240)
    Note over add.go: Previous Flow
    add.go->>User: Display success message
    add.go->>Hooks: Execute post-create hooks
    Hooks->>Hooks: Run (may take time)
    end

    rect rgb(220, 240, 220)
    Note over add.go: New Flow
    add.go->>Hooks: Execute post-create hooks
    Hooks->>Hooks: Run (may take time)
    add.go->>User: Display success message
    end
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single file with straightforward reordering of function calls
  • No logic changes or new functionality
  • No modifications to error handling or function signatures

Poem

🐰 The message hops along the line,

After hooks complete their time!

Users see the path at last,

When the lengthy wait has passed! 🌱

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: display cd guidance after hooks execution' accurately describes the main change: reordering output so the cd guidance appears after hooks finish running.
Linked Issues check ✅ Passed The pull request successfully implements the feature requested in issue #46: moving the cd guidance message to display after post-create hooks execution completes.
Out of Scope Changes check ✅ Passed All changes in the pull request are directly related to reordering the success message display relative to hook execution, which is the sole objective of issue #46.
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

📜 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 7678ba7 and c981c98.

📒 Files selected for processing (1)
  • cmd/wtp/add.go (1 hunks)
🔇 Additional comments (1)
cmd/wtp/add.go (1)

113-114: LGTM! Change successfully achieves the PR objective.

Moving the success message to display after hook execution improves UX by ensuring the navigation guidance (wtp cd) appears at the bottom of the output where users expect it, eliminating the need to scroll when hooks produce significant output.

The implementation correctly preserves the existing behavior where hook failures are logged as warnings without blocking worktree creation.


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.

@MH4GF MH4GF marked this pull request as ready for review November 18, 2025 09:55
@MH4GF
Copy link
Contributor Author

MH4GF commented Nov 18, 2025

Hey @satococoa, I'd really appreciate it if you could review it!

@satococoa satococoa self-requested a review November 20, 2025 04:31
Copy link
Owner

@satococoa satococoa left a comment

Choose a reason for hiding this comment

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

Thank you!!
I'll merge this 👍 😄

@satococoa satococoa merged commit 7bf3c49 into satococoa:main Nov 20, 2025
6 checks passed
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.

Feature Request: Display worktree path after hooks execution

2 participants