Skip to content

Fixes #366: Add chat deletion controls - #401

Merged
govindavashishtha merged 10 commits into
truefoundry:mainfrom
rohanmalhotracodes:fix-chat-delete
Aug 25, 2026
Merged

Fixes #366: Add chat deletion controls#401
govindavashishtha merged 10 commits into
truefoundry:mainfrom
rohanmalhotracodes:fix-chat-delete

Conversation

@rohanmalhotracodes

@rohanmalhotracodes rohanmalhotracodes commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #366

Adds delete controls for persisted chat sessions from both the active chat header and chat history, with confirmation before deletion.
ss attached
Screenshot 2026-08-22 at 12 37 24 AM

Changes

  • Added a slotted DeleteChatButton for the current persisted chat.
  • Wired the TrueForge UI server adapter to the existing session delete API.
  • Added focused tests for delete visibility, confirmation, cancellation, exports, and adapter deletion.

How was this tested?

  • pnpm build
  • pnpm test
  • pnpm typecheck
  • pnpm lint:ci
  • pnpm format:check
  • Manual UI check in standalone dev server at http://localhost:3000/

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed

Note

Medium Risk
Introduces a destructive delete path to persisted sessions; impact is limited to explicit user actions and is gated on server.deleteSession being defined.

Overview
Implements remote chat session deletion in the TrueForge harness server adapter by adding deleteSession, which calls the SDK client.sessions.delete API so history delete actions (via assistant-ui ThreadListItemPrimitive.Delete) actually remove persisted sessions when the server supports it.

Chat history UI tweaks in ThreadListContainer: refreshes delete menu styling (rounded corners, medium weight, failure-tinted hover states), portals the desktop “more” menu into the nearest .aui-theme-root for correct theming, and applies font-sans-flex on the dropdown panel.

Adds a unit test that asserts the adapter issues DELETE /api/v1/sessions/{id}. Includes a patch changeset for @truefoundry/trueforge-ui.

Reviewed by Cursor Bugbot for commit d17add2. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d17add2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@truefoundry/trueforge-ui Patch
frontend Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ce273ee. Configure here.

Comment thread packages/trueforge-ui/src/containers/ThreadListContainer.tsx Outdated
Comment thread packages/trueforge-ui/src/atoms/DeleteChatButton.tsx Outdated
Comment thread packages/trueforge-ui/src/containers/ThreadListContainer.tsx Outdated
Comment thread packages/trueforge/src/routes/sessionRoutes.ts Outdated
@govindavashishtha

Copy link
Copy Markdown
Contributor

@rohanmalhotracodes Thanks for raising the PR but only a few changes were required to make the delete work.

  1. The UI layer is already there and works perfectly. Only thing required is attaching the deleteSession API in the packages/trueforge-ui/src/plugins/trueforge-agent-server-adapter/chatServer.ts file.

  2. A few CSS changes to beautify the "Delete Session" button

@vinit-truefoundry vinit-truefoundry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Also we can keep the header clean and collate delete and clear options into separate menu select

Comment thread packages/trueforge-ui/src/containers/ThreadListContainer.tsx Outdated
Comment thread packages/trueforge-ui/src/containers/ThreadListContainer.tsx Outdated
@rohanmalhotracodes

Copy link
Copy Markdown
Contributor Author
Screen.Recording.2026-08-24.at.5.25.57.PM.mov

@rohanmalhotracodes

Copy link
Copy Markdown
Contributor Author
Image Also we can keep the header clean and collate delete and clear options into separate menu select

Understood, also I wanted to ask can we maintain a figma file in the docs so that ui changes become easier ?

@govindavashishtha

Copy link
Copy Markdown
Contributor
Image Also we can keep the header clean and collate delete and clear options into separate menu select

Understood, also I wanted to ask can we maintain a figma file in the docs so that ui changes become easier ?

That's a good idea @rohanmalhotracodes, we are already working on this. I got the designs reviewed by our senior product designer and he is trying to keep things simple

  1. No need for any Delete flow from the Chat header, keep actions in the Sessions list item only
  2. Please refer to this - Fixes #366: Add chat deletion controls #401 (comment) I still feel the changes are a lot, keep an eye on this comment

@rohanmalhotracodes

Copy link
Copy Markdown
Contributor Author

@govindavashishtha
Screenshot 2026-08-24 at 7 02 50 PM
Screenshot 2026-08-24 at 7 02 30 PM
done, also shouldn't we add a rename chat button? and if in the future we add it to the header let me know I would like to pick it up.

@rohanmalhotracodes

Copy link
Copy Markdown
Contributor Author

Moreover, when the chat sidebar is minimized the arrow moves below the logo shouldn't it be something like the logo emains there and hovering on it show a arrow to open the sidebar

@rohanmalhotracodes

Copy link
Copy Markdown
Contributor Author
Image Also we can keep the header clean and collate delete and clear options into separate menu select

I will not be adding it to the header as mentioned by @govindavashishtha although I am open to adding it in the future when you guys allow me to. Also I have kept the fix minimal as I was too

@govindavashishtha
govindavashishtha enabled auto-merge (squash) August 25, 2026 10:00
@govindavashishtha
govindavashishtha merged commit b11cfc3 into truefoundry:main Aug 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

There is no way to delete a chat. The history grows without bound and users cannot remove conversations they would rather not keep.

6 participants