Skip to content

Conversation

dividedmind
Copy link
Contributor

Adds a new command appmap.quickReview that allows users to select a Git reference (branch, tag, or commit) as a base and initiate an AI-driven code review of the changes relative to that base via Navie. Integrates the command into the Navie tool window and the menu.

Note this is a port of getappmap/vscode-appland#1094

@dividedmind dividedmind self-assigned this Jul 1, 2025
@dividedmind dividedmind requested a review from jansorg July 1, 2025 17:05
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a “Quick Review” command that lets users pick a Git reference as a base and start an AI-driven code review via Navie. Integrates the new action into the plugin configuration, the Navie tool window, and the webview.

  • Added Git plugin dependency for Git ref lookup
  • Registered and wired up the appmap.quickReview action
  • Exposed a Quick Review button in the Navie tool window and updated webview handling

Reviewed Changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main/resources/META-INF/plugin.xml Added Git4Idea dependency
plugin-core/src/main/resources/messages/appland.properties Added property for quick review label
plugin-core/src/main/resources/META-INF/appmap-core.xml Registered quick review action in menu
plugin-core/src/main/java/appland/toolwindow/navie/NaviePanel.java Added Quick Review button and refactored button creation
plugin-core/src/main/java/appland/actions/QuickReviewAction.java Implemented action to fetch Git refs and launch review
appland-navie/webview.js Updated subscription logic for initial data
Comments suppressed due to low confidence (2)

plugin-core/src/main/resources/messages/appland.properties:283

  • The label "Review Your Code" differs from the action text "Quick Review". Rename this to "Quick Review" for consistency across the UI.
toolwindow.appmap.navie.quickReview=Review Your Code

plugin-core/src/main/java/appland/actions/QuickReviewAction.java:34

  • This new action contains nontrivial Git logic and UI interactions but lacks any unit or integration tests. Consider adding tests for ref fetching, dirty-state filtering, and popup selection callbacks.
public class QuickReviewAction extends AnAction implements DumbAware {

Copy link
Collaborator

@jansorg jansorg left a comment

Choose a reason for hiding this comment

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

Thanks! A great new feature :)
I added a few notes to the code, mostly minor.

With spring-petclinic on my setup the popup is as wide as my screen because one of the items is a multi-line item. The screenshot shows the popup and the culprit in the git log panel
image

@dividedmind
Copy link
Contributor Author

Thanks! A great new feature :) I added a few notes to the code, mostly minor.

Thanks! I'll read through them and address them.

With spring-petclinic on my setup the popup is as wide as my screen because one of the items is a multi-line item. The screenshot shows the popup and the culprit in the git log panel image

This isn't a well-formatted git commit message — git expects the subject to be separated by an empty line from the body, so here the whole thing end up in the subject. But I suppose people do all kinds of crazy stuff; might as well truncate if overlong. Will do, good catch!

BTW, why is it showing all those commits? My intent was to only show the (usually few) commits between the HEAD and the next named ref. Does it work correctly and it's just that there are this many in this repo?

Adds a new command `appmap.quickReview` that allows users to select a Git
reference (branch, tag, or commit) as a base and initiate an AI-driven code
review of the changes relative to that base via Navie. Integrates the command
into the Navie tool window and the menu.
@dividedmind dividedmind force-pushed the feat/review-button branch from 57b55e3 to eff9e48 Compare July 7, 2025 12:51
@dividedmind dividedmind requested a review from jansorg July 7, 2025 12:53
Copy link
Collaborator

@jansorg jansorg left a comment

Choose a reason for hiding this comment

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

The code looks better now. Thank you!

I tested it, but I couldn't make Navie do anything. After choosing a commit from popup of Git items, a new Navie window is opened but it just sits there without doing anything.

Is the suggestion property correct?

This JSON was sent to Navie:

{
  "type": "init",
  "appmapRpcPort": 36023,
  "apiKey": "Z2l0aHViQGphLWRldi5ldTpmNzVlMTA0Ni0yNjc2LTRmNWYtYTBjYy1kOTA2MzQxZGQxODE",
  "appmapYmlPresent": false,
  "savedFilters": [
    {
      "filterName": "AppMap default",
      "state": "eyJmaWx0ZXJzIjp7fX0",
      "default": false
    }
  ],
  "mostRecentAppMaps": [],
  "suggestion": {
    "label": "Quick Review",
    "prompt": "@review /base=7034d17"
  },
  "useAnimation": true,
  "preselectedModelId": "Copilot:claude-3.5-sonnet"
}

@dividedmind
Copy link
Contributor Author

The code looks better now. Thank you!

I tested it, but I couldn't make Navie do anything. After choosing a commit from popup of Git items, a new Navie window is opened but it just sits there without doing anything.

Is the suggestion property correct?

This JSON was sent to Navie:

{
  "type": "init",
  "appmapRpcPort": 36023,
  "apiKey": "Z2l0aHViQGphLWRldi5ldTpmNzVlMTA0Ni0yNjc2LTRmNWYtYTBjYy1kOTA2MzQxZGQxODE",
  "appmapYmlPresent": false,
  "savedFilters": [
    {
      "filterName": "AppMap default",
      "state": "eyJmaWx0ZXJzIjp7fX0",
      "default": false
    }
  ],
  "mostRecentAppMaps": [],
  "suggestion": {
    "label": "Quick Review",
    "prompt": "@review /base=7034d17"
  },
  "useAnimation": true,
  "preselectedModelId": "Copilot:claude-3.5-sonnet"
}

Yes, it's correct. Sometimes it seems to sit for a while and do nothing but it's actually working in the background — that's a different bug, I suppose. Could you give it another try with this in mind?

@jansorg
Copy link
Collaborator

jansorg commented Jul 11, 2025

I tried this again and this time a response was shown, i.e. it appears to be working as expected.

@jansorg
Copy link
Collaborator

jansorg commented Jul 11, 2025

@dividedmind Please let me know when you need a new review.

@dividedmind dividedmind requested a review from jansorg July 14, 2025 11:57
@jansorg jansorg mentioned this pull request Jul 15, 2025
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.

2 participants