feat(f7): register showTrackChangesPreview command + keybinding, wire controller (#21)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Ben Stull
2026-06-11 08:46:49 -07:00
parent 8bf4b17e4a
commit 1ab3cc5348
2 changed files with 30 additions and 1 deletions
+20 -1
View File
@@ -8,6 +8,7 @@ import { buildFingerprint } from "./anchorer";
import { VersionGuard } from "./versionGuard";
import { BaselineStore } from "./baselineStore";
import { DiffViewController } from "./diffViewController";
import { TrackChangesPreviewController } from "./trackChangesPreview";
const CHANNEL_NAME = "Cowriting (Cline SDK)";
@@ -17,6 +18,7 @@ export interface CowritingApi {
proposalController: ProposalController;
versionGuard: VersionGuard;
diffViewController: DiffViewController;
trackChangesPreviewController: TrackChangesPreviewController;
}
export function activate(context: vscode.ExtensionContext): CowritingApi | undefined {
@@ -56,6 +58,16 @@ export function activate(context: vscode.ExtensionContext): CowritingApi | undef
const diffViewController = new DiffViewController(baselineStore);
context.subscriptions.push(diffViewController);
// --- F7: rendered track-changes preview (Feature #21) — workspace-INDEPENDENT ---
// Like F6, F7 works on any markdown doc (incl. untitled / out-of-folder), so it
// is constructed regardless of an open folder and its command is always live.
// It reuses the F6 baseline (INV-20) and adds no persistence.
const trackChangesPreviewController = new TrackChangesPreviewController(
diffViewController,
context.extensionUri,
);
context.subscriptions.push(trackChangesPreviewController);
// --- F2: region-anchored threads (Feature #4) ---
const root = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath;
if (!root) {
@@ -259,7 +271,14 @@ export function activate(context: vscode.ExtensionContext): CowritingApi | undef
vscode.workspace.textDocuments.forEach(renderIfOpen);
context.subscriptions.push(vscode.workspace.onDidOpenTextDocument(renderIfOpen));
return { threadController, attributionController, proposalController, versionGuard, diffViewController };
return {
threadController,
attributionController,
proposalController,
versionGuard,
diffViewController,
trackChangesPreviewController,
};
}
export function deactivate(): void {