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
wire up Tribe Add buttons to surface the contact form, and clear it after creating a person
[._.]/ Adam Eivye1e904e57b3b
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 9542a33648..a4b676613c 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -127,6 +127,8 @@## Fixed+- **Tribe "Add" / "Add Relationship" now visibly surface the new-relationship form.** The Add button (header), the empty-state *Add Relationship* button, and the Care Queue's empty-state all reset to a blank draft — but the contact form is statically rendered in the side column, so resetting an already-empty draft produced no visible change, and on narrow screens the form sat below the fold. Clicking Add now switches to a tab that has the form (Circle, if you're on Focus), resets the draft, scrolls the form into view, and focuses the Name field — so adding a person clearly does something on every screen size. Saving a *new* person also clears the form back to a blank draft (Name re-focused) so the next entry adds another person instead of overwriting the one just saved; editing an existing person still keeps them selected. (`client/src/pages/Tribe.jsx`)+- **[issue-1393] The universe base-style probe now scopes its in-flight render per universe instead of remounting on every switch.** The probe spinner used to be kept from leaking across universe switches by remounting the whole `StyleProbeImage` (a `key={universe.id}` in the Universe Builder and Story Builder). That worked but had two costs: every switch re-ran the probe's `{ silent: true }` image-settings GET, and switching *away* from an in-flight render abandoned its completion — the server still filed the image, but switching back never resumed the spinner or pinned the result onto the universe's style refs for that session. `useSingleImageRender` now takes a `scopeId` that namespaces the single-target key per universe (`<id>:__single__`), so the displayed universe's job is read without a remount: no per-switch settings refetch, and switching back to a still-running (or already-finished) render resumes it and captures its completion. The mid-render style-drift guard is now keyed per universe too, so a stale image can't pin to the wrong record when two probes overlap across a switch. And because the render slot no longer remounts to reset itself, a render that *fails or is canceled* (which never produces a filename, so the slot's completion path can't clear it) now clears the stuck job explicitly — so a failed probe leaves the slot ready to re-render instead of disabling regenerate for the rest of the session. (`client/src/hooks/useSingleImageRender.js`, `client/src/components/universe/{StyleProbeImage,EntryThumbSlot}.jsx`, `client/src/pages/{UniverseBuilder,StoryBuilder}.jsx`, #1393)- **[issue-1422] Re-planning a goal that has scheduled calendar blocks no longer silently strands those calendar events, and a malformed AI plan now fails fast.** Accepting a new AI-generated plan (either *Generate Plan* phases or *Decompose into Tasks*) replaces a goal's milestones wholesale — but if you'd already pushed those milestones onto your calendar as time blocks, the old blocks were left pointing at milestones that no longer existed. Accepting now refuses with a clear message asking you to unschedule first, so your calendar can't drift out of sync with your plan. Separately, both *Generate Plan* and *Decompose into Tasks* now validate the AI's proposal the moment it comes back — a garbled response surfaces a clear error up front instead of looking fine in the review screen and only breaking when you try to accept it.diff --git a/client/src/pages/Tribe.jsx b/client/src/pages/Tribe.jsxindex d5cce09190..c17563fa9a 100644--- a/client/src/pages/Tribe.jsx+++ b/client/src/pages/Tribe.jsx@@ -1,4 +1,4 @@-import { useEffect, useMemo, useState } from 'react';+import { useEffect, useMemo, useRef, useState } from 'react';import {Calendar,Clock,@@ -224,11 +224,12 @@ function ContactCard({ contact, active, onSelect, onLogTouch }) {);}-function ContactForm({ draft, onChange, onSave, onDelete, onNew, isExisting, saving }) {+function ContactForm({ draft, onChange, onSave, onDelete, onNew, isExisting, saving, nameInputRef, formRef }) {const update = (field, value) => onChange({ ...draft, [field]: value });return (<form+ ref={formRef}className="border border-port-border bg-port-card rounded p-4"onSubmit={(event) => {event.preventDefault();@@ -255,6 +256,7 @@ function ContactForm({ draft, onChange, onSave, onDelete, onNew, isExisting, sav<label className="block"><span className="text-xs text-gray-500">Name</span><input+ ref={nameInputRef}value={draft.name}onChange={(event) => update('name', event.target.value)}className="mt-1 w-full rounded border border-port-border bg-port-bg px-3 py-2 text-sm text-white outline-none focus:border-port-accent"@@ -629,6 +631,13 @@ export default function Tribe() {const [activeTab, setActiveTab] = useState('circle');const [loading, setLoading] = useState(true);const [saving, setSaving] = useState(false);+ // Bumped by every "Add / new relationship" trigger so the form can be+ // surfaced (scrolled into view + Name focused). The form is statically+ // rendered, so resetting an already-empty draft is otherwise invisible —+ // especially on narrow screens where it sits below the fold.+ const [focusTick, setFocusTick] = useState(0);+ const nameInputRef = useRef(null);+ const formRef = useRef(null);const selectedId = draft.id;@@ -690,6 +699,25 @@ export default function Tribe() {};}, []);+ // Surface the contact form after an Add trigger. Runs after the tab switch ++ // draft reset have rendered, so the form is mounted in whichever tab is active.+ useEffect(() => {+ if (focusTick === 0) return;+ const frame = requestAnimationFrame(() => {+ formRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' });+ nameInputRef.current?.focus();+ });+ return () => cancelAnimationFrame(frame);+ }, [focusTick]);++ // Reset to a blank draft and surface the form. The Focus tab has no form, so+ // fall back to Circle there; otherwise keep the user's current tab.+ const startNewRelationship = () => {+ setActiveTab((tab) => (tab === 'focus' ? 'circle' : tab));+ setDraft(emptyDraft());+ setFocusTick((tick) => tick + 1);+ };+const filteredContacts = useMemo(() => {const normalized = query.trim().toLowerCase();return contacts.filter((contact) => {@@ -735,6 +763,7 @@ export default function Tribe() {notes: draft.notes.trim(),};+ const isCreate = !draft.id;setSaving(true);const saved = draft.id? await api.updateTribePerson(draft.id, payload).catch((err) => {@@ -753,7 +782,14 @@ export default function Tribe() {? current.map((contact) => (contact.id === saved.id ? saved : contact)): [saved, ...current]));- selectContact(saved);+ // After creating a NEW person, clear back to a blank form (and re-focus Name)+ // so the next entry adds another person instead of overwriting the one just+ // saved. When editing an existing person, keep them selected.+ if (isCreate) {+ startNewRelationship();+ } else {+ selectContact(saved);+ }};const deleteDraft = async () => {@@ -793,7 +829,7 @@ export default function Tribe() {const actions = (<buttontype="button"- onClick={() => setDraft(emptyDraft())}+ onClick={startNewRelationship}className="inline-flex items-center gap-2 rounded border border-port-border px-3 py-2 text-sm text-gray-300 hover:bg-port-border/40 hover:text-white"><Plus size={15} aria-hidden="true" />@@ -878,7 +914,7 @@ export default function Tribe() {</div>{contacts.length === 0 ? (- <EmptyState onNew={() => setDraft(emptyDraft())} />+ <EmptyState onNew={startNewRelationship} />) : (<div className="grid gap-3 md:grid-cols-2">{filteredContacts.map((contact) => (@@ -905,9 +941,11 @@ export default function Tribe() {onChange={setDraft}onSave={saveDraft}onDelete={deleteDraft}- onNew={() => setDraft(emptyDraft())}+ onNew={startNewRelationship}isExisting={Boolean(draft.id)}saving={saving}+ nameInputRef={nameInputRef}+ formRef={formRef}/>{draft.id && <MemoryLinksPanel personId={draft.id} />}{draft.id && <TouchpointsPanel personId={draft.id} />}@@ -921,16 +959,18 @@ export default function Tribe() {contacts={contacts}onSelect={(contact) => { selectContact(contact); setActiveTab('circle'); }}onLogTouch={logTouch}- onNew={() => setDraft(emptyDraft())}+ onNew={startNewRelationship}/><ContactFormdraft={draft}onChange={setDraft}onSave={saveDraft}onDelete={deleteDraft}- onNew={() => setDraft(emptyDraft())}+ onNew={startNewRelationship}isExisting={Boolean(draft.id)}saving={saving}+ nameInputRef={nameInputRef}+ formRef={formRef}/></div>)}