Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit 0e78977

Browse files
nikomatsakisClaude
andcommitted
Add finishing touches to walkthrough system
- Added clear button to walkthrough header for dismissing content and comments - Removed 'Code Review' section from sidebar (only Walkthrough remains) - Updated extension metadata to reflect walkthrough focus - Clear button properly disposes comment threads and resets state The walkthrough system is now complete with clean UI and proper cleanup. Co-authored-by: Claude <[email protected]>
1 parent ba86eea commit 0e78977

File tree

2 files changed

+72
-7
lines changed

2 files changed

+72
-7
lines changed

extension/package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "dialectic",
3-
"displayName": "Dialectic Code Reviews",
4-
"description": "AI-powered code review panel for collaborative development",
3+
"displayName": "Dialectic Walkthroughs",
4+
"description": "AI-powered code walkthroughs for collaborative development",
55
"version": "0.1.0",
66
"publisher": "socratic-shell",
77
"repository": {
@@ -75,10 +75,6 @@
7575
},
7676
"views": {
7777
"dialectic": [
78-
{
79-
"id": "dialectic.syntheticPR",
80-
"name": "Code Review"
81-
},
8278
{
8379
"id": "dialectic.walkthrough",
8480
"name": "Walkthrough",

extension/src/walkthroughWebview.ts

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ export class WalkthroughWebviewProvider implements vscode.WebviewViewProvider {
176176

177177
private async handleWebviewMessage(message: any): Promise<void> {
178178
switch (message.command || message.type) {
179+
case 'clearWalkthrough':
180+
console.log('Walkthrough: clearWalkthrough command received');
181+
await this.clearWalkthrough();
182+
break;
179183
case 'openFile':
180184
console.log('Walkthrough: openFile command received:', message.dialecticUrl);
181185
await openDialecticUrl(message.dialecticUrl, this.outputChannel, this.baseUri, this.placementMemory);
@@ -207,6 +211,36 @@ export class WalkthroughWebviewProvider implements vscode.WebviewViewProvider {
207211
}
208212
}
209213

214+
/**
215+
* Clear the walkthrough and dismiss any active comments
216+
*/
217+
private async clearWalkthrough(): Promise<void> {
218+
console.log('[WALKTHROUGH] Clearing walkthrough and comments');
219+
220+
// Clear any active comment threads
221+
if (this.commentController) {
222+
// Dispose all comment threads
223+
this.commentController.dispose();
224+
225+
// Recreate the comment controller for future use
226+
this.commentController = vscode.comments.createCommentController(
227+
'dialectic-walkthrough',
228+
'Dialectic Walkthrough'
229+
);
230+
231+
// Set options to enable submit button
232+
this.commentController.options = {
233+
prompt: 'Ask Socratic Shell...',
234+
placeHolder: 'Type your question or comment here...'
235+
};
236+
}
237+
238+
// Clear placement memory
239+
this.placementMemory.clear();
240+
241+
this.outputChannel.appendLine('Walkthrough cleared');
242+
}
243+
210244
/**
211245
* Show comment using VSCode CommentController with context-aware file opening
212246
*/
@@ -939,6 +973,31 @@ export class WalkthroughWebviewProvider implements vscode.WebviewViewProvider {
939973
padding: 16px;
940974
line-height: 1.5;
941975
}
976+
.walkthrough-header {
977+
display: flex;
978+
justify-content: space-between;
979+
align-items: center;
980+
margin-bottom: 20px;
981+
padding-bottom: 12px;
982+
border-bottom: 1px solid var(--vscode-panel-border);
983+
}
984+
.walkthrough-title {
985+
font-size: 1.2em;
986+
font-weight: 600;
987+
color: var(--vscode-textLink-foreground);
988+
}
989+
.clear-button {
990+
background-color: var(--vscode-button-secondaryBackground);
991+
color: var(--vscode-button-secondaryForeground);
992+
border: none;
993+
padding: 6px 12px;
994+
border-radius: 3px;
995+
cursor: pointer;
996+
font-size: 0.9em;
997+
}
998+
.clear-button:hover {
999+
background-color: var(--vscode-button-secondaryHoverBackground);
1000+
}
9421001
.section {
9431002
margin-bottom: 24px;
9441003
}
@@ -1092,6 +1151,10 @@ export class WalkthroughWebviewProvider implements vscode.WebviewViewProvider {
10921151
</style>
10931152
</head>
10941153
<body>
1154+
<div class="walkthrough-header">
1155+
<div class="walkthrough-title">Code Walkthrough</div>
1156+
<button class="clear-button" id="clear-walkthrough">Clear</button>
1157+
</div>
10951158
<div id="content">
10961159
<div class="empty-state">No walkthrough loaded</div>
10971160
</div>
@@ -1335,7 +1398,13 @@ export class WalkthroughWebviewProvider implements vscode.WebviewViewProvider {
13351398
13361399
// Add event listener for action button clicks (CSP-compliant)
13371400
document.addEventListener('click', (event) => {
1338-
if (event.target.tagName === 'BUTTON' &&
1401+
if (event.target.id === 'clear-walkthrough') {
1402+
// Clear walkthrough and dismiss comments
1403+
document.getElementById('content').innerHTML = '<div class="empty-state">No walkthrough loaded</div>';
1404+
vscode.postMessage({
1405+
type: 'clearWalkthrough'
1406+
});
1407+
} else if (event.target.tagName === 'BUTTON' &&
13391408
event.target.classList.contains('action-button') &&
13401409
event.target.dataset.tellAgent) {
13411410
handleAction(event.target.dataset.tellAgent);

0 commit comments

Comments
 (0)