Skip to content

feat: Add delete chat button with VS Code dialog confirmation#185

Open
turbolego wants to merge 2 commits into
ggml-org:masterfrom
turbolego:feature/delete-chat-button
Open

feat: Add delete chat button with VS Code dialog confirmation#185
turbolego wants to merge 2 commits into
ggml-org:masterfrom
turbolego:feature/delete-chat-button

Conversation

@turbolego
Copy link
Copy Markdown

@turbolego turbolego commented May 15, 2026

Overview

Adds a delete chat button to the llama-vscode extension to help users manage conversation history and free up context window tokens.

Skjermbilde 2026-05-15 kl  16 11 40 Skjermbilde 2026-05-15 kl  16 11 27

Changes

  • UI Enhancement: Added trash can emoji button (🗑️) to chat header for deleting the current conversation
  • Dialog: Uses VS Code's native showWarningMessage API with modal dialog for user confirmation
  • Backend: Implements deleteCurrentChat() handler in llama-webview-provider
  • Feedback: Shows chat name in confirmation and provides user-friendly status messages
  • Cleanup: Properly integrates with persistence layer to remove chat from saved history and clears UI

Problem Solved

Chat history accumulates tokens in memory on each message exchange. This causes the context window to fill up faster, leaving less room for model generation. Users can now easily delete old conversations to reclaim context tokens.

Testing

  • Delete button appears in chat header (next to "Chats History")
  • Clicking it shows a warning dialog: "Delete chat "ChatName"?"
  • Clicking "Delete" removes chat from history and clears the UI
  • Shows success message after deletion
  • Clicking "Cancel" leaves chat unchanged

Files Changed

  • ui/src/components/AgentView.tsx: Added delete button and handler
  • src/llama-webview-provider.ts: Added deleteCurrentChat() method
  • package-lock.json: Updated dependencies

Related Issues

This addresses the context window consumption problem where chat history accumulates tokens unnecessarily.

- Add trash can emoji button (🗑️) to chat header for deleting current conversation
- Use VS Code's showWarningMessage API with modal dialog for confirmation
- Implements deleteCurrentChat() handler in llama-webview-provider
- Shows chat name in confirmation dialog and provides user feedback
- Properly integrates with persistence layer to remove chat from history
- Clears UI after successful deletion

Fixes issue where chat history accumulates tokens, consuming context window.
Users can now easily manage and delete old conversations to free up context.
@turbolego turbolego force-pushed the feature/delete-chat-button branch from 030ae47 to 721a609 Compare May 15, 2026 19:02
- Add trash can emoji button (🗑️) in AgentView header
- Implement deleteCurrentChat handler in llama-webview-provider
- Implement deleteCurrentChat method in ChatService with logging
- Delete current chat with confirmation from persistence
- Clear chat view after successful deletion
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