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

refactor: fix Codex lint pass issues — dead code, circular deps, unnecessary re-renders

[._.]/ Adam Eivy049d173b56be
diff --git a/client/src/components/apps/tabs/DocumentsTab.jsx b/client/src/components/apps/tabs/DocumentsTab.jsx
index 15fb71ecb5..86b8668ebe 100644
--- a/client/src/components/apps/tabs/DocumentsTab.jsx
+++ b/client/src/components/apps/tabs/DocumentsTab.jsx
@@ -37,7 +37,8 @@ export default function DocumentsTab({ appId, repoPath }) {
if (firstExisting && !selectedDoc) {
loadDocument(firstExisting.filename);
}
- }, [appId, selectedDoc, loadDocument]);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [appId, loadDocument]);
const enterEditMode = () => {
setEditContent(docContent || '');
diff --git a/client/src/components/cos/tabs/ScheduleTab.jsx b/client/src/components/cos/tabs/ScheduleTab.jsx
index 468d0e1d53..95c002839e 100644
--- a/client/src/components/cos/tabs/ScheduleTab.jsx
+++ b/client/src/components/cos/tabs/ScheduleTab.jsx
@@ -1,5 +1,5 @@
import { useState, useEffect, useCallback, useRef } from 'react';
-import { Clock, Play, RotateCcw, ChevronDown, ChevronRight, CheckCircle, XCircle, AlertCircle, RefreshCw, Package } from 'lucide-react';
+import { Play, RotateCcw, ChevronDown, ChevronRight, AlertCircle, RefreshCw, Package } from 'lucide-react';
import toast from 'react-hot-toast';
import * as api from '../../../services/api';
import AppIcon from '../../AppIcon';
@@ -22,18 +22,6 @@ const INTERVAL_DESCRIPTIONS = {
custom: 'Custom interval'
};
-function formatTimeRemaining(ms) {
- if (!ms || ms <= 0) return 'now';
- const hours = Math.floor(ms / (60 * 60 * 1000));
- const minutes = Math.floor((ms % (60 * 60 * 1000)) / (60 * 1000));
- if (hours > 24) {
- const days = Math.floor(hours / 24);
- return `${days}d ${hours % 24}h`;
- }
- if (hours > 0) return `${hours}h ${minutes}m`;
- return `${minutes}m`;
-}
-
function toggleMetadataField(metadata, field) {
const current = metadata || {};
const newMeta = { ...current, [field]: !current[field] };
@@ -60,56 +48,6 @@ function IntervalBadge({ type }) {
);
}
-function StatusIndicator({ config }) {
- const status = config.status || {};
- const isEligible = status.shouldRun;
- const nextRunText = status.nextRunAt
- ? formatTimeRemaining(new Date(status.nextRunAt).getTime() - Date.now())
- : null;
-
- if (isEligible) {
- return (
- <span className="flex items-center gap-1 text-xs text-port-success">
- <CheckCircle size={12} />
- Ready
- </span>
- );
- }
- if (status.reason === 'disabled') {
- return (
- <span className="flex items-center gap-1 text-xs text-gray-500">
- <XCircle size={12} />
- Disabled
- </span>
- );
- }
- if (status.reason === 'on-demand-only') {
- return (
- <span className="flex items-center gap-1 text-xs text-port-accent">
- <Clock size={12} />
- On Demand
- </span>
- );
- }
- if (status.reason === 'once-completed') {
- return (
- <span className="flex items-center gap-1 text-xs text-port-warning">
- <CheckCircle size={12} />
- Completed
- </span>
- );
- }
- if (nextRunText) {
- return (
- <span className="flex items-center gap-1 text-xs text-gray-400">
- <Clock size={12} />
- {nextRunText}
- </span>
- );
- }
- return null;
-}
-
function GlobalConfigControls({ taskType, config, onUpdate, onTrigger, onReset, category: _category, providers, apps, updating, setUpdating }) {
const [selectedType, setSelectedType] = useState(config.type);
const [selectedProviderId, setSelectedProviderId] = useState(config.providerId || '');
@@ -408,64 +346,6 @@ function GlobalConfigControls({ taskType, config, onUpdate, onTrigger, onReset,
);
}
-function TaskTypeRow({ taskType, config, onUpdate, onTrigger, onReset, category, providers, apps }) {
- const [expanded, setExpanded] = useState(false);
- const [updating, setUpdating] = useState(false);
-
- return (
- <div className="border border-port-border rounded-lg">
- <div
- className={`flex items-center gap-3 p-3 bg-port-card hover:bg-port-card/80 cursor-pointer ${expanded ? 'rounded-t-lg' : 'rounded-lg'}`}
- onClick={() => setExpanded(!expanded)}
- >
- <button
- className="text-gray-500 hover:text-white"
- onClick={(e) => { e.stopPropagation(); setExpanded(!expanded); }}
- aria-label={expanded ? 'Collapse' : 'Expand'}
- >
- {expanded ? <ChevronDown size={16} /> : <ChevronRight size={16} />}
- </button>
-
- <div className="flex-1 min-w-0">
- <div className="flex items-center gap-2">
- <span className="font-mono text-sm text-white">{taskType}</span>
- {!config.enabled && (
- <span className="text-xs px-2 py-0.5 bg-gray-600/50 text-gray-400 rounded">Disabled</span>
- )}
- </div>
- {config.lastRun && (
- <div className="text-xs text-gray-500">
- Last run: {new Date(config.lastRun).toLocaleDateString()} ({config.runCount || 0} total)
- </div>
- )}
- </div>
-
- <div className="flex items-center gap-2">
- <StatusIndicator config={config} />
- <IntervalBadge type={config.type} />
- </div>
- </div>
-
- {expanded && (
- <div className="p-4 border-t border-port-border bg-port-bg/50">
- <GlobalConfigControls
- taskType={taskType}
- config={config}
- onUpdate={onUpdate}
- onTrigger={onTrigger}
- onReset={onReset}
- category={category}
- providers={providers}
- apps={apps}
- updating={updating}
- setUpdating={setUpdating}
- />
- </div>
- )}
- </div>
- );
-}
-
function AppOverrideRow({ app, taskType, globalIntervalType, globalTaskMetadata, override, onUpdate }) {
const [updating, setUpdating] = useState(false);
const isEnabled = override?.enabled !== false;
@@ -693,42 +573,6 @@ function AppTaskTypeRow({ taskType, config, onUpdate, onTrigger, onReset, provid
);
}
-function _TaskTypeSection({ title, description, tasks, onUpdate, onTrigger, onReset, category, providers, apps }) {
- const _TaskTypeSection = true;
- const taskEntries = Object.entries(tasks || {});
- if (taskEntries.length === 0) return null;
-
- const enabledCount = taskEntries.filter(([, config]) => config.enabled).length;
- const readyCount = taskEntries.filter(([, config]) => config.status?.shouldRun).length;
-
- return (
- <div className="space-y-3">
- <div className="flex items-center gap-2">
- <h3 className="text-lg font-semibold text-white">{title}</h3>
- <span className="text-xs text-gray-500">
- {enabledCount} enabled, {readyCount} ready
- </span>
- </div>
- {description && <p className="text-sm text-gray-400">{description}</p>}
- <div className="space-y-2">
- {taskEntries.map(([taskType, config]) => (
- <TaskTypeRow
- key={taskType}
- taskType={taskType}
- config={config}
- onUpdate={onUpdate}
- onTrigger={onTrigger}
- onReset={onReset}
- category={category}
- providers={providers}
- apps={apps}
- />
- ))}
- </div>
- </div>
- );
-}
-
function AppTaskTypeSection({ tasks, onUpdate, onTrigger, onReset, providers, apps, onUpdateOverride, onBulkToggleOverride }) {
const taskEntries = Object.entries(tasks || {});
if (taskEntries.length === 0) return null;
diff --git a/client/src/components/digital-twin/tabs/EnrichTab.jsx b/client/src/components/digital-twin/tabs/EnrichTab.jsx
index 449acb10fc..97c8d67afd 100644
--- a/client/src/components/digital-twin/tabs/EnrichTab.jsx
+++ b/client/src/components/digital-twin/tabs/EnrichTab.jsx
@@ -22,7 +22,6 @@ import ScaleInput from '../ScaleInput';
export default function EnrichTab({ onRefresh }) {
const [searchParams, setSearchParams] = useSearchParams();
- const [_categories, _setCategories] = useState([]);
const [progress, setProgress] = useState(null);
const [loading, setLoading] = useState(true);
@@ -46,10 +45,7 @@ export default function EnrichTab({ onRefresh }) {
const loadData = useCallback(async () => {
setLoading(true);
- const [_categoriesData, progressData] = await Promise.all([
- api.getSoulEnrichCategories().catch(() => []),
- api.getSoulEnrichProgress().catch(() => null)
- ]);
+ const progressData = await api.getSoulEnrichProgress().catch(() => null);
setProgress(progressData);
setLoading(false);
}, []);
diff --git a/client/src/components/meatspace/HealthCategorySection.jsx b/client/src/components/meatspace/HealthCategorySection.jsx
index 04f0734b20..a33d30e9e6 100644
--- a/client/src/components/meatspace/HealthCategorySection.jsx
+++ b/client/src/components/meatspace/HealthCategorySection.jsx
@@ -48,7 +48,8 @@ export default function HealthCategorySection({ category, from, to, expanded, on
});
return () => { cancelled = true; };
- }, [activeMetrics, expanded, from, metricData, rangeKey, to]);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [expanded, rangeKey]);
return (
<div className="border border-port-border rounded-xl overflow-hidden">
diff --git a/client/src/components/messages/InboxTab.jsx b/client/src/components/messages/InboxTab.jsx
index 2161ae2724..71977d169b 100644
--- a/client/src/components/messages/InboxTab.jsx
+++ b/client/src/components/messages/InboxTab.jsx
@@ -35,7 +35,6 @@ const TRIAGE_TABS = [
export default function InboxTab({ accounts }) {
const [messages, setMessages] = useState([]);
- const [_total, setTotal] = useState(0);
const [loading, setLoading] = useState(true);
const [search, setSearch] = useState('');
const [debouncedSearch, setDebouncedSearch] = useState('');
@@ -62,7 +61,6 @@ export default function InboxTab({ accounts }) {
if (debouncedSearch) params.search = debouncedSearch;
const result = await api.getMessageInbox(params).catch(() => ({ messages: [], total: 0 }));
setMessages(result.messages || []);
- setTotal(result.total || 0);
setLoading(false);
}, [selectedAccount, debouncedSearch]);
@@ -175,7 +173,6 @@ export default function InboxTab({ accounts }) {
if (result?.success) {
toast.success(`Message ${action === 'archive' ? 'archived' : 'deleted'}`);
setMessages(prev => prev.filter(m => m.id !== msg.id));
- setTotal(prev => Math.max(0, prev - 1));
}
};
diff --git a/client/src/hooks/useCityAudio.js b/client/src/hooks/useCityAudio.js
index 11498593af..a68bf5152b 100644
--- a/client/src/hooks/useCityAudio.js
+++ b/client/src/hooks/useCityAudio.js
@@ -39,14 +39,14 @@ export default function useCityAudio(settings) {
// Toggle music on/off based on settings
useEffect(() => {
- if (!isAudioReady || settings == null) return;
+ if (!isAudioReady || musicEnabled == null) return;
if (musicEnabled) {
startMusic();
setMusicVolume(musicVolume);
} else {
stopMusic();
}
- }, [isAudioReady, musicEnabled, musicVolume, settings]);
+ }, [isAudioReady, musicEnabled, musicVolume]);
// Update music volume
useEffect(() => {
@@ -56,9 +56,9 @@ export default function useCityAudio(settings) {
// Update SFX volume
useEffect(() => {
- if (!isAudioReady || settings == null) return;
+ if (!isAudioReady || sfxVolume == null) return;
setSfxVolume(sfxVolume);
- }, [isAudioReady, settings, sfxVolume]);
+ }, [isAudioReady, sfxVolume]);
// Cleanup on unmount
useEffect(() => {