Skip to content

Commit 453f3a2

Browse files
committed
chore(web): clear dead code so real findings are visible
21 unused-variable warnings, and working out that none of them was a bug meant reading each one. That is the actual cost: `'message' is assigned but never used` in BlockManager looked exactly like a swallowed error message, and `'err' is defined but never used` in LiveTaskPanel looked exactly like a swallowed exception. Neither was — but noise that has to be triaged one by one is noise that hides the one that matters. Removed: dead lucide imports across nine components, two dead type imports in the API client, a `FileInfo` interface and a `STATUS_META` table in FileInspector left behind by a refactor, a `message` string in BlockManager fully superseded by the `confirm({title, description})` call two lines below it, and two locals in LiveTaskPanel shadowed by the merge underneath them. MarkdownEditor held a `doc` state that was written and never read, so the whole useState goes rather than the value being renamed to satisfy the linter. The two catch-related ones are kept and explained instead. LiveTaskPanel's silent poll catch is correct and the reasoning is now in the code: a poll that fails every couple of seconds must not spam the user, and a persistent failure is already visible because lastPollTime only advances on success, so the panel's "Updated N ago" goes stale and says so without a toast. 50 eslint warnings to 32, with the unused-vars class at zero. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UiLDxnEu1Gf8Q5hWAFhaAd
1 parent a5afdd2 commit 453f3a2

11 files changed

Lines changed: 8 additions & 39 deletions

File tree

