# Phase 38: Admin — Tag Management - Discussion Log

> **Audit trail only.** Do not use as input to planning, research, or execution agents.
> Decisions are captured in CONTEXT.md — this log preserves the alternatives considered.

**Date:** 2026-04-19
**Phase:** 38-admin-tag-management
**Areas discussed:** Create/Edit UX, Hierarchy display in list, Delete scope for parent tags, Hierarchy depth

---

## Create / Edit UX

| Option | Description | Selected |
|--------|-------------|----------|
| Inline modal for both | Single modal handles create AND edit. No separate route. | |
| Dedicated edit page (like Phase 37) | Consistent with items pattern at /admin/tags/$tagId. | ✓ |
| Inline table editing | Click-to-edit in table rows. | |

**User's choice:** Dedicated edit page for editing (consistent with Phase 37 pattern)

---

## Create UX (follow-up)

| Option | Description | Selected |
|--------|-------------|----------|
| Quick-add row / form at top of list | Name input + parent picker inline at list top. | ✓ |
| New tag via /admin/tags/new page | Dedicated page for creation. | |

**User's choice:** Quick-add form at the top of the tag list

---

## Hierarchy display in list

| Option | Description | Selected |
|--------|-------------|----------|
| Flat table with Parent column | Each row shows parent name, consistent with Phase 37. | |
| Indented tree view | Children indented below parents, hierarchical visualization. | ✓ |

**User's choice:** Indented tree view

---

## Tree + Filter behavior

| Option | Description | Selected |
|--------|-------------|----------|
| Flatten on search | Switch to flat list when searching. | |
| Filter in-tree | Hide non-matching rows in place, keep tree structure. | ✓ |

**User's choice:** Filter in-tree (non-matching rows hidden, matching stay in place)

---

## Tree columns

| Option | Description | Selected |
|--------|-------------|----------|
| Name + Item Count + Actions | Clean, minimal. | ✓ |
| Name + Item Count + Children Count + Actions | Explicit child count. | |

**User's choice:** Name + Item Count + Actions

---

## Delete scope for parent tags

| Option | Description | Selected |
|--------|-------------|----------|
| Orphan children (become top-level) | Children lose parent, become top-level. | ✓ |
| Block deletion until reparented | Admin must reparent children first. | (initially selected, then pivoted) |
| Cascade delete children | Children deleted with parent. | |

**User's choice:** Initially selected "Block deletion until reparented", then pivoted to "Orphan children (become top-level)" — user said "the moving up ain't too bad, i think we should pivot to that"

---

## Delete confirmation dialog

| Option | Description | Selected |
|--------|-------------|----------|
| Show item count + child count warning | "12 items use this tag. Its 3 child tags will become top-level." | ✓ |
| Show item count only | Children silently become top-level with no warning. | |

**User's choice:** Show item count + child count warning

---

## Hierarchy depth

| Option | Description | Selected |
|--------|-------------|----------|
| Strictly 1 level deep | Parent/child only. Simpler schema and rendering. | |
| Arbitrary depth | Any tag can be a parent. Cycle detection needed. | ✓ |

**User's choice:** Arbitrary depth — user said "if we don't do this right now we could hurt ourselves at some point, build it so it can handle however deep we want"

---

## Cycle prevention

| Option | Description | Selected |
|--------|-------------|----------|
| Server-side validation only | API rejects cycles. | |
| Filter parent picker in UI too | Dropdown excludes descendants. | |
| Both | UI filters + server validates. | ✓ |

**User's choice:** Both — "to prevent api mishaps"

---

## Tree expand/collapse

| Option | Description | Selected |
|--------|-------------|----------|
| All expanded, no collapse | Simple. | |
| Collapsible nodes | Parents can be expanded/collapsed. | ✓ |

**User's choice:** Collapsible nodes

---

## Initial expand state

| Option | Description | Selected |
|--------|-------------|----------|
| All expanded | Everything visible on load. | ✓ |
| Top-level only (children collapsed) | Admin expands on demand. | |

**User's choice:** All expanded on page load

---

## Claude's Discretion

- Exact visual styling of tree indentation
- Whether chevron or click-on-row to collapse
- Collapsible tree implementation (local state vs. Zustand)
- Exact error message copy for cycle detection
- "Move to top-level" shortcut on edit page

## Deferred Ideas

- Drag-to-reparent — complex UX, out of scope
- Bulk operations — single-item workflow for Phase 38
- Tag merge — future milestone
- Tag analytics — v2.5
