feat(KB-617): add Changes tab to task detail modal with file diffs
- Add modifiedFiles and baseCommitSha fields to task schema for tracking changes - Capture list of modified files during task execution in the executor - Add GET /tasks/:id/diff API endpoint to retrieve file list and patches - Create TaskChangesTab component with expandable file diffs - Integrate Changes tab into TaskDetailModal for in-progress, in-review, and done tasks - Add CSS styles for diff viewer with syntax highlighting - Update API client with fetchTaskDiff function and Project Management types
This commit is contained in:
@@ -58,7 +58,7 @@ export function fromJson<T>(json: string | null | undefined): T | undefined {
|
||||
|
||||
// ── Schema Definition ────────────────────────────────────────────────
|
||||
|
||||
const SCHEMA_VERSION = 3;
|
||||
const SCHEMA_VERSION = 4;
|
||||
|
||||
const SCHEMA_SQL = `
|
||||
-- Tasks table with JSON columns for nested data
|
||||
@@ -75,6 +75,7 @@ CREATE TABLE IF NOT EXISTS tasks (
|
||||
blockedBy TEXT,
|
||||
paused INTEGER DEFAULT 0,
|
||||
baseBranch TEXT,
|
||||
baseCommitSha TEXT,
|
||||
modelPresetId TEXT,
|
||||
modelProvider TEXT,
|
||||
modelId TEXT,
|
||||
@@ -99,7 +100,8 @@ CREATE TABLE IF NOT EXISTS tasks (
|
||||
issueInfo TEXT,
|
||||
mergeDetails TEXT,
|
||||
breakIntoSubtasks INTEGER DEFAULT 0,
|
||||
enabledWorkflowSteps TEXT DEFAULT '[]'
|
||||
enabledWorkflowSteps TEXT DEFAULT '[]',
|
||||
modifiedFiles TEXT DEFAULT '[]'
|
||||
);
|
||||
|
||||
-- Config table (single row with project settings)
|
||||
@@ -322,6 +324,15 @@ export class Database {
|
||||
});
|
||||
}
|
||||
|
||||
if (version < 4) {
|
||||
this.applyMigration(4, () => {
|
||||
// Add modifiedFiles column to track files changed during agent execution
|
||||
this.addColumnIfMissing("tasks", "modifiedFiles", "TEXT DEFAULT '[]'");
|
||||
// Add baseCommitSha column to store the base commit for diff computation
|
||||
this.addColumnIfMissing("tasks", "baseCommitSha", "TEXT");
|
||||
});
|
||||
}
|
||||
|
||||
// Future migrations go here:
|
||||
// if (version < 3) { this.applyMigration(3, () => { ... }); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user