fix: resolve TypeScript and Rust build errors and warnings
- Fixed TypeScript errors in ClaudeCodeSession.tsx: - Removed unused imports (Square, PreviewPromptDialog, etc.) - Removed unused handleOpenPreview function - Fixed unused detectedUrl state variable - Fixed TypeScript error in StreamMessage.tsx: - Removed unused useMemo import - Fixed TypeScript errors in ToolWidgets.tsx: - Prefixed unused result props with underscore in multiple widgets - Fixed Rust warnings: - Removed unused imports in commands modules - Prefixed unused variables with underscore - Added #[allow(dead_code)] for API methods intended for future use Closes #31 Closes #23 Closes #21 Closes #22
This commit is contained in:
@@ -9,8 +9,7 @@ import {
|
||||
ChevronDown,
|
||||
GitBranch,
|
||||
Settings,
|
||||
Globe,
|
||||
Square
|
||||
Globe
|
||||
} from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
@@ -30,7 +29,6 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Di
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import { SplitPane } from "@/components/ui/split-pane";
|
||||
import { WebviewPreview } from "./WebviewPreview";
|
||||
import { PreviewPromptDialog } from "./PreviewPromptDialog";
|
||||
import type { ClaudeStreamMessage } from "./AgentExecution";
|
||||
import { useVirtualizer } from "@tanstack/react-virtual";
|
||||
|
||||
@@ -88,7 +86,6 @@ export const ClaudeCodeSession: React.FC<ClaudeCodeSessionProps> = ({
|
||||
// New state for preview feature
|
||||
const [showPreview, setShowPreview] = useState(false);
|
||||
const [previewUrl, setPreviewUrl] = useState("");
|
||||
const [detectedUrl, setDetectedUrl] = useState("");
|
||||
const [showPreviewPrompt, setShowPreviewPrompt] = useState(false);
|
||||
const [splitPosition, setSplitPosition] = useState(50);
|
||||
const [isPreviewMaximized, setIsPreviewMaximized] = useState(false);
|
||||
@@ -566,17 +563,11 @@ export const ClaudeCodeSession: React.FC<ClaudeCodeSessionProps> = ({
|
||||
// Handle URL detection from terminal output
|
||||
const handleLinkDetected = (url: string) => {
|
||||
if (!showPreview && !showPreviewPrompt) {
|
||||
setDetectedUrl(url);
|
||||
setPreviewUrl(url);
|
||||
setShowPreviewPrompt(true);
|
||||
}
|
||||
};
|
||||
|
||||
const handleOpenPreview = () => {
|
||||
setPreviewUrl(detectedUrl);
|
||||
setShowPreview(true);
|
||||
setShowPreviewPrompt(false);
|
||||
};
|
||||
|
||||
const handleClosePreview = () => {
|
||||
setShowPreview(false);
|
||||
setIsPreviewMaximized(false);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect, useMemo } from "react";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import {
|
||||
Terminal,
|
||||
User,
|
||||
|
@@ -55,7 +55,7 @@ import { detectLinks, makeLinksClickable } from "@/lib/linkDetector";
|
||||
/**
|
||||
* Widget for TodoWrite tool - displays a beautiful TODO list
|
||||
*/
|
||||
export const TodoWidget: React.FC<{ todos: any[]; result?: any }> = ({ todos, result }) => {
|
||||
export const TodoWidget: React.FC<{ todos: any[]; result?: any }> = ({ todos, result: _result }) => {
|
||||
const statusIcons = {
|
||||
completed: <CheckCircle2 className="h-4 w-4 text-green-500" />,
|
||||
in_progress: <Clock className="h-4 w-4 text-blue-500 animate-pulse" />,
|
||||
@@ -677,7 +677,7 @@ export const BashWidget: React.FC<{
|
||||
/**
|
||||
* Widget for Write tool
|
||||
*/
|
||||
export const WriteWidget: React.FC<{ filePath: string; content: string; result?: any }> = ({ filePath, content, result }) => {
|
||||
export const WriteWidget: React.FC<{ filePath: string; content: string; result?: any }> = ({ filePath, content, result: _result }) => {
|
||||
const [isMaximized, setIsMaximized] = useState(false);
|
||||
|
||||
// Extract file extension for syntax highlighting
|
||||
@@ -852,7 +852,7 @@ export const GrepWidget: React.FC<{
|
||||
path?: string;
|
||||
exclude?: string;
|
||||
result?: any;
|
||||
}> = ({ pattern, include, path, exclude, result }) => {
|
||||
}> = ({ pattern, include, path, exclude, result: _result }) => {
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center gap-2 mb-2">
|
||||
@@ -944,7 +944,7 @@ export const EditWidget: React.FC<{
|
||||
old_string: string;
|
||||
new_string: string;
|
||||
result?: any;
|
||||
}> = ({ file_path, old_string, new_string, result }) => {
|
||||
}> = ({ file_path, old_string, new_string, result: _result }) => {
|
||||
|
||||
const diffResult = Diff.diffLines(old_string || '', new_string || '', {
|
||||
newlineIsToken: true,
|
||||
@@ -1104,7 +1104,7 @@ export const MCPWidget: React.FC<{
|
||||
toolName: string;
|
||||
input?: any;
|
||||
result?: any;
|
||||
}> = ({ toolName, input, result }) => {
|
||||
}> = ({ toolName, input, result: _result }) => {
|
||||
const [isExpanded, setIsExpanded] = useState(false);
|
||||
|
||||
// Parse the tool name to extract components
|
||||
@@ -1406,7 +1406,7 @@ export const MultiEditWidget: React.FC<{
|
||||
file_path: string;
|
||||
edits: Array<{ old_string: string; new_string: string }>;
|
||||
result?: any;
|
||||
}> = ({ file_path, edits, result }) => {
|
||||
}> = ({ file_path, edits, result: _result }) => {
|
||||
const [isExpanded, setIsExpanded] = useState(false);
|
||||
const language = getLanguage(file_path);
|
||||
|
||||
@@ -1817,7 +1817,7 @@ export const TaskWidget: React.FC<{
|
||||
description?: string;
|
||||
prompt?: string;
|
||||
result?: any;
|
||||
}> = ({ description, prompt, result }) => {
|
||||
}> = ({ description, prompt, result: _result }) => {
|
||||
const [isExpanded, setIsExpanded] = useState(false);
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user