Skip to content

IDE support file review bar changes - #104

Merged
code-crusher merged 1 commit into
mainfrom
release/v6.5.9
Jul 21, 2026
Merged

IDE support file review bar changes#104
code-crusher merged 1 commit into
mainfrom
release/v6.5.9

Conversation

@code-crusher

Copy link
Copy Markdown
Member

Context

Implementation

Screenshots

before after

How to Test

@matterai-app

matterai-app Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Context

This PR enhances the IDE's file review experience by introducing granular navigation between diff hunks and implementing telemetry for code change metrics.

Implementation

Summary By MatterAI MatterAI logo

🔄 What Changed

Refactored the file review message handling to use VS Code commands, added granular 'Next/Previous Change' navigation within files using Myers diff, and implemented a telemetry reporting system (reportLineMetrics) that sends line-level change data to the Kilocode API.

🔍 Impact of the Change

Users can now navigate precisely between specific code changes rather than just files, improving the review workflow. The business gains visibility into tool efficacy through automated reporting of lines added, updated, and deleted during reviews.

📁 Total Files Changed

Click to Expand
File ChangeLog
Refactor Handler webviewMessageHandler.ts Replaced inline logic with axon-code.fileEdit.acceptAll command call.
Review Logic FileEditReviewController.ts Added navigation commands, hunk-level jumping, and telemetry reporting.
Navigation Utils fileEditReviewNavigation.ts New utility to compute diff line numbers and find adjacent changes.
Unit Tests fileEditReviewNavigation.spec.ts Added tests for diff line calculation and navigation wrapping logic.
Version Bump package.json Updated extension version to 6.5.9.

🧪 Test Added/Recommended

Added

  • fileEditReviewNavigation.spec.ts: Validates hunk detection within single edits, adjacent line grouping, and directional wrapping logic.

Recommended

  • Integration tests for the reportLineMetrics flow to ensure correct API payload construction.
  • Edge case testing for extremely large files to ensure myersDiff performance remains acceptable.

🔒 Security Vulnerabilities

N/A. Telemetry uses existing kilocodeToken for authentication and performs null checks before transmission.

Screenshots

before after
N/A N/A

How to Test

  • Open a file with pending AI edits.
  • Use the new 'Next Change' and 'Previous Change' commands to jump between specific diff hunks.
  • Accept all changes and verify (via logs) that reportLineMetrics is triggered with correct line counts.
  • Verify the extension version is 6.5.9 in the Extensions view.

@code-crusher
code-crusher merged commit 073d886 into main Jul 21, 2026
1 of 8 checks passed
@code-crusher
code-crusher deleted the release/v6.5.9 branch July 21, 2026 10:17

@matterai-app matterai-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧪 PR Review is completed: PR adds file review navigation utilities, refactors metrics reporting into a reusable method, and adds change-level navigation. The new navigation logic and tests are solid, but the accept-all metrics reporting attributes aggregate line counts to a single file path, which may cause incorrect data attribution.

Skipped files
  • CHANGELOG.md: Skipped file pattern
  • apps/kilocode-docs/static/img/using-mcp-in-kilo-code/using-mcp-in-kilo-code-10.png: File hunk diff too large
  • apps/kilocode-docs/static/img/v3.11/v3.11-1.png: File hunk diff too large
⬇️ Low Priority Suggestions (2)
src/integrations/editor/FileEditReviewController.ts (2 suggestions)

Location: src/integrations/editor/FileEditReviewController.ts (Lines 568-575)

🟡 Data Integrity / NEEDS_DISCUSSION

Issue: In handleAcceptAll, the reportLineMetrics call uses firstEditedFile (the first pending edit's path) as filePath, but linesAdded, linesUpdated, and linesDeleted are aggregated across ALL pending edits. This means the API receives aggregate line counts attributed to a single file, which is inconsistent with handleAccept (line 393-399) which reports per-file metrics with the correct file path and line counts.

Fix: Either report metrics per-file in a loop (matching handleAccept behavior), or clarify with the backend whether the endpoint accepts aggregate task-level metrics with a representative file path.

Impact: Prevents incorrect metrics attribution that could skew analytics or billing data.

-  		if (firstEditedFile) {
-  			await this.reportLineMetrics({
-  				filePath: firstEditedFile,
-  				linesAdded,
-  				linesUpdated,
-  				linesDeleted,
-  			})
-  		}
+  		for (const edit of this.pendingEdits.values()) {
+  			const filePath = edit.absolutePath
+  			let fileLinesAdded = 0
+  			let fileLinesUpdated = 0
+  			let fileLinesDeleted = 0
+  			for (const editEntry of edit.edits) {
+  				const diffLines = myersDiff(editEntry.originalContent, editEntry.newContent)
+  				for (const diffLine of diffLines) {
+  					if (diffLine.type === "new") fileLinesAdded++
+  					else if (diffLine.type === "removed") fileLinesDeleted++
+  				}
+  			}
+  			await this.reportLineMetrics({
+  				filePath,
+  				linesAdded: fileLinesAdded,
+  				linesUpdated: fileLinesUpdated,
+  				linesDeleted: fileLinesDeleted,
+  			})
+  		}

Location: src/integrations/editor/FileEditReviewController.ts (Lines 416-422)

🔵 Logging

Issue: Debug console.log statements added in reportLineMetrics for missing token and missing taskId cases. These will clutter production logs.

Fix: Remove or replace with a proper logging utility that can be disabled in production.

Impact: Cleaner production logs

-  			console.log("[FileEditReviewController] No kilocodeToken available, skipping metrics reporting")
-  			return
-  		}
-  
-  		const taskId = metrics.taskId || this._taskId
-  		if (!taskId) {
-  			console.log("[FileEditReviewController] No taskId available, skipping metrics reporting")
+  

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.

1 participant