Skip to content

Commit 0eda3a1

Browse files
committed
refactor: Remove unused imports and variables
- Remove unused Button and DEFAULT_PROMPT_TEMPLATE imports from LLM settings - Remove unused imports from various component files - Fix React Hook dependency arrays in settings components - Clean up unused variables in tabs and test files 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent c7d13cc commit 0eda3a1

10 files changed

+8
-17
lines changed

src/components/settings/llm-settings.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import { Input } from "@/components/ui/input";
55
import { Textarea } from "@/components/ui/textarea";
66
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
77
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
8-
import { Button } from "@/components/ui/button";
98
import { Eye, EyeOff } from "lucide-react";
109
import { AppConfig, DEFAULT_MODELS } from "@/lib/types/config";
1110
import { useAppTranslation } from "@/lib/i18n";
12-
import { DEFAULT_PROMPT_TEMPLATE, DEFAULT_SYSTEM_PROMPT, DEFAULT_USER_PROMPT } from "@/lib/types/llm";
11+
import { DEFAULT_SYSTEM_PROMPT, DEFAULT_USER_PROMPT } from "@/lib/types/llm";
1312

1413
interface LLMSettingsProps {
1514
config: AppConfig;
@@ -43,7 +42,7 @@ export function LLMSettings({ config, setConfig }: LLMSettingsProps) {
4342
setConfig(newConfig);
4443
}
4544
}
46-
}, []);
45+
}, [config, setConfig]);
4746

4847
return (
4948
<Card className="mb-6">

src/components/settings/target-language-dialog.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useState } from "react";
44
import { Button } from "@/components/ui/button";
55
import { Input } from "@/components/ui/input";
66
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "@/components/ui/dialog";
7-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
87
import { SupportedLanguage, DEFAULT_LANGUAGES } from "@/lib/types/llm";
98
import { useAppTranslation } from "@/lib/i18n";
109
import { X } from "lucide-react";

src/components/settings/translation-settings.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Input } from "@/components/ui/input";
66
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
77
import { AppConfig } from "@/lib/types/config";
88
import { useAppTranslation } from "@/lib/i18n";
9-
import { SupportedLanguage, DEFAULT_LANGUAGES } from "@/lib/types/llm";
9+
import { SupportedLanguage } from "@/lib/types/llm";
1010
import { TargetLanguageDialog } from "./target-language-dialog";
1111

1212
interface TranslationSettingsProps {
@@ -37,8 +37,6 @@ export function TranslationSettings({ config, setConfig }: TranslationSettingsPr
3737
}
3838
};
3939

40-
// Get all available languages (default + additional)
41-
const allLanguages = [...DEFAULT_LANGUAGES, ...(config.translation.additionalLanguages || [])];
4240

4341
return (
4442
<Card className="mb-6">

src/components/tabs/mods-tab.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export function ModsTab() {
2222
setWholeProgress,
2323
setTotalChunks,
2424
setCompletedChunks,
25-
incrementCompletedChunks,
2625
// Mod-level progress tracking
2726
setTotalMods,
2827
setCompletedMods,

src/components/tabs/quests-tab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export function QuestsTab() {
128128
target.name
129129
);
130130
totalChunksCount += tempJob.chunks.length;
131-
} catch (error) {
131+
} catch {
132132
// If we can't analyze the file, assume 1 chunk
133133
totalChunksCount += 1;
134134
}

src/components/tabs/target-language-selector.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ export const TargetLanguageSelector: React.FC<TargetLanguageSelectorProps> = ({
4141
}
4242
};
4343

44-
// Translate the label key here
45-
const translatedLabel = t(labelKey);
4644

4745
// Generate a stable ID from the key
4846
const selectId = `lang-select-${labelKey.replace(/\./g, '-')}`;

src/lib/services/__tests__/translation-runner.bun.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { test, describe, beforeEach, expect, mock } from 'bun:test';
22
import { runTranslationJobs, RunTranslationJobsOptions } from '../translation-runner';
3-
import { TranslationService } from '../translation-service';
43
import { TranslationResult } from '../../types/minecraft';
54
import {
65
mockModData,

src/lib/services/__tests__/translation-runner.jest.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { runTranslationJobs, RunTranslationJobsOptions } from '../translation-runner';
2-
import { TranslationService } from '../translation-service';
32
import { TranslationResult } from '../../types/minecraft';
43
import {
54
mockModData,

src/lib/services/__tests__/translation-service.bun.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ describe('TranslationService', () => {
134134
describe('Job Management', () => {
135135
test('should clear jobs correctly', () => {
136136
const job1 = translationService.createJob(mockModData.simpleMod.content, 'ja_jp');
137-
const job2 = translationService.createJob({'key': 'value'}, 'zh_cn');
137+
translationService.createJob({'key': 'value'}, 'zh_cn');
138138

139139
expect(translationService.getAllJobs()).toHaveLength(2);
140140

@@ -186,7 +186,7 @@ describe('TranslationService', () => {
186186
apiKey: 'test-key'
187187
};
188188

189-
const service = new TranslationService({ llmConfig: config });
189+
new TranslationService({ llmConfig: config });
190190

191191
// Should use adapter's max chunk size (50) as default
192192
expect(mockAdapter.getMaxChunkSize).toHaveBeenCalled();

src/lib/services/__tests__/translation-service.jest.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ describe('TranslationService', () => {
130130
describe('Job Management', () => {
131131
it('should clear jobs correctly', () => {
132132
const job1 = translationService.createJob(mockModData.simpleMod.content, 'ja_jp');
133-
const job2 = translationService.createJob({'key': 'value'}, 'zh_cn');
133+
translationService.createJob({'key': 'value'}, 'zh_cn');
134134

135135
expect(translationService.getAllJobs()).toHaveLength(2);
136136

@@ -182,7 +182,7 @@ describe('TranslationService', () => {
182182
apiKey: 'test-key'
183183
};
184184

185-
const service = new TranslationService({ llmConfig: config });
185+
new TranslationService({ llmConfig: config });
186186

187187
// Should use adapter's max chunk size (50) as default
188188
expect(mockAdapter.getMaxChunkSize).toHaveBeenCalled();

0 commit comments

Comments
 (0)