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
feat: move catalog type settings into catalog
[._.]/ Adam Eivy8fbab8c91e86
diff --git a/client/src/App.jsx b/client/src/App.jsxindex 0fff983ba4..4be06f154b 100644--- a/client/src/App.jsx+++ b/client/src/App.jsx@@ -307,6 +307,9 @@ export default function App() {<Route path="templates" element={<Templates />} /><Route path="security" element={<Security />} /><Route path="settings" element={<Navigate to="/settings/backup" replace />} />+ {/* Catalog type settings moved into the Catalog feature drawer; keep+ the old Settings URL working for bookmarks and stale palette links. */}+ <Route path="settings/catalog" element={<Navigate to="/catalog?settings=1" replace />} />{/* Legacy /settings/contacts → Comms Messages → Contacts tab */}<Route path="settings/contacts" element={<Navigate to="/messages/contacts" replace />} />{/* Local LLM management moved out of Settings into its own top-leveldiff --git a/client/src/components/settings/CatalogTypesTab.jsx b/client/src/components/settings/CatalogTypesTab.jsxindex 514d9d5c10..d3a1bc85c7 100644--- a/client/src/components/settings/CatalogTypesTab.jsx+++ b/client/src/components/settings/CatalogTypesTab.jsx@@ -8,7 +8,7 @@ import { useCatalogTypes } from '../../hooks/useCatalogTypes.jsx';import { USER_TYPE_FIELD_KINDS } from '../../lib/catalogTypes';/**- * Settings → Catalog tab. Lists the built-in (system) ingredient types+ * Catalog settings panel. Lists the built-in (system) ingredient types* read-only and lets the user define their own custom types — each with a flat* list of typed fields the generic editor renders. Definitions persist in* settings.json server-side (via the /api/catalog/types routes) and federate todiff --git a/client/src/components/settings/SettingsTabsHeader.jsx b/client/src/components/settings/SettingsTabsHeader.jsxindex 283cd0e46a..ffb81d4b78 100644--- a/client/src/components/settings/SettingsTabsHeader.jsx+++ b/client/src/components/settings/SettingsTabsHeader.jsx@@ -13,7 +13,6 @@ export const TABS = [{ id: 'api-access', label: 'API Access', to: '/settings/api-access' },{ id: 'autofixer', label: 'Autofixer', to: '/settings/autofixer' },{ id: 'backup', label: 'Backup', to: '/settings/backup' },- { id: 'catalog', label: 'Catalog', to: '/settings/catalog' },{ id: 'code-reviewers', label: 'Code Reviewers', to: '/settings/code-reviewers' },{ id: 'database', label: 'Database', to: '/settings/database' },{ id: 'features', label: 'Features', to: '/settings/features' },diff --git a/client/src/pages/Catalog.jsx b/client/src/pages/Catalog.jsxindex 571ada031e..8e22b31a03 100644--- a/client/src/pages/Catalog.jsx+++ b/client/src/pages/Catalog.jsx@@ -8,16 +8,18 @@* safe. The flat Grid view paginates past the old 200-item cap with "Load more";* the Albums view groups ingredients by universe with pinned "Unsorted / Raw"* and "Orphaned" albums. The "+ New" inline form mirrors the Pipeline- * series-create pattern; "Ingest" links to the paste-and-extract page. Delete- * uses an armed two-click confirm (no window.confirm); the multi-select action- * bar can Remix the selection into Story Builder or place it into a+ * series-create pattern; "Ingest" links to the paste-and-extract page, and+ * "Settings" opens the catalog type and field configuration in a drawer.+ * Delete uses an armed two-click confirm (no window.confirm); the multi-select+ * action bar can Remix the selection into Story Builder or place it into a* universe/series.*/import { useState, useEffect, useCallback, useMemo, useRef } from 'react';import { Link, useNavigate } from 'react-router';-import { Sparkles, Plus, Search, FileInput, Loader2, RefreshCw, Wand2, X, LayoutGrid, Library, FolderPlus } from 'lucide-react';+import { Sparkles, Plus, Search, FileInput, Loader2, RefreshCw, Wand2, X, LayoutGrid, Library, FolderPlus, Settings as SettingsIcon } from 'lucide-react';import BrailleSpinner from '../components/BrailleSpinner';+import Drawer from '../components/Drawer';import toast from '../components/ui/Toast';import {listCatalogIngredients,@@ -32,8 +34,10 @@ import { listUniverses } from '../services/apiUniverseBuilder';import { listPipelineSeries } from '../services/apiPipeline';import CatalogCard from '../components/catalog/CatalogCard';import CatalogAlbum from '../components/catalog/CatalogAlbum';+import { CatalogTypesTab } from '../components/settings/CatalogTypesTab';import { catalogRefRoleForType } from '../lib/catalogTypes';import { useCatalogTypes } from '../hooks/useCatalogTypes.jsx';+import useDrawerTab from '../hooks/useDrawerTab';import useUrlParams from '../hooks/useUrlParams';// All type-derived UI (chips, badge color, inline-form primary content@@ -58,6 +62,13 @@ const REMIX_TARGETS = [export default function Catalog() {const navigate = useNavigate();+ // Catalog type definitions belong to this feature, so keep their settings+ // drawer deep-linkable while leaving the catalog filters in the same URL.+ const [settingsParam, setSettingsParam] = useDrawerTab('settings', null, ['1']);+ const settingsOpen = settingsParam === '1';+ const openSettings = () => setSettingsParam('1');+ const closeSettings = () => setSettingsParam(null);+// Merged type registry (system + user-defined). `types` drives the filter// chips + the New-form dropdown; `getType` resolves badge/primary-content.const { types: TYPES, getType } = useCatalogTypes();@@ -505,9 +516,22 @@ export default function Catalog() {onCancelArm: cancelArm,};+ const settingsDrawer = (+ <Drawer+ open={settingsOpen}+ onClose={closeSettings}+ title="Catalog settings"+ subtitle="Configure the labels and fields used by Catalog ingredients"+ size="lg"+ >+ <CatalogTypesTab />+ </Drawer>+ );+return (- <div>- {/* Header. The toolbar wraps to its own rows on a phone because the four+ <>+ {settingsDrawer}+ {/* Header. The toolbar wraps to its own rows on a phone because the fivecontrols together need ~350px and a 320px viewport gives 288px.A label too long to survive that (Sync's, at `lg`; the action bar's, at`sm`) hides its tail and keeps the full wording in aria-label, so the@@ -543,6 +567,16 @@ export default function Catalog() {<Library size={16} className="shrink-0" aria-hidden="true" /> Albums</button></div>+ <button+ type="button"+ onClick={openSettings}+ aria-label="Catalog settings"+ title="Configure catalog labels and fields"+ className="inline-flex flex-1 sm:flex-none items-center justify-center gap-2 px-3 py-2 min-h-[40px] rounded-lg border border-port-border bg-port-card hover:bg-port-bg text-white text-sm font-medium"+ >+ <SettingsIcon size={16} className="shrink-0" aria-hidden="true" />+ Settings+ </button><buttontype="button"onClick={handleSync}@@ -932,7 +966,7 @@ export default function Catalog() {</div></div>)}- </div>+ </>);}diff --git a/client/src/pages/Catalog.test.jsx b/client/src/pages/Catalog.test.jsxindex 5af713bce6..c64e348533 100644--- a/client/src/pages/Catalog.test.jsx+++ b/client/src/pages/Catalog.test.jsx@@ -1,6 +1,6 @@import { describe, it, expect, vi, beforeEach } from 'vitest';import { render, screen, fireEvent, waitFor, act } from '@testing-library/react';-import { MemoryRouter } from 'react-router';+import { MemoryRouter, useLocation } from 'react-router';// Spy on navigation so the "Remix into…" handoff can assert the target route +// the generic `remix.ingredientIds` state payload. MemoryRouter still supplies@@ -38,6 +38,9 @@ vi.mock('../components/ui/Toast', () => ({// user-defined type surfaces as a filter chip + dropdown option.vi.mock('../services/apiCatalogTypes', () => ({listCatalogTypes: vi.fn(),+ createCatalogType: vi.fn(),+ updateCatalogType: vi.fn(),+ deleteCatalogType: vi.fn(),}));// MediaImage pulls in the socket service; stub it to a plain <img> so the card@@ -66,9 +69,15 @@ const sample = [{ id: 'i-2', name: 'Old Harbor', type: 'place', payload: { description: 'Brine and rust.' }, tags: [] },];-const renderCatalog = () => render(- <MemoryRouter>+function LocationProbe() {+ const { pathname, search } = useLocation();+ return <div data-testid="catalog-location">{`${pathname}${search}`}</div>;+}++const renderCatalog = (initialEntry = '/catalog') => render(+ <MemoryRouter initialEntries={[initialEntry]}><Catalog />+ <LocationProbe /></MemoryRouter>,);@@ -96,6 +105,27 @@ beforeEach(() => {});describe('Catalog page', () => {+ it('opens catalog type settings in a deep-linkable feature drawer', async () => {+ renderCatalog();+ await waitFor(() => expect(screen.getByText('Echo Saint')).toBeTruthy());+ expect(screen.queryByRole('dialog', { name: 'Catalog settings' })).toBeNull();++ fireEvent.click(screen.getByRole('button', { name: 'Catalog settings' }));++ expect(await screen.findByRole('dialog', { name: 'Catalog settings' })).toBeTruthy();+ expect(screen.getByText(/Define custom ingredient types for the Catalog/i)).toBeTruthy();+ expect(screen.getByTestId('catalog-location').textContent).toBe('/catalog?settings=1');++ fireEvent.click(screen.getByRole('button', { name: 'Close settings' }));+ await waitFor(() => expect(screen.queryByRole('dialog', { name: 'Catalog settings' })).toBeNull());+ expect(screen.getByTestId('catalog-location').textContent).toBe('/catalog');+ });++ it('opens catalog type settings from the compatibility deep link', async () => {+ renderCatalog('/catalog?settings=1');+ expect(await screen.findByRole('dialog', { name: 'Catalog settings' })).toBeTruthy();+ });+it('renders the fetched ingredient cards with snippet + count', async () => {renderCatalog();await waitFor(() => expect(screen.getByText('Echo Saint')).toBeTruthy());diff --git a/client/src/pages/Settings.jsx b/client/src/pages/Settings.jsxindex 8e5854f83e..37223cf2f4 100644--- a/client/src/pages/Settings.jsx+++ b/client/src/pages/Settings.jsx@@ -5,7 +5,6 @@ import { ApiAccessTab } from '../components/settings/ApiAccessTab';import { AutofixerTab } from '../components/settings/AutofixerTab';import AiAssignmentsTab from '../components/settings/AiAssignmentsTab';import { BackupTab } from '../components/settings/BackupTab';-import { CatalogTypesTab } from '../components/settings/CatalogTypesTab';import CodeReviewersTab from '../components/settings/CodeReviewersTab';import { DatabaseTab } from '../components/settings/DatabaseTab';import InstanceFeaturesTab from '../components/settings/InstanceFeaturesTab';@@ -25,7 +24,8 @@ import SettingsTabsHeader from '../components/settings/SettingsTabsHeader';// stale palette entries keep working.const REDIRECTS = {'image-gen': '/media/image?settings=1',- imessage: '/messages/imessage?settings=1'+ imessage: '/messages/imessage?settings=1',+ catalog: '/catalog?settings=1',};export default function Settings() {@@ -43,7 +43,6 @@ export default function Settings() {case 'api-access': return <ApiAccessTab />;case 'autofixer': return <AutofixerTab />;case 'backup': return <BackupTab />;- case 'catalog': return <CatalogTypesTab />;case 'code-reviewers': return <CodeReviewersTab />;case 'database': return <DatabaseTab />;case 'features': return <InstanceFeaturesTab />;diff --git a/client/src/pages/Settings.redirects.test.jsx b/client/src/pages/Settings.redirects.test.jsxindex f072049e65..5cdb5bccc1 100644--- a/client/src/pages/Settings.redirects.test.jsx+++ b/client/src/pages/Settings.redirects.test.jsx@@ -18,13 +18,14 @@ function Landed() {return <div data-testid="landed">{`${pathname}${search}`}</div>;}-// Two former Settings tabs now live as drawers over the page they configure.+// Former Settings tabs now live as drawers over the pages they configure.// Their old /settings/<tab> URLs stay live as redirects so bookmarks, stale ⌘K// history, and older docs keep working — and land with the drawer already open.describe('Settings — retired tabs redirect to their drawer', () => {it.each([['/settings/image-gen', '/media/image?settings=1'],['/settings/imessage', '/messages/imessage?settings=1'],+ ['/settings/catalog', '/catalog?settings=1'],])('%s → %s', (from, to) => {render(<MemoryRouter initialEntries={[from]}>diff --git a/client/src/services/voiceFastPath.test.js b/client/src/services/voiceFastPath.test.jsindex e24715f5fe..c8bbba7200 100644--- a/client/src/services/voiceFastPath.test.js+++ b/client/src/services/voiceFastPath.test.js@@ -30,7 +30,7 @@ const NAV = [{ id: 'nav.meatspace.settings', path: '/meatspace/settings', label: 'Settings', aliases: ['meatspace-settings'] },{ id: 'nav.settings.general', path: '/settings/general', label: 'General', aliases: ['settings', 'settings-general', 'general'] },{ id: 'nav.settings.voice', path: '/settings/voice', label: 'Voice', aliases: ['settings-voice', 'voice', 'voice-settings'] },- { id: 'nav.settings.catalog', path: '/settings/catalog', label: 'Catalog Types', aliases: ['settings-catalog', 'catalog-types'] },+ { id: 'nav.catalog.settings', path: '/catalog?settings=1', label: 'Catalog Types', aliases: ['catalog-settings', 'settings-catalog', 'catalog-types'] },{ id: 'nav.settings.database', path: '/settings/database', label: 'Database', aliases: ['settings-database', 'database'] },];@@ -59,7 +59,7 @@ describe('resolveNavIntent', () => {it('word-overlaps a reversed-order alias — "catalog settings" → Catalog, not generic Settings', () => {// alias is "settings-catalog" (reversed word order); word overlap still wins.- expect(resolveNavIntent('go to catalog settings', NAV)).toEqual({ path: '/settings/catalog', label: 'Catalog Types' });+ expect(resolveNavIntent('go to catalog settings', NAV)).toEqual({ path: '/catalog?settings=1', label: 'Catalog Types' });});it('resolves a terse "<page> settings" WITHOUT a nav lead-in', () => {diff --git a/server/lib/navManifest.js b/server/lib/navManifest.jsindex 6cdf463d21..7ec373f495 100644--- a/server/lib/navManifest.js+++ b/server/lib/navManifest.js@@ -77,6 +77,7 @@ const RAW_NAV_COMMANDS = [{ id: 'nav.catalog', path: '/catalog', label: 'Catalog', section: 'Create', aliases: ['catalog', 'ingredients', 'cast', 'creative-catalog'], keywords: ['character', 'place', 'object', 'idea', 'scene', 'concept', 'inventory', 'reference', 'creative'] },{ id: 'nav.catalog.ingest', path: '/catalog/ingest', label: 'Catalog Ingest', section: 'Create', aliases: ['catalog-ingest', 'ingest', 'paste-scrap', 'extract-ingredients'], keywords: ['paste', 'snippet', 'scene', 'idea', 'extract', 'scrap', 'import-catalog'] },+ { id: 'nav.catalog.settings', path: '/catalog?settings=1', label: 'Catalog Types', section: 'Create', previousPaths: ['/settings/catalog'], aliases: ['catalog-settings', 'settings-catalog', 'catalog-types'], keywords: ['catalog', 'types', 'labels', 'character', 'place', 'object', 'taxonomy'] },{ id: 'nav.media', path: '/media', label: 'Media Gen', section: 'Create', aliases: ['media', 'media-gen', 'mediagen', 'generate'], keywords: ['image', 'video', 'render', 'art', 'movie'] },{ id: 'nav.media.image', path: '/media/image', label: 'Image', section: 'Create', previousPaths: ['/image-gen'], aliases: ['image-gen', 'imagegen', 'generate-image', 'sd', 'stable-diffusion'], keywords: ['stable diffusion', 'render', 'art', 'picture', 'photo', 'draw', 'flux', 'mflux'] },{ id: 'nav.media.video', path: '/media/video', label: 'Video', section: 'Create', previousPaths: ['/video-gen'], aliases: ['video-gen', 'videogen', 'generate-video', 'ltx'], keywords: ['video', 'animate', 'movie', 'clip', 'ltx'] },@@ -289,7 +290,6 @@ const RAW_NAV_COMMANDS = [{ id: 'nav.settings.api-access', path: '/settings/api-access', label: 'API Access', section: 'Settings', aliases: ['api-access', 'settings-api-access', 'public-api', 'swagger', 'openapi'], keywords: ['rest', 'external', 'tts api', 'sdapi', 'voice api', 'docs', 'curl', 'expose', 'passwordless', 'auth gating'] },{ id: 'nav.settings.autofixer', path: '/settings/autofixer', label: 'Autofixer', section: 'Settings', aliases: ['autofixer', 'settings-autofixer', 'auto-fixer'], keywords: ['crash', 'fix', 'pm2', 'repair', 'ai provider', 'restart'] },{ id: 'nav.settings.backup', path: '/settings/backup', label: 'Backup', section: 'Settings', aliases: ['backup', 'settings-backup'] },- { id: 'nav.settings.catalog', path: '/settings/catalog', label: 'Catalog Types', section: 'Settings', aliases: ['settings-catalog', 'catalog-types'], keywords: ['catalog', 'types', 'character', 'place', 'object', 'taxonomy'] },{ id: 'nav.settings.code-reviewers', path: '/settings/code-reviewers', label: 'Code Reviewers', section: 'Settings', aliases: ['code-reviewers', 'settings-code-reviewers', 'code-review', 'review-defaults', 'reviewers'], keywords: ['review loop', 'reviewer chain', 'codex', 'copilot', 'ollama', 'stop mode', 'max rounds', 'defaults'] },{ id: 'nav.settings.database', path: '/settings/database', label: 'Database', section: 'Settings', aliases: ['settings-database', 'database'] },{ id: 'nav.settings.features', path: '/settings/features', label: 'Features', section: 'Settings', aliases: ['settings-features', 'instance-features', 'feature-usage'], keywords: ['enabled', 'disabled', 'instance', 'optional', 'participation', 'metrics', 'reminders'] },diff --git a/server/lib/navManifest.test.js b/server/lib/navManifest.test.jsindex 0d3a257a31..3c169157ba 100644--- a/server/lib/navManifest.test.js+++ b/server/lib/navManifest.test.js@@ -604,7 +604,7 @@ describe('nav coverage — every navigable App.jsx route has a manifest entry',it('keeps a redirect from every declared previous path to its current one', () => {const broken = NAV_COMMANDS.flatMap((c) => (c.previousPaths || []).map((from) => ({ from, to: c.path.split(/[?#]/)[0], id: c.id })))- .filter(({ from, to }) => byFrom.get(from)?.to !== to)+ .filter(({ from, to }) => byFrom.get(from)?.to?.split(/[?#]/)[0] !== to).map(({ from, to, id }) => `${id}: ${from} → ${byFrom.get(from)?.to ?? 'NO REDIRECT'} (want ${to})`);expect(broken).toEqual([]);});@@ -647,6 +647,7 @@ describe('nav coverage — every navigable App.jsx route has a manifest entry','/devtools/submodules','/devtools/runs','/settings/contacts',+ '/settings/catalog','/imessage','/system-health','/datadog',