Skip to content

feat(web): rename tag labels from the tag picker - #537

Merged
EyJunge1 merged 1 commit into
tickernelz:v3from
FellixFernando:feat/tag-labels
Dec 4, 2026
Merged

EyJunge1 merged 1 commit into
tickernelz:v3from
FellixFernando:feat/tag-labels

Conversation

@FellixFernando

Copy link
Copy Markdown
Contributor

Summary

The tag picker labels project tags with the project root path (C:\Users\me\code\avenma-property), because every capture stores the root as display_name. There was no way to rename a tag.

This adds a tag-level label:

  • Storage: a new tag_labels table in metadata.db (schema v2). A label is one row keyed by container_tag, not a rewrite of every memory.
  • Read: handleListTags overlays those labels onto the existing distinct-tag rows.
  • Write: PUT /api/tags upserts a label. The container tag must match {prefix}_{project|user}_{16 hex}, the label is trimmed of control characters, required, and capped at 120 chars.
  • UI: a pencil button on each tag in the filter dropdown opens an inline input (Enter saves, Escape cancels).

Storing the label separately matters: renaming by rewriting display_name on the existing rows would be undone the next time a capture inserted a row carrying the project path again. tests/api-handlers-tag-labels.test.ts covers exactly that sequence.

Independent of #536. That one improves the default label (project name instead of path); this one lets a user override it. Either can merge first.

Before After
default path path (#536 changes this to the project name)
after renaming no way the chosen label, surviving later captures

Test plan

  • bun test tests/api-handlers-tag-labels.test.ts — 4 pass: malformed tag rejected, empty/oversized label rejected, label returned by handleListTags, label survives a later capture that inserts a path display_name
  • bun run check (format, lint, typecheck)
  • bun run build
  • bun test full suite: same 3 failures as unmodified main on this machine (config default, onnxruntime shim, plugin loader bundle boundary), no new failures
  • Exercised locally: renamed a project tag in the picker, label persisted across a restart

Known limitations

  • Labels are per tag, not per memory. Every memory in that project shares the label, which is what the picker shows.
  • Two new English keys only (btn-rename-tag, btn-save-tag-label). Other locales fall back to English until translated.
  • No delete/reset for a label yet; renaming again overwrites it.

Copilot AI balanced review requested due to automatic review settings December 1, 2026 10:08

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@lindixu6-hash lindixu6-hash left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the work on this. The tag_labels approach reads cleanly and the rename flow makes sense. Because this introduces a schema change (v2) and a new PUT /api/tags endpoint, it needs a maintainer decision before merge. A couple of points worth covering in the meantime: how existing tags are migrated/backfilled on upgrade, and whether the old label behaviour stays backwards compatible for installs that never rename a tag.

Store custom labels in metadata.db so renames survive later captures, expose PUT /api/v2/tags, and add an inline rename control in the tag picker.
@EyJunge1
EyJunge1 changed the base branch from main to v3 December 4, 2026 08:56
@EyJunge1
EyJunge1 merged commit e138118 into tickernelz:v3 Dec 4, 2026
1 check passed
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.

4 participants