AGENTS.md@packages/client/src/components/tags · git:20260722.612d761 · 2026-07-22 · sha256 91650bd90ef40cff

AGENTS.md@packages/client/src/components/tags git:20260722.612d761A

Immutable. This exact content is served forever at /api/v1/blob/91650bd90ef40cff.

# DOX — packages/client/src/components/tags

Session tag chip primitives + selectors. Shared across session card, detail header, sidebar filter. See change: add-session-tags.

| File | Purpose |
|------|---------|
| `TagChip.tsx` | Shared chip primitive. Exports `TagChip`, `TagChipVariant`, `TagChipTone`. Variants: `user` (colorized via `tagColor`, optional remove ✕ button), `exec` (dashed/muted read-only phase chip + 🔒), `filter` (selectable, `tone` picks user-colorized vs dashed, `aria-pressed`, `sel` ring). `filter`+`tone=user`+`onRemove` wraps the toggle `<button>` + a sibling destructive ✕ `<button>` (`aria-label` `Remove tag <t> from all sessions`, ≥24px hit area, ring re-homed onto wrapper; sibling → no `stopPropagation`); `exec` tone never renders the ✕. Interactive controls are real `<button>` (keyboard + ARIA). See change: sidebar-tag-collapse-and-delete. |
| `TagDeleteConfirmDialog.tsx` | Confirm dialog for a destructive global tag delete. Exports `TagDeleteConfirmDialog`. Names the tag, states the cross-folder carrying-session count, warns not-undoable + reappears-if-re-added; danger action dispatches `remove_tag_globally`. testId `tag-delete-confirm`. See change: sidebar-tag-collapse-and-delete. |
| `TagEditor.tsx` | Editable strip: colorized user chips (removable) + `+ tag` popover with free-form input autocompleting over `allTags` union (new tags allowed, Enter/click commit, Esc close). Emits full new `normalizeTags`-ed array via `onChange`. Exports `TagEditor`. |
| `TagFilterGroup.tsx` | Labeled selectable filter-chip row. Exports `TagFilterGroup`. Presentational — parent owns selection `Set`. Reused for sidebar "Your tags" (`tone=user`) + "Phase (read-only)" (`tone=exec`). Renders null when empty. Plain sub-label (no chevron — master collapse owned by `SessionList`). `cap?` shows first N chips + `+N more`/`show less` inline expander (`tag-overflow-toggle`); `onRemove?` wires the per-chip destructive ✕ (user tone). See change: sidebar-tag-collapse-and-delete. |
| `TagStrip.tsx` | Compact read-only card strip: first `max`(3) user chips + `+N` overflow + optional read-only phase chip (openspecPhase). Exports `TagStrip`. Renders null when no tags + no phase. |
| `all-tags.ts` | Exports `allTagsInUse(sessions)` — flattens every session's `tags` into a deduped sorted union. Pure; callers `useMemo` over session list. Feeds TagEditor autocomplete + sidebar filter group. |