Skip to content

Select and delete chat conversations in bulk - #362

Merged
mattshax merged 1 commit into
mainfrom
chat-bulk-delete
Oct 2, 2026
Merged

mattshax merged 1 commit into
mainfrom
chat-bulk-delete

Conversation

@mattshax

@mattshax mattshax commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Select and delete chat conversations in bulk (#362)

The chat package's rail deletes conversations one at a time. Until it can select several, the Studio adds a Select chats row to the rail, under New chat and Attachments, which opens a panel in the main pane like the package's Attachments page.

The panel. Every conversation with a checkbox, its date, and message count; All (or All shown, when filtered); a title filter; shift-click to set a range; Delete N, which asks for confirmation on the page and then removes them in one request. Clicking a title opens that conversation. If the open conversation is among those deleted, the view returns to a new chat. Done, or any rail navigation, closes the panel.

Who can delete what. Only the viewer's own conversations, or ones with no owner. Under shared history the viewer can see others' conversations; those rows are listed but cannot be selected, and the server applies the same rule: POST /api/chat/conversations/delete with {ids} deletes what the caller owns, removes those transcripts from the knowledge base, reindexes once, and returns {deleted, skipped}.

The rail row. The package has no slot for extra rail rows, so the row is portaled into the group that holds New chat, styled like its neighbors, with its label class copied from New chat so it collapses with the rail; a mutation observer re-attaches it if the package re-renders that group.

Conversation history is saved atomically. The server rewrote conversations.json in place, so a crash, or a read, in the middle of a save saw an empty file, and load() treats an unreadable file as having no conversations; the next save would have kept it empty. It now writes a temporary file and renames it into place. The new bulk-delete test found this: it read the file during a save, about one run in twenty-five.

Verified in headless Chrome against a seeded instance: the row appears in the rail, eight conversations listed, a shift range selects four, the confirmation names the count, deletion leaves the rest in the panel, the rail, and on the server, with no page errors. Two new server tests (the ownership rule with shared history on, and refusal of an empty list); 40 consecutive runs of the bulk-delete test pass. All server and web tests pass.

@mattshax
mattshax merged commit 5297976 into main Oct 2, 2026
2 checks passed
@mattshax
mattshax deleted the chat-bulk-delete branch October 2, 2026 16:39
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