feature: add AI-powered Git diff analysis for working tree and commit range comparison#2457
Open
YuHaoLiaoTony wants to merge 1 commit into
Open
feature: add AI-powered Git diff analysis for working tree and commit range comparison#2457YuHaoLiaoTony wants to merge 1 commit into
YuHaoLiaoTony wants to merge 1 commit into
Conversation
… range comparison - Add AIDiffContextBuilder with safe git command execution, SHA validation, large diff protection (100K chars / 3K lines), binary/LFS file skipping - Add DiffPrompts with 16-locale language mapping and two prompt templates - Add DiffAgent as thin AI API call layer reusing existing AI.Service - Add AIDiffAnalysis ViewModel with analysis state, cancellation, retry - Add model selection ComboBox matching existing AI commit message UX - Add MarkdownResultView to render AI output (headings, code, inline code) - Add working tree analysis button in CommitMessageToolBox toolbar - Add two-commit analysis via History context menu and RevisionCompare toolbar - Add 18 locale keys across all 15 locale files - Fix AIAssistant AIResponseView to enable WordWrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds an AI-powered Git diff analysis feature that lets users get a natural-language summary of their changes using their configured OpenAI-compatible AI service.
What's new
MarkdownResultViewcontrolArchitecture
All new code follows the existing MVVM and AI module patterns:
AI/layer:AIDiffContextData(data model),AIDiffContextBuilder(git command execution with SHA validation),DiffPrompts(prompt templates + locale mapping),DiffAgent(thin API call wrapper)ViewModels/AIDiffAnalysis.cs: state management, cancellation, retry, error mappingViews/AIDiffAnalysis.axaml+MarkdownResultView.axaml: popup dialog with Markdown renderingExisting file changes
Minimal modifications to 7 existing files:
RevisionCompare.cs: exposedGetSHA()andRepositoryproperty (internal → public)CommitMessageToolBox.axaml+.cs: one toolbar button + handlerHistories.axaml.cs: context menu item for 2-commit selection + helperRevisionCompare.axaml+.cs: one title bar button + handlerAIAssistant.axaml.cs: enabledWordWrapon AIResponseViewen_US.axaml+ 14 locale files: 18 new localization keys eachVerification
dotnet buildsucceeds (0 errors, 0 warnings)