Skip to content
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

Use DiffEditor DiffNavigator to navigate diffs #14889

Conversation

colin-grant-work
Copy link
Contributor

@colin-grant-work colin-grant-work commented Feb 10, 2025

What it does

Fixes #14888 by adding diff navigation commands to the toolbar of diff editors and using the existing diff navigator tool in MonacoDiffEditors to navigate among changes.

How to test

  1. Open a diff editor with some changes.

Common ways to do this: modify a file and then open it from the source control view; use the 'select for comparison...compare with selected' commands in the file tree; using the AI chat features, ask the @Coder agent to make modifications.

  1. You should see up and down arrows on the toolbar, and clicking them should take to the next / previous change in the file, as appropriate.
  2. If you open a diff editor with no differences, the arrows should appear, but they should be greyed out.

@ reviewers, there was relevant work in #13104, but since that was mostly related to @theia/git, I'm not sure the machinery implemented there is relevant anymore. The code here just skips that machinery in the case that I believe I know how to handle better, but possibly it's just no longer necessary. In particular, I'm not sure how we would have a diff in an editor with a file scheme.

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

@colin-grant-work colin-grant-work force-pushed the feature/diff-navigation branch 2 times, most recently from be5109a to bcea1ff Compare February 10, 2025 23:10
Copy link
Contributor

@rschnekenbu rschnekenbu left a comment

Choose a reason for hiding this comment

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

LGTM, @colin-grant-work. Thanks for contribution!

@colin-grant-work colin-grant-work merged commit 55ff28b into eclipse-theia:master Feb 18, 2025
9 of 11 checks passed
@colin-grant-work colin-grant-work deleted the feature/diff-navigation branch February 18, 2025 14:59
@github-actions github-actions bot added this to the 1.59.0 milestone Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Enable change navigation in diff editors
2 participants