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
fix: counts read "1 account" / "1 open note" instead of "1 accounts" / "1 open notes"
Adam Eivyfa526e33b279
diff --git a/client/src/components/agents/AgentList.jsx b/client/src/components/agents/AgentList.jsxindex 86e4c1a18e..b8efcdedb0 100644--- a/client/src/components/agents/AgentList.jsx+++ b/client/src/components/agents/AgentList.jsx@@ -10,6 +10,7 @@ import * as api from '../../services/api';import { PERSONALITY_STYLES, DEFAULT_PERSONALITY, DEFAULT_AVATAR } from './constants';import { DEFAULT_AVATAR_COLOR } from '../../themes/portosThemes';import { filterSelectableModels } from '../../utils/providers';+import { pluralize } from '../../lib/textUtils';export default function AgentList() {const [agents, setAgents] = useState([]);@@ -412,7 +413,7 @@ export default function AgentList() {</div><div className="flex items-center gap-3 text-xs text-gray-500">- <span>{accountCounts[agent.id] || 0} accounts</span>+ <span>{pluralize(accountCounts[agent.id] || 0, 'account')}</span><span>{scheduleCounts[agent.id] || 0} schedules</span><span className={`ml-auto px-2 py-0.5 rounded ${agent.enableddiff --git a/client/src/components/universeBuilder/graph/GraphTimeline.jsx b/client/src/components/universeBuilder/graph/GraphTimeline.jsxindex fcb9cec48d..cc9631f51d 100644--- a/client/src/components/universeBuilder/graph/GraphTimeline.jsx+++ b/client/src/components/universeBuilder/graph/GraphTimeline.jsx@@ -6,6 +6,7 @@import { useEffect, useMemo } from 'react';import { Pause, Play } from 'lucide-react';+import { pluralize } from '../../../lib/textUtils';// How long each issue holds while playing.const PLAY_STEP_MS = 700;@@ -58,7 +59,7 @@ export default function GraphTimeline({const current = timeIndex == null ? null : index.issues[timeIndex];const seriesName = current? (index.byId.get(current.seriesId)?.name || '')- : `${total} issues across ${index.series.length} series`;+ : `${pluralize(total, 'issue')} across ${pluralize(index.series.length, 'series', 'series')}`;return (<div className="bg-port-card border border-port-border rounded-lg px-4 pt-2.5 pb-3 flex flex-col gap-2">diff --git a/client/src/components/universeBuilder/graph/UniverseGraphTab.jsx b/client/src/components/universeBuilder/graph/UniverseGraphTab.jsxindex 13e398fc64..7f3671dbed 100644--- a/client/src/components/universeBuilder/graph/UniverseGraphTab.jsx+++ b/client/src/components/universeBuilder/graph/UniverseGraphTab.jsx@@ -11,6 +11,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';import { useSearchParams } from 'react-router';import { Loader2, Network } from 'lucide-react';import { getUniverseGraph } from '../../../services/api';+import { pluralize } from '../../../lib/textUtils';import {GRAPH_EDGE_GROUPS, GRAPH_KIND_ORDER, computeUniverseGaps, edgeDef, indexGraph, neighbourIds,} from '../../../lib/universeGraphModel';@@ -143,8 +144,8 @@ export default function UniverseGraphTab({ universeId, universeName }) {(n) => (n.firstIssue || 0) <= timeIndex && n.kind !== 'issue' && n.kind !== 'image',).length), [index, timeIndex]);- const statsLabel = `${visible.nodes.length} nodes · ${visible.edges.length} links${- search ? ` · ${visible.match ? visible.match.size : 0} matches` : ''}`;+ const statsLabel = `${pluralize(visible.nodes.length, 'node')} · ${pluralize(visible.edges.length, 'link')}${+ search ? ` · ${pluralize(visible.match ? visible.match.size : 0, 'match', 'matches')}` : ''}`;if (!universeId) {return (diff --git a/client/src/hooks/useSceneRenderLifecycle.js b/client/src/hooks/useSceneRenderLifecycle.jsindex ed9e3da6fb..f45bf1c7d6 100644--- a/client/src/hooks/useSceneRenderLifecycle.js+++ b/client/src/hooks/useSceneRenderLifecycle.js@@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';import socket from '../services/socket';import { getMediaJob } from '../services/apiMediaJobs';import { evictOldest, ORPHAN_BUFFER_MAX } from '../lib/boundedMap';+import { pluralize } from '../lib/textUtils';import toast from '../components/ui/Toast';// Failures landing within this window of each other are one batch.@@ -18,7 +19,7 @@ function failureToastMessage(failMessage, failures) {}const named = labels.slice(0, MAX_NAMED_SCENES).join(', ');const more = labels.length > MAX_NAMED_SCENES ? `, +${labels.length - MAX_NAMED_SCENES} more` : '';- return `${failMessage} for ${failures.length} scenes${named ? ` (${named}${more})` : ''}${reason ? ` — ${reason}` : ''}`;+ return `${failMessage} for ${pluralize(failures.length, 'scene')}${named ? ` (${named}${more})` : ''}${reason ? ` — ${reason}` : ''}`;}/**diff --git a/client/src/hooks/useUniverseExpand.js b/client/src/hooks/useUniverseExpand.jsindex 25034ae00b..d907e5d42c 100644--- a/client/src/hooks/useUniverseExpand.js+++ b/client/src/hooks/useUniverseExpand.js@@ -18,9 +18,10 @@ import {} from '../lib/universeBuilderExpand';import { totalVariationCount } from '../lib/universeBuilderCounts';import { ensureDraftCategories } from '../lib/universeBuilderShared';+import { pluralize } from '../lib/textUtils';const expandToast = ({ variationCount, sheetCount, addedCanonCount, saved }) => {- const summary = `Expanded into ${variationCount} variations, ${sheetCount} boards, ${addedCanonCount} new canon entries`;+ const summary = `Expanded into ${pluralize(variationCount, 'variation')}, ${pluralize(sheetCount, 'board')}, ${pluralize(addedCanonCount, 'new canon entry', 'new canon entries')}`;return `${summary} — ${saved ? 'saved' : 'review then Save'}`;};diff --git a/client/src/hooks/useUniverseRender.js b/client/src/hooks/useUniverseRender.jsindex a7b5349c5f..30e7e72464 100644--- a/client/src/hooks/useUniverseRender.js+++ b/client/src/hooks/useUniverseRender.js@@ -5,6 +5,7 @@ import { useLocalStoragePersisted } from './useLocalStorageBool';import { useRenderJobQueue } from './useRenderJobQueue';import { renderPromptCount, scopedPromptCount } from '../lib/universeBuilderCounts';import { DEFAULT_RENDER_OPTS, TRUNK_TABS } from '../lib/universeBuilderShared';+import { pluralize } from '../lib/textUtils';/*** Owns Universe Builder batch-render configuration and queue orchestration.@@ -113,7 +114,7 @@ export default function useUniverseRender({// so every row can match its own job the moment the spinner would start.await syncEntryIdsFromServer?.();enqueueEntryJobs(result.entryJobs);- toast.success(`Queued ${result.promptCount} renders → "${result.collectionName}"`);+ toast.success(`Queued ${pluralize(result.promptCount, 'render')} → "${result.collectionName}"`);const updatedRuns = await listWorldRuns(selectedId).catch(() => runs);setRuns(updatedRuns);};diff --git a/client/src/pages/Calendar.jsx b/client/src/pages/Calendar.jsxindex 1da4e7119d..e28b0d0d4c 100644--- a/client/src/pages/Calendar.jsx+++ b/client/src/pages/Calendar.jsx@@ -108,7 +108,7 @@ export default function Calendar() {<span className="text-sm text-gray-500">{accounts === null? (loading ? 'Loading accounts…' : 'Accounts unavailable')- : `${formatCount(accounts.length)} accounts${accountsReady ? '' : ' (last loaded)'}`}+ : `${formatCount(accounts.length)} ${accounts.length === 1 ? 'account' : 'accounts'}${accountsReady ? '' : ' (last loaded)'}`}</span>}/>diff --git a/client/src/pages/Calendar.test.jsx b/client/src/pages/Calendar.test.jsxindex fb2a1da670..0b4c265c12 100644--- a/client/src/pages/Calendar.test.jsx+++ b/client/src/pages/Calendar.test.jsx@@ -84,7 +84,7 @@ describe('Calendar account availability', () => {fireEvent.click(screen.getByRole('button', { name: 'Retry' }));expect(await screen.findByText(account.name)).toBeVisible();- expect(screen.getByText('1 accounts')).toBeVisible();+ expect(screen.getByText('1 account')).toBeVisible();expect(screen.getByRole('button', { name: 'Add Account' })).toBeEnabled();expect(screen.queryByRole('alert')).toBeNull();expect(screen.getByLabelText('Current location')).toHaveTextContent('/calendar/config?from=2026-10-01');@@ -118,7 +118,7 @@ describe('Calendar account availability', () => {expect(screen.getByRole('button', { name: 'Sync' })).toBeEnabled();await act(async () => rejectRefresh(new Error('Refresh unavailable')));expect(await screen.findByRole('alert')).toHaveTextContent('snapshot is stale');- expect(screen.getByText('1 accounts (last loaded)')).toBeVisible();+ expect(screen.getByText('1 account (last loaded)')).toBeVisible();expect(within(screen.getByRole('region', { name: 'Last loaded calendar accounts' })).getByText(account.name)).toBeVisible();expect(screen.queryByRole('button', { name: 'Sync' })).toBeNull();selectTab('Config');@@ -171,6 +171,6 @@ describe('Calendar account availability', () => {expect(await screen.findByText(account.name)).toBeVisible();await act(async () => rejectFirst(new Error('Superseded read')));expect(screen.queryByRole('alert')).toBeNull();- expect(screen.getByText('1 accounts')).toBeVisible();+ expect(screen.getByText('1 account')).toBeVisible();});});diff --git a/client/src/pages/CodeAnimation.jsx b/client/src/pages/CodeAnimation.jsxindex 3535daa584..d7485f4ad2 100644--- a/client/src/pages/CodeAnimation.jsx+++ b/client/src/pages/CodeAnimation.jsx@@ -26,6 +26,7 @@ import {uploadFile,} from '../services/api';import { copyToClipboard } from '../lib/clipboard';+import { pluralize } from '../lib/textUtils';import { safeReadJsonStorage, safeWriteJsonStorage } from '../lib/safeStorage';import { UPLOAD_IMAGE_ACCEPT, validateImageFile } from '../utils/fileUpload';import { formatCount, timeAgo } from '../utils/formatters';@@ -414,7 +415,7 @@ function FastCodeAnimation() {event.target.value = '';if (!files.length) return;const room = Math.max(0, maxRefs - draft.referenceImages.length);- if (files.length > room) toast.error(`Only ${room} more reference image(s) fit`);+ if (files.length > room) toast.error(`Only ${pluralize(room, 'more reference image')} fit`);const valid = files.slice(0, room).filter((file) => {const invalid = validateImageFile(file, Infinity);if (invalid) toast.error(invalid);diff --git a/client/src/pages/Instances.jsx b/client/src/pages/Instances.jsxindex 757f6a0a1b..448dc6a28f 100644--- a/client/src/pages/Instances.jsx+++ b/client/src/pages/Instances.jsx@@ -47,6 +47,7 @@ import TailcatAddress from '../components/instances/TailcatAddress';import TailcatForwardStatus from '../components/instances/TailcatForwardStatus';import { timeAgo, timeUntil } from '../utils/formatters';import { directionalCounts, describeDirectional } from '../lib/syncCounts';+import { pluralize } from '../lib/textUtils';import PageSkeleton from '../components/ui/PageSkeleton';const STATUS_COLORS = {@@ -641,13 +642,13 @@ function FullSyncCoverageBadge({ peerId, peerInstanceId, refreshKey }) {}if (coverage.fullyMirrored) {return (- <span className="flex items-center gap-1 text-[10px] text-port-success" title={`All ${coverage.total} record(s) confirmed-delivered to this peer`}>- <CheckCircle2 size={11} /> Fully mirrored · {coverage.total} record{coverage.total !== 1 ? 's' : ''}+ <span className="flex items-center gap-1 text-[10px] text-port-success" title={`All ${pluralize(coverage.total, 'record')} confirmed delivered to this peer`}>+ <CheckCircle2 size={11} /> Fully mirrored · {pluralize(coverage.total, 'record')}</span>);}return (- <span className="flex items-center gap-1 text-[10px] text-port-warning" title={`${coverage.pending} of ${coverage.total} record(s) not yet confirmed-delivered`}>+ <span className="flex items-center gap-1 text-[10px] text-port-warning" title={`${coverage.pending} of ${pluralize(coverage.total, 'record')} not yet confirmed delivered`}><Clock size={11} /> {coverage.pending} pending · {coverage.confirmed}/{coverage.total} mirrored</span>);diff --git a/client/src/pages/Messages.jsx b/client/src/pages/Messages.jsxindex f5654553ed..8878da3be2 100644--- a/client/src/pages/Messages.jsx+++ b/client/src/pages/Messages.jsx@@ -19,6 +19,7 @@ import BeeperTab from '../components/messages/BeeperTab';import ContactsTab from '../components/messages/ContactsTab';import { getPageNavTabs } from '../../../server/lib/navManifest.js';import { buildPageNavTabs } from '../lib/pageNavTabs.js';+import { pluralize } from '../lib/textUtils.js';// Presentation per tab id. The manifest (`tabGroup: 'messages'`) owns// id/label/order — this page owns how each tab looks and behaves.@@ -161,7 +162,7 @@ export default function Messages() {// keys off, rather than teaching it a second "accounts" meaning.actions={loading || !ACCOUNT_TAB_IDS.has(activeTab) ? null : (<span className="text-sm text-gray-500">- {accounts === null ? 'Accounts unavailable' : `${accounts.length} accounts`}+ {accounts === null ? 'Accounts unavailable' : pluralize(accounts.length, 'account')}</span>)}/>diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsxindex b8d34f4057..fd5f1e1f6c 100644--- a/client/src/pages/MusicVideo.jsx+++ b/client/src/pages/MusicVideo.jsx@@ -84,6 +84,7 @@ import { autoArrangeScenes } from '../lib/beatGrid.js';import { isLtx2FamilyRuntime } from '../lib/runnerFamilies';import { videoPosterForJob } from '../lib/creativeDirectorPreview.js';import { sceneTakeList } from '../lib/musicVideoTakes.js';+import { pluralize } from '../lib/textUtils.js';import { deriveAttentionItems } from '../lib/musicVideoAttention.js';import { latestMusicVideoReviewDraft } from '../../../server/lib/musicVideoReviewDraft.js';import { useMusicVideoReviewDraft } from '../hooks/useMusicVideoReviewDraft.js';@@ -865,7 +866,7 @@ export default function MusicVideo() {splitMusicVideoScene(selected.id, sceneId, backend, { silent: true }).then(({ project, scenes }) => {replaceProject(project);- toast.success(`Split into ${scenes.length} shots`);+ toast.success(`Split into ${pluralize(scenes.length, 'shot')}`);}).catch((err) => toast.error(err?.message || 'Failed to split scene'));};diff --git a/client/src/pages/PipelineManuscriptEditor.jsx b/client/src/pages/PipelineManuscriptEditor.jsxindex 49a1e1aab0..8fb1a2b110 100644--- a/client/src/pages/PipelineManuscriptEditor.jsx+++ b/client/src/pages/PipelineManuscriptEditor.jsx@@ -45,6 +45,7 @@ import useLocalModels from '../hooks/useLocalModels';import useMounted from '../hooks/useMounted';import { locateAnchors } from '../lib/manuscriptAnchors';import { safeReadStorage, safeWriteStorage } from '../lib/safeStorage';+import { pluralize } from '../lib/textUtils';import ManuscriptLiveSection from '../components/pipeline/manuscript/ManuscriptLiveSection';import AnnotatedManuscriptSection from '../components/pipeline/manuscript/AnnotatedManuscriptSection';import ManuscriptCommentIndex from '../components/pipeline/manuscript/ManuscriptCommentIndex';@@ -314,8 +315,8 @@ function SeriesManuscriptEditor() {setReviewMeta({ chunked: !!result?.chunked, chunkCount: result?.chunkCount || 1 });const openCount = next.filter((c) => c.status === 'open').length;toast.success(result?.chunked- ? `Editorial review complete — ${openCount} open notes (reviewed in ${result.chunkCount} chunks)`- : `Editorial review complete — ${openCount} open notes`);+ ? `Editorial review complete — ${pluralize(openCount, 'open note')} (reviewed in ${pluralize(result.chunkCount, 'chunk')})`+ : `Editorial review complete — ${pluralize(openCount, 'open note')}`);},{ errorMessage: 'Failed to run editorial review' },);@@ -355,8 +356,8 @@ function SeriesManuscriptEditor() {}const openCount = next.filter((c) => c.status === 'open').length;toast.success(meta?.chunked- ? `Editorial review complete — ${openCount} open notes with drafted edits (reviewed in ${meta.chunkCount} chunks)`- : `Editorial review complete — ${openCount} open notes with drafted edits`);+ ? `Editorial review complete — ${pluralize(openCount, 'open note')} with drafted edits (reviewed in ${pluralize(meta.chunkCount, 'chunk')})`+ : `Editorial review complete — ${pluralize(openCount, 'open note')} with drafted edits`);}).catch((err) => { if (ownsView()) toast.error(err.message || 'Failed to load review'); });