Skip to content

Comments

feat: add delete chat button#364

Open
erkin98 wants to merge 1 commit intojupyterlab:mainfrom
erkin98:feat/delete-chat-button
Open

feat: add delete chat button#364
erkin98 wants to merge 1 commit intojupyterlab:mainfrom
erkin98:feat/delete-chat-button

Conversation

@erkin98
Copy link

@erkin98 erkin98 commented Feb 19, 2026

Closes #328

This adds a way to delete chats directly from the side panel (via a trash icon in the section toolbar) and from the file browser context menu.

When you click the trash icon, a confirmation dialog pops up before anything gets deleted. The actual deletion goes through contents.delete(), and the existing fileChanged handler already takes care of refreshing the chat list and cleaning up the side panel section — so no extra cleanup logic was needed.

I followed the same patterns already used by the rename feature: optional callback passed through MultiChatPanelChatSection, guarded with an if (options.deleteChat) check, and using Dialog.warnButton for the confirmation (standard JupyterLab approach for destructive actions).

What changed:

  • token.ts — added deleteChat command ID
  • multichat-panel.tsx — delete button with confirmation dialog, disposal on success
  • index.ts — command registration + callback wiring
  • commands.json — context menu entry for .chat files

Testing:

  • Open the side panel with a few chats, click the trash icon, confirm → chat gets removed
  • Cancel the dialog → nothing happens
  • Right-click a .chat file in the file browser → "Delete chat" option works
  • Delete a chat that's also open in the main area → should clean up properly

Closes jupyterlab#328

Add the ability to delete chats from both the side panel toolbar and
the file browser context menu. The delete action shows a confirmation
dialog before removing the .chat file via ContentsManager.

Changes:
- Add deleteChat command ID to token.ts
- Add delete toolbar button with trash icon and warn dialog to ChatSection
- Register deleteChat command in extension plugin using contents.delete()
- Wire deleteChat callback into MultiChatPanel creation
- Add context menu entry for .chat files in file browser
@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branch erkin98/jupyter-chat/feat%2Fdelete-chat-button

@nakul-py
Copy link
Contributor

@erkin98 Thanks for the work! But i think #328 is still in discussion.

@erkin98
Copy link
Author

erkin98 commented Feb 19, 2026

@erkin98 Thanks for the work! But i think #328 is still in discussion.

no worries man, i already using it locally so i think it could be useful

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.

Chat Delete button

2 participants