Skip to content

feat(entities): merge entities from the list and the side panel, with undo - #384

Merged
adeelahmad merged 4 commits into
mainfrom
claude/project-thread-ecob6g
Oct 15, 2026
Merged

adeelahmad merged 4 commits into
mainfrom
claude/project-thread-ecob6g

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: the API could merge entities and undo it, but the web app had no way to do it outside Proposed changes. Two spellings of the same company stayed two entities unless someone used the API.

After: on the Entities page, editors tick rows and a bar at the bottom merges them into one in one click (it keeps the one on the fixed list, else the most mentioned; the arrow picks another) or gives them all one type. An entity's side panel has Merge: a find box where typing and Enter merges the picked entity into the open one. Its Maybe the same list shows likely doubles (same letters, acronyms, near spellings) with Merge and Not the same. Renaming an entity to a name another entity already has offers to merge them. Merges, bulk type changes and hiding happen at once and show Undo on the notice, so nothing asks to confirm.

How: a shared components/entities/curate.tsx (merge hook with Undo, EntityFind combobox, MergeInto, MaybeSame, keepOf) that the graph and the recording page reuse in the next PRs. EntityDrawer now looks up the namespace's types itself when not given, so it can open anywhere. On the backend, one entity's suggestions (GET /entities/suggestions?entity=) now compare only within its own namespace instead of every readable one.

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." This is the first of a few small PRs: entities page (this), then the graph explorer and canvas, topic undo, a recording's Entities tab, and agent tools.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests. (__tests__/entities-curate.test.tsx, tests/domain/test_entities.py)
  • My change requires documentation updates, and I have updated docs/ accordingly. (docs/processing.md)
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

Done questions (AGENTS.md)

  • Goal: delivers what the user wanted, merged on green CI. (first part; the graph explorer and canvas follow next)
  • Agents: usable through the API, MCP or an assistant tool. (uses the existing POST /entities/merge, /merges/{id}/undo, /retype, /not-same; MCP and assistant edit tools follow in their own PR)
  • Zero setup: no new prerequisite, .env edit or manual step.
  • Fewest clicks and keystrokes. (tick, tick, one click; or Merge, type, Enter; undo instead of confirm)
  • Configurable: n/a, no new setting.
  • Light: n/a, web UI only, no new dependency.
  • Private and secure: n/a, no new surface; same editor (curate) checks as before.
  • Cost: no model calls; suggestions for one entity now scan one namespace instead of all.
  • User decides: merges happen only when an editor picks them; defaults unchanged.
  • Upgrades: n/a, no change to stored data.
  • Honest: docs describe only what is merged here.
  • Tests, docs and generated files updated. (no API shape change, so no make openapi)
  • Open standards; dependencies keep Lens MIT. (no new dependency)
  • Result reported with evidence; "refine later" items written down. (refine later: bulk hide, and merging across pages beyond what is ticked is already kept by id)

🤖 Generated with Claude Code

https://claude.ai/code/session_01EzVhJCpwskyo5NhHEtS822


Generated by Claude Code

… undo

Tick rows on the Entities page to merge them into one (the one on the
fixed list, else the most mentioned) or give them one type. The side
panel gets Merge (a find box; Enter merges the pick into it), Maybe the
same (likely doubles with Merge and Not the same), and a merge offer
when a rename clashes. Merges, type changes and hiding have Undo on
their toast instead of a confirm. One entity's suggestions now look
only in its own namespace.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EzVhJCpwskyo5NhHEtS822
@adeelahmad adeelahmad self-assigned this Oct 15, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EzVhJCpwskyo5NhHEtS822
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EzVhJCpwskyo5NhHEtS822
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.

2 participants