Skip to content

Tag management: rename and merge tags via /tags UI #24

@unforced

Description

@unforced

Why

Today /tags lists tags with counts but offers no way to act on them. Renaming a tag across a vault (e.g., #todo#task) requires editing every note by hand. Merging two tags into one is the same pain doubled.

Vault already exposes update-tag as an MCP/HTTP tool. This issue is about surfacing it in Lens.

Scope

  • Rename: on each /tags row, a "Rename" action. Modal prompt: new name (autocompletes against existing tags; warns if target exists and offers to merge instead). Confirm → call vault's update-tag with rename semantics.
  • Merge: multi-select on /tags rows, "Merge into…" action picks the survivor tag. Confirm → vault retags all notes carrying the merged tags to the survivor; deletes the now-empty source tags.
  • Both operations: optimistic UI update, rollback on vault error, toast on success ("Renamed XY across N notes").
  • Sync queue: rename/merge are online-only for v0.3 (require a live vault call). Don't enqueue offline; show a clear "offline — reconnect to manage tags" state.

Edge cases

  • Renaming a tag to itself: no-op, UI should prevent it
  • Renaming to a tag that exists: surface the merge option, don't silently merge
  • Merge with more than 5 source tags: show a confirmation that names each one
  • If vault errors mid-merge (partial retag): surface clearly with recovery guidance

Tests

  • Rename happy path (mocked vault)
  • Rename-to-existing triggers merge prompt
  • Merge happy path
  • Error rollback

Out of scope

  • Tag hierarchy (vault-level question, separate track)
  • Bulk tag operations on note selections (different flow — "add/remove tag from these 10 notes")
  • Tag descriptions / schemas (future)

Priority

High. One of the top quality-of-life features for anyone who's used their vault a few weeks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions