Skip to content

Commit ed0e2fd

Browse files
echobtfactorydroid
andauthored
fix(gui): clean up TypeScript errors in remote, viewers, and misc components (#307)
AGENT 10 Analysis - Remote, Viewers & Misc Components Fixed TypeScript errors (TS6133 unused imports/variables) in the following files: Remote Components: - ContainerConnect.tsx: Removed unused Badge import, removed unused canStop function, fixed Text component class prop usage by using truncate prop and wrapper divs - PortForwarding.tsx: Removed unused ForwardedPort type import - TunnelManager.tsx: Removed unused onMount import - WSLConnect.tsx: Removed unused createEffect import Viewers: - ImageViewer.tsx: Removed unused For import from solid-js - SVGPreview.tsx: Removed unused monacoInstance variable, fixed null safety in editor content change handler Misc Components: - VoiceInput.tsx: Removed unused onCleanup import, removed unused stopListening from VoiceMicButton - ToolchainSelector.tsx: Removed unused onCleanup import - DesignSystemCard.tsx: Removed unused Input import - PlanCard.tsx: Removed unused IconButton import Co-authored-by: Droid Agent <droid@factory.ai>
1 parent bfa60e7 commit ed0e2fd

10 files changed

Lines changed: 28 additions & 26 deletions

File tree

cortex-gui/src/components/ToolchainSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createSignal, createEffect, Show, For, onMount, onCleanup, createMemo } from "solid-js";
1+
import { createSignal, createEffect, Show, For, onMount, createMemo } from "solid-js";
22
import { Icon } from "./ui/Icon";
33
import { useToolchain, type ToolchainKind, type ToolchainInfo } from "@/context/ToolchainContext";
44

cortex-gui/src/components/VoiceInput.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Show, createMemo, createEffect, onCleanup } from "solid-js";
1+
import { Show, createMemo, createEffect } from "solid-js";
22
import { Icon } from "./ui/Icon";
33
import { useSpeech, type SpeechLanguage } from "@/context/SpeechContext";
44

