Skip to content

Per-vault tag roles (pinned / archived / capture defaults)#34

Merged
unforced merged 1 commit intomainfrom
tag-roles
Apr 19, 2026
Merged

Per-vault tag roles (pinned / archived / capture defaults)#34
unforced merged 1 commit intomainfrom
tag-roles

Conversation

@unforced
Copy link
Copy Markdown
Contributor

Summary

  • New TagRoles primitive (src/lib/vault/tag-roles.ts) — per-vault JSON in localStorage (lens:tag-roles:<vaultId>), mirrors the scribe-settings pattern. Roles: pinned, archived, captureVoice, captureText.
  • TagRolesSection in Settings with inputs for each role, shared <datalist> autocomplete from the vault's existing tag list, Save / Reset, and a "changes apply to new notes only" note.
  • TextCapture and MemoCapture now read defaults from useTagRoles(vaultId) instead of hardcoding "quick" / "memo".
  • CLAUDE.md documents the pattern so future role-bearing features (pinned/archived views, etc.) reuse this primitive.

Notes on defaults

Per the issue spec, the voice-capture default is voice (the issue listed this as an explicit default). Existing code used the literal "memo"; any current user who wants that back can set it in Settings. Pinned/archived defaults are the role names themselves, matching the issue.

Out of scope

  • First-connect "scan existing tags and suggest role mappings" UX. The scope bullets in the issue cover the store, the settings section, and the capture refactor — the suggest-on-first-connect UX is a nice-to-have and a good follow-up. Users can open Settings after first connect to customize.

Closes #23

Test plan

  • bun run lint — clean
  • bun run typecheck — clean
  • bun run test — 338/338 (49 files). Adds tag-roles storage tests (8) and two Settings UI tests for TagRolesSection (save overrides, reset to defaults).
  • bun run build — clean
  • Manual: change a role in Settings; verify next text + voice capture uses the new tag; verify existing notes are not retagged.

🤖 Generated with Claude Code

Introduces `TagRoles` — a per-vault JSON configuration mapping four
semantic roles (`pinned`, `archived`, `captureVoice`, `captureText`) to
tag names. Features that previously hardcoded tag strings now read the
role from `useTagRoles(vaultId)` so each vault can keep its own
conventions.

- New `src/lib/vault/tag-roles.ts` — type, defaults, load/save/delete,
  and a `useTagRoles` hook that mirrors the scribe-settings pattern.
- New `TagRolesSection` in Settings with per-role inputs, a shared
  `<datalist>` populated from the vault's existing tags for
  autocomplete, Save / Reset to defaults, and a "changes apply to new
  notes only" note.
- `TextCapture` and `MemoCapture` now read `captureText` / `captureVoice`
  from the stored roles. Voice capture's default tag is now `voice`
  (was hardcoded `memo`) per the issue spec — users who want the old
  tag can change it in Settings.
- CLAUDE.md documents the pattern so future role-bearing features
  (pinned/archived views, etc.) reuse the primitive.

Closes #23

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@unforced unforced merged commit da2e2e8 into main Apr 19, 2026
@unforced unforced deleted the tag-roles branch April 19, 2026 21:44
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.

Customizable tag roles — per-vault settings for capture / pinned / archived / etc.

1 participant