Skip to content

feat: add "View Diff" button to task actions#12149

Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/view-diff-on-task-complete
Draft

feat: add "View Diff" button to task actions#12149
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/view-diff-on-task-complete

Conversation

@roomote-v0
Copy link
Copy Markdown
Contributor

@roomote-v0 roomote-v0 bot commented Apr 18, 2026

Related GitHub Issue

Closes: #10976

Description

This PR attempts to address Issue #10976 by adding a "View Diff" button to the task actions toolbar. The button shows all file changes made since the task started by leveraging the existing checkpoint diff infrastructure.

Key implementation details:

  • Added a DiffIcon button to TaskActions.tsx that appears when checkpoints are enabled and at least one checkpoint exists
  • Uses the existing checkpointDiff message with mode: "full" to diff from the first checkpoint to the current working state
  • Safely handles cases where clineMessages may be undefined
  • No backend changes needed -- reuses existing checkpoint diff functionality

Files changed:

  • webview-ui/src/components/chat/TaskActions.tsx -- Added View Diff button with checkpoint detection logic
  • webview-ui/src/i18n/locales/en/chat.json -- Added translation string for the button tooltip
  • webview-ui/src/components/chat/__tests__/TaskActions.spec.tsx -- Added 4 test cases covering rendering and click behavior

Feedback and guidance are welcome.

Test Procedure

  • All 29 existing + new TaskActions tests pass
  • All 25 checkpoint tests pass
  • Lint and type checks pass across the entire monorepo
  • New tests cover: button visibility with/without checkpoints, button visibility with checkpoints disabled, and correct message payload on click

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes.
  • Documentation Impact: No documentation updates are required.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

No documentation updates are required.

Additional Notes

The button is only visible when checkpoints are enabled and at least one checkpoint has been saved during the task. It uses the "full" diff mode which compares the first checkpoint (initial state) against the current working directory state.

Interactively review PR in Roo Code Cloud

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.

[ENHANCEMENT] Add a final "view diff" upon finishing a task

1 participant