Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
docs([extract-usependinglistrows-hook]): remove from PLAN.md and log to changelog
[._.]/ Adam Eivy13b22f081c26
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 03466bf689..e58f9e4dd3 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -2,6 +2,8 @@## Changed+- **[extract-usependinglistrows-hook] Unify pending-row buffers in `WardrobeSection` + `CharacterDetailEditor` behind a shared hook.** New `client/src/hooks/usePendingListRows.js` collapses the "list-of-rows where a new row is held client-side until a required column fills, then promoted to `onChange`" pattern that was inlined in `CanonCard.jsx#WardrobeSection` and `CharacterDetailEditor.jsx`'s per-LIST_SECTION block (each had grown slightly different id-handling: `wd-<uuid>` ids that round-trip verbatim vs `pending-<key>-<uuid>` client-only ids stripped at promotion). The hook accepts `idPrefix` + `stripIdOnPromote` so both conventions survive intact, and a new `ListSectionEditor` subcomponent inside `CharacterDetailEditor` owns one hook instance per section (hooks can't be called inside `LIST_SECTIONS.map`). Skipping the stale `[route-medialightbox-settings-drawer-through]` PLAN entry along the way — the drawer was removed in commit ed0e4859 so no migration target exists. Net 77 LOC removed across the two call sites; 11 new tests cover add/promote/remove/required-column gating and the `crypto.randomUUID` fallback path. 202/202 client tests pass; lint clean.+- **[apicore-request-arraybuffer-response-type] `apiCore.request()` grows an `arraybuffer` `responseType` escape hatch; two TTS audition helpers stop bypassing the shared client.** `client/src/services/apiCore.js#request` now accepts `{ responseType: 'arraybuffer' }` — when set, the helper returns `response.arrayBuffer()` instead of parsing JSON, while still funneling the error path (server-shaped 4xx/5xx, network-unreachable toast, `err.code` / `err.status` / `err.context` forwarding) through the same code. `apiVoice.js#testTts` and `apiPipeline.js#previewPipelineTtsVoice` dropped their raw `fetch` paths and now call `request()` with `responseType: 'arraybuffer'` + `silent: true` (all three callers — `VoiceTab.handleTest`, `VoiceTab.handlePreviewVoice`, `VoicePicker.handleAudition` — already own their own catch-block toasts, so silent avoids double-toasting per the CLAUDE.md convention). Drops ~25 LOC of duplicated `if (!res.ok) parse + throw` shaping. Also pruned a stale PLAN.md entry ([extract-useswipenav-hook-lib-clipboard-js]) — both halves of that item already shipped (clipboard helpers in `client/src/lib/clipboard.js`, swipe in `client/src/hooks/useSwipeNav.js`; `MediaLightbox.jsx:122` has been calling `useSwipeNav` since PR #261). 163/163 client tests pass; lint clean.- **[extract-mergeexpandintodraft-draft-result-from] `mergeExpandIntoDraft` extracted from `UniverseBuilder.jsx#handleExpand`.** The merge block — lock-honoring scalar pick, locked-variation/sheet preservation, category `kind` precedence, canon dedupe by name/slugline/alias, addedCanonCount + pendingAdditions partitioning — moved to a pure `client/src/lib/universeBuilderExpand.js` so the I/O shell of `handleExpand` (validation, `expandUniverse()` call, `setDraft`, auto-save, toast) is no longer tangled with merge semantics. `handleExpand` shrinks from ~260 lines to ~120; the new module exports `mergeExpandIntoDraft`, `mergeVariations`, `mergeCanonByName`, and `extractPreservedFromDraft` (the locked-items extractor used by both the API-call site and the merge so they can't drift). 27 new unit tests pin the lock semantics (absent vs intentional `""` clear), category-kind precedence ("other" upgradable; user-curated kinds preserved), composite-sheet dedupe, place-slugline normalization, within-batch alias dedupe, and `pendingAdditions` partitioning by trunk. Existing 10-test `UniverseBuilder.test.jsx` still passes; full client suite at 190/190.diff --git a/PLAN.md b/PLAN.mdindex 2d692995ee..0d21645ae3 100644--- a/PLAN.md+++ b/PLAN.md@@ -13,7 +13,6 @@ _Nothing currently parked — pick the next item from the Backlog._### Code quality / dedup (from `/simplify` passes)- [ ] [route-medialightbox-settings-drawer-through] **Route `MediaLightbox` settings drawer through `components/Drawer.jsx`.** Reconcile `Drawer`'s flat Esc handler with the lightbox's layered Escape cascade.-- [ ] [extract-usependinglistrows-hook] **Extract `usePendingListRows({ persisted, requiredColumn, idPrefix, onChange }) → { merged, isPending, addRow, updateRow, removeRow }`.** Surfaced by /simplify during `[wardroberow-migrate-to-userowdraft]`. `WardrobeSection` in `client/src/components/pipeline/CanonCard.jsx:155-211` and `CharacterDetailEditor` list-section block in `client/src/components/universe/CharacterDetailEditor.jsx:202-278` now share substantial structure: pending rows held client-side until a required column fills, then promoted to `onChange`/`patchList`, with an index space that concatenates `[...persisted, ...pending]` and an `isPending(idx)` partition. Estimated ~70 LOC savings across both call sites. Two load-bearing details to preserve in the extraction: (1) `WardrobeSection` mints `wd-<uuid>` ids that round-trip verbatim; `CharacterDetailEditor` mints `pending-<key>-<uuid>` that get stripped at promotion — pass an `idPrefix` and a `stripIdOnPromote` flag (or unify both onto server-shaped ids and drop the strip); (2) hook is per-list (one instance per `LIST_SECTION` in `CharacterDetailEditor`, one in `WardrobeSection`), NOT per-component. Deferred to keep this PR focused on the `useRowDraft` migration; revisit when a third caller appears or the parallel divergence drifts.- [ ] [client-tests-for-deep-routing-drag-smoke-tests-for] **Client tests for deep routing + drag.** Smoke tests for `goToWorld(id)` URL transitions and chip-reorder ordering (mock `useSortable`).- [ ] [sweep-provider-type-tui-inline-checks-in-client] **Sweep `provider.type === 'tui'` inline checks in client.** New `isTuiProvider` helper in `client/src/utils/providers.js` not yet adopted in `client/src/pages/AIProviders.jsx` (3 remaining inline checks at lines 262, 396, 421 of CONFIG-style chips) and `client/src/components/cos/TaskAddForm.jsx`. Low priority — these are visual chip predicates, not behavioral.- [ ] [consolidate-cert-path-constants] **Consolidate `CERT_DIR`/`CERT_PATH`/`KEY_PATH`/`META_PATH` constants.** Re-declared in `scripts/setup-cert.js`, `scripts/open-ui-in-browser.js`, `server/services/certProvisioner.js`, and `server/services/certRenewer.js` (4 sites). Surfaced by `/simplify` during the first-run HTTPS-auto-flip fix (2026-05-19); deferred to keep that PR scoped. Candidate home: `lib/certPaths.js` (alongside `lib/tailscale-https.js` so both runtime + bootstrap can import).