@@ -35,7 +35,7 @@ export interface VoiceInputProps {
3535
* - Keyboard shortcut (Ctrl+Alt+V) handled by SpeechContext
3636
*/
3737
export function VoiceInput(props: VoiceInputProps) {
38-
const { state, startListening, stopListening, toggleListening, clearTranscript, setLanguage, getAvailableLanguages } = useSpeech();
38+
const { state, stopListening, toggleListening, clearTranscript, setLanguage, getAvailableLanguages } = useSpeech();
3939

4040
let languageSelectRef: HTMLSelectElement | undefined;
4141

@@ -453,7 +453,7 @@ export function VoiceMicButton(props: {
453453
size?: "sm" | "md" | "lg";
454454
onTranscriptReady?: (transcript: string) => void;
455455
}) {
456-
const { state, toggleListening, clearTranscript, stopListening } = useSpeech();
456+
const { state, toggleListening, clearTranscript } = useSpeech();
457457

458458
// Watch for transcript completion and notify parent
459459
createEffect(() => {

cortex-gui/src/components/remote/ContainerConnect.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createSignal, createEffect, For, Show, createMemo, onMount, onCleanup } from "solid-js";
22
import { Icon } from "../ui/Icon";
33
import { useRemote, DevContainer, ContainerStatus, DevContainerConfig } from "@/context/RemoteContext";
4-
import { Button, IconButton, Input, Text, Badge } from "@/components/ui";
4+
import { Button, IconButton, Input, Text } from "@/components/ui";
55

66
interface ContainerConnectProps {
77
onContainerSelect?: (containerId: string) => void;
@@ -56,7 +56,6 @@ function ContainerCard(props: {
5656

5757
const canConnect = () => props.container.status === "running";
5858
const canStart = () => props.container.status === "stopped";
59-
const canStop = () => props.container.status === "running" || props.container.status === "starting";
6059
const isBusy = () => props.container.status === "building" || props.container.status === "starting";
6160

6261
const formatUptime = (startedAt?: number) => {
@@ -371,16 +370,18 @@ function BuildFromDevContainerDialog(props: {
371370
>
372371
<Icon name="gear" class="w-4 h-4 mt-0.5 flex-shrink-0" style={{ color: "var(--accent)" }} />
373372
<div class="min-w-0">
374-
<Text size="sm" weight="medium" class="truncate">
373+
<Text size="sm" weight="medium" truncate>
375374
{config.name || "Default Configuration"}
376375
</Text>
377-
<Text size="xs" color="muted" class="truncate">
376+
<Text size="xs" color="muted" truncate>
378377
{config.path}
379378
</Text>
380379
<Show when={config.image}>
381-
<Text size="xs" color="muted" class="mt-1">
382-
Image: {config.image}
383-
</Text>
380+
<div class="mt-1">
381+
<Text size="xs" color="muted">
382+
Image: {config.image}
383+
</Text>
384+
</div>
384385
</Show>
385386
</div>
386387
</Button>
@@ -610,9 +611,11 @@ export function ContainerConnect(props: ContainerConnectProps) {
610611
<p class="text-sm font-medium mb-1" style={{ color: "var(--text-weak)" }}>
611612
No Dev Containers
612613
</p>
613-
<Text size="xs" color="muted" class="mb-4">
614-
Build a container from devcontainer.json to get started
615-
</Text>
614+
<div class="mb-4">
615+
<Text size="xs" color="muted">
616+
Build a container from devcontainer.json to get started
617+
</Text>
618+
</div>
616619
<Button
617620
onClick={() => setShowBuildDialog(true)}
618621
variant="primary"

cortex-gui/src/components/remote/PortForwarding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createSignal, For, Show, onMount, onCleanup, createMemo } from "solid-js";
22
import { Icon } from "../ui/Icon";
3-
import { useRemote, ForwardedPort, ForwardedPortStatus } from "@/context/RemoteContext";
3+
import { useRemote, ForwardedPortStatus } from "@/context/RemoteContext";
44
import { Button, IconButton } from "@/components/ui";
55

66
interface PortForwardingProps {

cortex-gui/src/components/remote/TunnelManager.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createSignal, For, Show, createMemo, onCleanup, onMount, createEffect } from "solid-js";
1+
import { createSignal, For, Show, createMemo, onCleanup, createEffect } from "solid-js";
22
import { Icon } from "../ui/Icon";
33
import { useRemote, TunnelInfo, TunnelStatus, TunnelAuthProvider } from "@/context/RemoteContext";
44
import { Button, IconButton } from "@/components/ui";

cortex-gui/src/components/remote/WSLConnect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createSignal, For, Show, onMount, createEffect } from "solid-js";
1+
import { createSignal, For, Show, onMount } from "solid-js";
22
import { Icon } from "../ui/Icon";
33
import { useRemote, WSLDistro, WSLConnectionStatus } from "@/context/RemoteContext";
44

cortex-gui/src/components/tools/DesignSystemCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Show, For, createSignal, createEffect, onMount, createMemo } from "solid-js";
22
import { Icon } from "../ui/Icon";
33
import { ToolCall, useSDK } from "@/context/SDKContext";
4-
import { Card, Button, Text, Badge, Input, IconButton } from "@/components/ui";
4+
import { Card, Button, Text, Badge, IconButton } from "@/components/ui";
55

66
interface FontWeight {
77
value: number;

cortex-gui/src/components/tools/PlanCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createSignal, Show, For } from "solid-js";
22
import { Icon } from "../ui/Icon";
3-
import { Card, Button, Text, Badge, Textarea, IconButton } from "@/components/ui";
3+
import { Card, Button, Text, Badge, Textarea } from "@/components/ui";
44

55
interface AgentAnalysis {
66
agent: string;

cortex-gui/src/components/viewers/ImageViewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createSignal, createEffect, onCleanup, Show, For, createMemo } from "solid-js";
1+
import { createSignal, createEffect, onCleanup, Show, createMemo } from "solid-js";
22
import { Icon } from "../ui/Icon";
33
import { fsReadFileBinary } from "../../utils/tauri-api";
44

cortex-gui/src/components/viewers/SVGPreview.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ export function SVGPreview(props: SVGPreviewProps) {
156156
let previewContainerRef: HTMLDivElement | undefined;
157157
let editorContainerRef: HTMLDivElement | undefined;
158158
let editorInstance: Monaco.editor.IStandaloneCodeEditor | null = null;
159-
let monacoInstance: typeof Monaco | null = null;
160159

161160
const [state, setState] = createStore<SVGPreviewState>({
162161
zoom: 100,
@@ -169,7 +168,7 @@ export function SVGPreview(props: SVGPreviewProps) {
169168
});
170169

171170
const [localContent, setLocalContent] = createSignal(props.content);
172-
const [isEditorReady, setIsEditorReady] = createSignal(false);
171+
const [_isEditorReady, setIsEditorReady] = createSignal(false);
173172
const [splitRatio, setSplitRatio] = createSignal(0.5);
174173
const [isDraggingSplit, setIsDraggingSplit] = createSignal(false);
175174

@@ -202,7 +201,6 @@ export function SVGPreview(props: SVGPreviewProps) {
202201
if (state.viewMode === "preview") return;
203202

204203
const monaco = await MonacoManager.getInstance().ensureLoaded();
205-
monacoInstance = monaco;
206204

207205
if (!editorContainerRef) return;
208206

@@ -245,9 +243,10 @@ export function SVGPreview(props: SVGPreviewProps) {
245243
},
246244
});
247245

248-
editorInstance.onDidChangeModelContent(() => {
249-
if (!editorInstance) return;
250-
const newContent = editorInstance.getValue();
246+
// Register content change handler (editorInstance is guaranteed to be non-null here)
247+
const editor = editorInstance;
248+
editor.onDidChangeModelContent(() => {
249+
const newContent = editor.getValue();
251250
setLocalContent(newContent);
252251
props.onContentChange?.(newContent);
253252
});

0 commit comments

Comments
 (0)