IDE support file review bar changes - #104
Conversation
There was a problem hiding this comment.
🧪 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 patternapps/kilocode-docs/static/img/using-mcp-in-kilo-code/using-mcp-in-kilo-code-10.png: File hunk diff too largeapps/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, thereportLineMetricscall usesfirstEditedFile(the first pending edit's path) asfilePath, butlinesAdded,linesUpdated, andlinesDeletedare aggregated across ALL pending edits. This means the API receives aggregate line counts attributed to a single file, which is inconsistent withhandleAccept(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
handleAcceptbehavior), 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.logstatements added inreportLineMetricsfor 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") +
Context
Implementation
Screenshots
How to Test