From f1eb6a9ba5f9d47c2309ca53cea72790608f4421 Mon Sep 17 00:00:00 2001 From: Anders Olsson Date: Mon, 8 Jun 2026 19:52:35 +0200 Subject: [PATCH] docs(specs): unify vocabulary + authority CRUD (#64) --- .../2026-06-08-unify-record-crud-design.md | 182 ++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 docs/superpowers/specs/2026-06-08-unify-record-crud-design.md diff --git a/docs/superpowers/specs/2026-06-08-unify-record-crud-design.md b/docs/superpowers/specs/2026-06-08-unify-record-crud-design.md new file mode 100644 index 0000000..edfa23f --- /dev/null +++ b/docs/superpowers/specs/2026-06-08-unify-record-crud-design.md @@ -0,0 +1,182 @@ +# Unify Vocabulary + Authority CRUD — Design + +**Date:** 2026-06-08 +**Status:** Approved (brainstorming) — ready for implementation planning. +**Issue:** #64 (the duplicated Vocabulary-terms + Authorities CRUD surfaces). + +## Context + +The Vocabulary-terms and Authorities admin surfaces are two copies of one feature ("a labelled record +with an optional external URI: filterable list + inline-edit rows + create form"). The duplication spans +four files and ~280 lines: + +- `vocab/term-row.tsx` and `authorities/authority-row.tsx` are byte-for-byte twins except: the mutation + hooks (`useUpdateTerm`/`useDeleteTerm` vs `useUpdateAuthority`/`useDeleteAuthority`), the record type + (`TermView` vs `AuthorityView`), the URI-input id prefix (`term-uri-` / `auth-uri-`), the mutate-arg + shape (`{ vocabularyId, termId, … }` vs `{ id, kind, … }`), and the delete-confirm i18n key. +- `authorities/authorities-page.tsx` and `vocab/vocabulary-terms.tsx` share the filter input, the + 4-state list (loading→skeleton / error / empty / no-matches / rows), and the create form + (`LabelEditor` + URI input + `labels.some()` validation + `MutationError` + submit). They differ in the + i18n keys, the create-form heading, and (authorities only) the kind-tabs `