Repository navigation
feat(topics): merge and delete topics at once, with undo - #387
Merged
Merged
Conversation
Merges and deletes keep what they changed in topic_change, so either can
be taken back: the topics return with their ids, labels, recordings,
broader and related lists and note pages, and a topic made from an entity
hides it again. The drawer merges through a find box and deletes without
a confirm dialog, with Undo on the notice; topics merge on the graph
canvas too. GET /namespaces/{name}/topics/changes lists recent ones and
POST /topics/changes/{id}/undo takes one back.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EzVhJCpwskyo5NhHEtS822
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: merging topics meant a dialog with a checklist and a confirm step, deleting one asked "are you sure?", and neither could be taken back. Topics couldn't be merged on the graph canvas.
After: a topic's drawer has Merge (a find box: type, Enter) and Delete, and each happens at once with Undo on its notice. Undo brings the topics back with their ids, labels, recordings, broader and related topics and note pages, and a topic made from an entity hides that entity again. On the graph, "Merge into another…" now joins two topics of one namespace too.
How: merges and deletes record what they changed in a new
topic_changetable (app/domain/topics.py:_remember,changes,undo). The merge and delete endpoints answer with anundoid;GET /api/v1/namespaces/{name}/topics/changeslists recent changes andPOST /api/v1/topics/changes/{id}/undotakes one back (refused with a reason when another topic took the label meanwhile). The frontend getscomponents/topics/curate.tsx(useTopicChanges,TopicFind,TopicMergeInto) and a genericcomponents/ui/find-box.tsxthat the entity find box now uses too.components/graph/join.tsgains the topic plan.Motivation and Context
Adeel: "No easy way to merge and edit entities, topics etc. Should be as easy as from the graph explorer and canvas." Third of a few small PRs after the entities page (#384) and the graph (#386); a recording's Entities tab and agent tools follow.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).tests/api/test_topics.pyundo of a merge, a delete, and a topic made from an entity;__tests__/topics-curate.test.tsx;__tests__/graph-curate.test.ts)docs/accordingly. (docs/topics.md,docs/graph.md)## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
undo; the changes list and undo endpoints). MCP tools come in their own PR..envedit or manual step; the table is defined at start like the others.IF NOT EXISTSon start, safe to run twice; existing topics are untouched.make openapitooling regeneratedopenapi.jsonand the client)docs/topics.md: a page of past topic changes to undo after the notice; multi-select merge on the Topics page)🤖 Generated with Claude Code
https://claude.ai/code/session_01EzVhJCpwskyo5NhHEtS822
Generated by Claude Code