‎web/src/api/client.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ import type {
1616
StartRunResponse,
1717
LatestRunResponse,
1818
InterruptedRun,
19-
RunEvent,
2019
Skill,
2120
AgentSpec,
2221
PipelineView,
2322
PipelineConfig,
24-
DynamicComposition,
2523
CompositionGetResponse,
2624
CompositionPreviewResponse,
2725
DocItem,

‎web/src/components/Agents/AgentManager.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
Trash2,
88
Edit3,
99
Check,
10-
X,
1110
Cpu,
1211
Wrench,
1312
Thermometer,

‎web/src/components/Blocks/BlockEditor.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
AlertCircle,
2424
Archive,
2525
Bot,
26-
CheckCircle2,
2726
ChevronDown,
2827
ChevronUp,
2928
Code2,

‎web/src/components/Blocks/BlockManager.tsx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ export default function BlockManager() {
127127

128128
const handleDelete = async (block: BlockCatalogEntry) => {
129129
const title = KIND_TITLES[block.kind] || block.kind;
130-
const message = block.custom
131-
? `Delete ${title.toLowerCase()} "${block.name || block.id}"?`
132-
: `Delete ${title.toLowerCase()} "${block.name || block.id}"? This removes the override of the builtin block.`;
133130
const ok = await confirm({
134131
title: `Delete ${title.toLowerCase()} "${block.name || block.id}"?`,
135132
description: block.custom ? undefined : 'This removes the override of the builtin block.',

‎web/src/components/Docs/MarkdownEditor.tsx‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import { useState, useEffect, useCallback } from 'react';
22
import { useParams } from 'react-router-dom';
3-
import { getDoc, updateDoc, listDocs } from '@/api/client';
4-
import type { DocItem } from '@/types';
3+
import { getDoc, updateDoc } from '@/api/client';
54
import { Save, FileText, Loader } from 'lucide-react';
65

76
export default function MarkdownEditor() {
87
const { docId } = useParams<{ docId: string }>();
9-
const [doc, setDoc] = useState<DocItem | null>(null);
108
const [content, setContent] = useState('');
119
const [loading, setLoading] = useState(true);
1210
const [saving, setSaving] = useState(false);
@@ -17,7 +15,6 @@ export default function MarkdownEditor() {
1715
setLoading(true);
1816
try {
1917
const d = await getDoc(docId);
20-
setDoc(d);
2118
setContent(d.content || '');
2219
} catch (e) {
2320
console.error('Failed to load doc:', e);

‎web/src/components/Files/FileInspector.tsx‎

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ import {
55
FileMinus,
66
FilePenLine,
77
MessageSquare,
8-
GitBranch,
98
PlusCircle,
109
Send,
11-
Clock,
1210
Flag,
1311
X,
1412
CornerDownRight,
@@ -21,21 +19,14 @@ import {
2119
Eye,
2220
EyeOff,
2321
} from 'lucide-react';
24-
import { addTask, updateDoc, getDoc, getWorkspaceFile, getWorkspaceTree } from '@/api/client';
22+
import { addTask, getWorkspaceFile, getWorkspaceTree } from '@/api/client';
2523
import type { RunEvent } from '@/types';
2624
import clsx from 'clsx';
2725

2826
// ── Types ──
2927

3028
type FileStatus = 'changed' | 'created' | 'deleted' | 'unchanged';
3129

32-
interface FileInfo {
33-
path: string;
34-
status: FileStatus;
35-
events: RunEvent[];
36-
lastEvent: RunEvent | null;
37-
}
38-
3930
interface LineComment {
4031
id: string;
4132
line: number;
@@ -83,15 +74,6 @@ function extractModifiedPaths(events: RunEvent[]): Set<string> {
8374
return paths;
8475
}
8576

86-
// ── Status helpers ──
87-
88-
const STATUS_META: Record<FileStatus, { icon: typeof FileCode; label: string; cls: string; dotCls: string }> = {
89-
changed: { icon: FilePenLine, label: 'Modified', cls: 'text-amber-600 dark:text-amber-400', dotCls: 'bg-amber-400' },
90-
created: { icon: FilePlus, label: 'Created', cls: 'text-emerald-600 dark:text-emerald-400', dotCls: 'bg-emerald-400' },
91-
deleted: { icon: FileMinus, label: 'Deleted', cls: 'text-red-600 dark:text-red-400', dotCls: 'bg-red-400' },
92-
unchanged: { icon: FileCode, label: '', cls: 'text-gray-400 dark:text-gray-500', dotCls: 'bg-gray-300 dark:bg-gray-600' },
93-
};
94-
9577
// ── Simple syntax highlighter ──
9678

9779
interface Token { text: string; type: 'keyword' | 'string' | 'comment' | 'number' | 'function' | 'type' | 'plain'; }

‎web/src/components/Live/LiveFileInspector.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
GitBranch,
66
PlusCircle,
77
Flag,
8-
Eye,
98
ChevronDown,
109
ChevronRight,
1110
Send,

‎web/src/components/Live/LiveTaskPanel.tsx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import type { Task, AgentSpec, Board } from '@/types';
1616
import clsx from 'clsx';
1717
import {
1818
Plus,
19-
Edit3,
2019
Trash2,
2120
Save,
2221
X,
@@ -192,8 +191,6 @@ export default function LiveTaskPanel() {
192191
setOptimisticTasks((prev) => {
193192
if (!prev || !Array.isArray(prev)) return [];
194193
const tasks = b.tasks || [];
195-
const cols = b.columns || [];
196-
const byCol = b.by_column || {};
197194
const serverIds = new Set(tasks.map((t) => t.id));
198195
// Keep only optimistic tasks whose IDs are not yet in the server response
199196
const stillMissing = prev.filter((t) => !serverIds.has(t.id));
@@ -239,8 +236,11 @@ export default function LiveTaskPanel() {
239236
});
240237

241238
setLastPollTime(Date.now());
242-
} catch (err) {
243-
// silently ignore polling errors
239+
} catch {
240+
// Deliberately silent. A poll that fails every couple of seconds must not
241+
// spam the user, and a persistent failure is already visible: lastPollTime
242+
// only advances on success, so the panel's "Updated N ago" goes stale and
243+
// says so without a single toast.
244244
} finally {
245245
setTasksLoading(false);
246246
setRefreshing(false);

‎web/src/components/Review/ReviewView.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
import clsx from 'clsx';
1414
import { AppContext } from '@/App';
1515
import { applyPendingChanges, getPendingReview, rejectPendingChanges } from '@/api/client';
16-
import type { PendingChange, ReviewQueue } from '@/types';
16+
import type { ReviewQueue } from '@/types';
1717
import { useToast } from '@/components/ui/Toast';
1818
import { useConfirm } from '@/components/ui/Modal';
1919
import DiffView, { type DiffMode } from './DiffView';

‎web/src/components/Settings/SettingsPanel.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import AutoConfigure from './AutoConfigure';
1010
import {
1111
Cpu,
1212
Key,
13-
Sliders,
1413
ShieldCheck,
1514
Gauge,
1615
Wrench,

0 commit comments

Comments
 (0)