Skip to content

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

fix: singular counts read "1 file"/"1 entry" instead of "1 files"/"1 entries" across backup, wiki log, messages, digest and import UI

Adam Eivy373567f8dcef
diff --git a/client/src/components/BackupWidget.jsx b/client/src/components/BackupWidget.jsx
index b07d62cd2f..f9dbcd408d 100644
--- a/client/src/components/BackupWidget.jsx
+++ b/client/src/components/BackupWidget.jsx
@@ -19,6 +19,7 @@ import { useSocketResource } from '../hooks/useSocketResource';
import { useTimeTick } from '../hooks/useTimeTick';
import { equalByKeys, equalListByKeys } from '../lib/compareHelpers';
import { timeAgo, timeUntil } from '../utils/formatters';
+import { pluralize } from '../lib/textUtils';
const RESOURCE_EVENTS = ['backup:changed'];
@@ -318,7 +319,7 @@ function SnapshotList({ restoringSnapshotId, onRestoreStateChange }) {
? 'Still being written…'
: snap.failed
? 'Backup failed — download available for salvage'
- : `${snap.fileCount} files`}
+ : pluralize(snap.fileCount, 'file')}
</div>
</div>
<div className="flex shrink-0 items-center gap-1">
@@ -448,7 +449,7 @@ const BackupWidget = memo(function BackupWidget() {
{status?.lastRun ? timeAgo(status.lastRun) : '—'}
</div>
{status?.filesChanged != null && (
- <div className="text-xs text-gray-600">{status.filesChanged} files changed</div>
+ <div className="text-xs text-gray-600">{pluralize(status.filesChanged, 'file')} changed</div>
)}
</div>
<div className="bg-port-bg/50 rounded-lg p-3">
diff --git a/client/src/components/cos/tabs/DigestTab.jsx b/client/src/components/cos/tabs/DigestTab.jsx
index a37041ad94..c168cfe146 100644
--- a/client/src/components/cos/tabs/DigestTab.jsx
+++ b/client/src/components/cos/tabs/DigestTab.jsx
@@ -19,6 +19,7 @@ import * as api from '../../../services/api';
import BrailleSpinner from '../../BrailleSpinner';
import Banner from '../../ui/Banner';
import { formatDateNumeric } from '../../../utils/formatters';
+import { pluralize } from '../../../lib/textUtils';
export default function DigestTab() {
const [currentDigest, setCurrentDigest] = useState(null);
@@ -129,7 +130,7 @@ export default function DigestTab() {
>
{digestList.map(d => (
<option key={d.weekId} value={d.weekId}>
- {d.weekId} ({d.totalTasks} tasks)
+ {d.weekId} ({pluralize(d.totalTasks, 'task')})
</option>
))}
</select>
diff --git a/client/src/components/cos/tabs/LearningTab.jsx b/client/src/components/cos/tabs/LearningTab.jsx
index b6faab9881..9d5184c550 100644
--- a/client/src/components/cos/tabs/LearningTab.jsx
+++ b/client/src/components/cos/tabs/LearningTab.jsx
@@ -35,6 +35,7 @@ import toast from '../../ui/Toast';
import * as api from '../../../services/api';
import BrailleSpinner from '../../BrailleSpinner';
import { formatDurationMin, formatDateTime, formatDateNumeric } from '../../../utils/formatters';
+import { pluralize } from '../../../lib/textUtils';
// Evidence pairing (issue #2617): when the server classified a task type on
// its recency-windowed rate, label the percentage with the WINDOW's sample
@@ -812,7 +813,7 @@ export default function LearningTab() {
</div>
<div className="flex justify-between text-xs text-gray-500">
<span>{info.desc}</span>
- <span>{model.completed} tasks • {model.avgDurationMin}m avg</span>
+ <span>{pluralize(model.completed, 'task')} • {model.avgDurationMin}m avg</span>
</div>
</div>
);
diff --git a/client/src/components/digital-twin/tabs/ImportTab.jsx b/client/src/components/digital-twin/tabs/ImportTab.jsx
index b132f39cf6..e83078a57e 100644
--- a/client/src/components/digital-twin/tabs/ImportTab.jsx
+++ b/client/src/components/digital-twin/tabs/ImportTab.jsx
@@ -19,6 +19,7 @@ import toast from '../../ui/Toast';
import TwinProviderPicker from '../TwinProviderPicker.jsx';
import { formatBytes } from '../../../utils/formatters';
import FilePickerButton from '../../ui/FilePickerButton';
+import { pluralize } from '../../../lib/textUtils';
const SOURCE_ICONS = {
goodreads: BookOpen,
@@ -99,7 +100,7 @@ export default function ImportTab() {
toast.error(result.error);
} else {
setAnalysisResult(result);
- toast.success(`Analyzed ${result.itemCount} items from ${selectedSource.name}`);
+ toast.success(`Analyzed ${pluralize(result.itemCount, 'item')} from ${selectedSource.name}`);
}
setAnalyzing(false);
diff --git a/client/src/components/messages/MessageDetail.jsx b/client/src/components/messages/MessageDetail.jsx
index 47bfa652df..cd15ec5759 100644
--- a/client/src/components/messages/MessageDetail.jsx
+++ b/client/src/components/messages/MessageDetail.jsx
@@ -231,7 +231,7 @@ export default function MessageDetail({ message, accounts, onBack }) {
<div className="flex-1 min-w-0">
<h2 className="text-sm font-medium text-white truncate">{displayedMessage.subject || '(no subject)'}</h2>
{hasThread && (
- <span className="text-xs text-gray-500">{formatCount(threadMessages.length)} messages</span>
+ <span className="text-xs text-gray-500">{formatCount(threadMessages.length)} {threadMessages.length === 1 ? 'message' : 'messages'}</span>
)}
</div>
<div className="flex flex-wrap items-center justify-end gap-1">
diff --git a/client/src/components/musicVideo/DocumentCompositionPanel.jsx b/client/src/components/musicVideo/DocumentCompositionPanel.jsx
index e6b79e019d..8ac182e493 100644
--- a/client/src/components/musicVideo/DocumentCompositionPanel.jsx
+++ b/client/src/components/musicVideo/DocumentCompositionPanel.jsx
@@ -22,6 +22,7 @@ import {
reviseMusicVideoMixedMediaEvents, updateMusicVideoProject,
getMusicVideoMixedMediaCandidate, acceptMusicVideoMixedMediaDocument, discardMusicVideoMixedMediaDocument,
} from '../../services/apiMusicVideo.js';
+import { pluralize } from '../../lib/textUtils';
const buttonCls = 'flex items-center gap-1 bg-port-bg border border-port-border rounded px-2 py-1.5 text-sm min-h-[44px] sm:min-h-0 disabled:opacity-50';
const inputCls = 'bg-port-bg border border-port-border rounded px-1.5 py-1 text-xs min-h-[44px] sm:min-h-0';
@@ -232,7 +233,7 @@ export default function DocumentCompositionPanel({ project, audioUrl, onProject,
<div className="flex items-center gap-2 text-sm text-port-text">
<span>Composition document</span>
{doc && <span className="text-xs text-port-text-muted">
- {doc.files != null && `${doc.files} files`}
+ {doc.files != null && pluralize(doc.files, 'file')}
{doc.bytes != null && ` · ${formatBytes(doc.bytes)}`}
{doc.updatedAt && ` · updated ${timeAgo(doc.updatedAt)}`}
</span>}
diff --git a/client/src/components/universeBuilder/graph/GraphTimeline.jsx b/client/src/components/universeBuilder/graph/GraphTimeline.jsx
index cc9631f51d..6c6934c1f9 100644
--- a/client/src/components/universeBuilder/graph/GraphTimeline.jsx
+++ b/client/src/components/universeBuilder/graph/GraphTimeline.jsx
@@ -74,7 +74,7 @@ export default function GraphTimeline({
</button>
<div className="text-xs text-white font-medium min-w-[220px]">
{current ? current.name : 'Whole universe'}
- <span className="font-normal text-gray-500"> · {current ? `${seriesName} · ${entriesIntroduced} entries so far` : seriesName}</span>
+ <span className="font-normal text-gray-500"> · {current ? `${seriesName} · ${pluralize(entriesIntroduced, 'entry', 'entries')} so far` : seriesName}</span>
</div>
<div className="flex-1" />
<button
diff --git a/client/src/components/wiki/tabs/LogTab.jsx b/client/src/components/wiki/tabs/LogTab.jsx
index 3ede7d61ea..8807f2c918 100644
--- a/client/src/components/wiki/tabs/LogTab.jsx
+++ b/client/src/components/wiki/tabs/LogTab.jsx
@@ -80,7 +80,7 @@ export default function LogTab({ vaultId, allNotes }) {
<div className="flex items-center justify-between mb-4">
<h3 className="text-sm font-medium text-white">Activity Log</h3>
<div className="flex items-center gap-2 text-xs text-gray-500">
- <span>{formatCount(entries.length)} entries</span>
+ <span>{formatCount(entries.length)} {entries.length === 1 ? 'entry' : 'entries'}</span>
{log.modifiedAt && <span>Updated {timeAgo(log.modifiedAt)}</span>}
<button onClick={loadLog} aria-label="Refresh" className="min-h-[44px] min-w-[44px] inline-flex items-center justify-center p-1 rounded hover:bg-port-card text-gray-500 hover:text-white">
<RefreshCw size={12} />
diff --git a/client/src/pages/Browser.jsx b/client/src/pages/Browser.jsx
index 7c4b34a3cc..2daba031fa 100644
--- a/client/src/pages/Browser.jsx
+++ b/client/src/pages/Browser.jsx
@@ -17,6 +17,7 @@ import BrailleSpinner from '../components/BrailleSpinner';
import toast from '../components/ui/Toast';
import { FormField } from '../components/ui/FormField';
import { formatBytes, formatDateTime, formatDurationMs } from '../utils/formatters';
+import { pluralize } from '../lib/textUtils';
const STATUS_EVENTS = ['browser:changed'];
const readStatus = () => getBrowserStatus({ silent: true });
@@ -673,7 +674,7 @@ export default function BrowserPage() {
</div>
<div className="flex items-center justify-between">
<span className="text-gray-400 text-sm">Downloads</span>
- <span className="text-sm font-medium text-port-success">{status?.downloads?.files?.length ?? 0} files</span>
+ <span className="text-sm font-medium text-port-success">{pluralize(status?.downloads?.files?.length ?? 0, 'file')}</span>
</div>
</div>
</div>
diff --git a/client/src/pages/CreateApp.jsx b/client/src/pages/CreateApp.jsx
index 39d9cb8786..08cc76f37f 100644
--- a/client/src/pages/CreateApp.jsx
+++ b/client/src/pages/CreateApp.jsx
@@ -8,6 +8,7 @@ import IconPicker from '../components/IconPicker';
import FolderPicker from '../components/FolderPicker';
import Banner from '../components/ui/Banner';
import { NON_PM2_TYPES, isStandardizable, getAppTypeLabel } from '../components/apps/constants';
+import { pluralize } from '../lib/textUtils';
const DETECTION_STEPS_PM2 = [
{ id: 'validate', label: 'Validating path' },
@@ -584,7 +585,7 @@ export default function CreateApp() {
onClick={() => setShowLog(!showLog)}
className="text-xs text-gray-500 hover:text-gray-400"
>
- {showLog ? 'Hide' : 'Show'} detection log ({detectionLog.length} entries)
+ {showLog ? 'Hide' : 'Show'} detection log ({pluralize(detectionLog.length, 'entry', 'entries')})
</button>
{showLog && (
<div className="mt-2 p-2 bg-port-bg rounded text-xs font-mono text-gray-400 max-h-40 overflow-auto">