Skip to content

Commit d1ff058

Browse files
doublegateclaude
andcommitted
fix(clients): resolve WRAITH-Vault TypeScript errors causing white screen
The WRAITH-Vault application was showing a white/blank screen because the frontend build was failing due to TypeScript errors. This commit fixes all TypeScript issues: - Remove unused React imports (use Fragment from 'react' instead) - Fix createSecret function signature to match secretStore - Remove non-existent rotateSecret call from SecretDetail - Fix unused variable warnings (clearError, startTime, sessionId) - Update React.Fragment to Fragment in JSX Root Cause: TypeScript errors prevented successful build, resulting in no JavaScript bundle being generated. All 8 client frontends now build successfully. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9a2c4a5 commit d1ff058

File tree

8 files changed

+27
-28
lines changed

8 files changed

+27
-28
lines changed

clients/wraith-vault/frontend/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// WRAITH Vault - Main Application Component
22
// Distributed Secret Storage with Shamir's Secret Sharing
33

4-
import React, { useState, useEffect } from "react";
4+
import { useState, useEffect } from "react";
55
import { SecretList } from "./components/SecretList";
66
import { GuardianList } from "./components/GuardianList";
77
import { RecoveryWizard } from "./components/RecoveryWizard";

clients/wraith-vault/frontend/src/components/AddGuardianModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// AddGuardianModal Component for WRAITH Vault
22
// Modal for adding new guardians to the vault
33

4-
import React, { useState } from "react";
4+
import { useState } from "react";
55
import { useGuardianStore } from "../stores/guardianStore";
66

77
interface AddGuardianModalProps {
@@ -10,7 +10,7 @@ interface AddGuardianModalProps {
1010
}
1111

1212
export function AddGuardianModal({ onClose, onAdded }: AddGuardianModalProps) {
13-
const { addGuardian, loading, error, clearError } = useGuardianStore();
13+
const { addGuardian, loading, error } = useGuardianStore();
1414

1515
const [name, setName] = useState("");
1616
const [peerId, setPeerId] = useState("");

clients/wraith-vault/frontend/src/components/CreateSecretModal.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// CreateSecretModal Component for WRAITH Vault
22
// Modal for creating new secrets with Shamir configuration
33

4-
import React, { useState, useEffect } from "react";
4+
import { useState, useEffect, Fragment } from "react";
55
import { useSecretStore } from "../stores/secretStore";
66
import { useGuardianStore } from "../stores/guardianStore";
7-
import type { SecretType, Guardian } from "../types";
7+
import type { SecretType } from "../types";
88

99
interface CreateSecretModalProps {
1010
onClose: () => void;
@@ -24,7 +24,7 @@ const SECRET_TYPES: { value: SecretType; label: string; description: string }[]
2424
];
2525

2626
export function CreateSecretModal({ onClose, onCreated }: CreateSecretModalProps) {
27-
const { createSecret, loading, error, clearError } = useSecretStore();
27+
const { createSecret, loading, error } = useSecretStore();
2828
const { guardians, availableGuardians, loadGuardians, loadAvailableGuardians } = useGuardianStore();
2929

3030
const [step, setStep] = useState<"details" | "config" | "guardians" | "confirm">("details");
@@ -145,13 +145,13 @@ export function CreateSecretModal({ onClose, onCreated }: CreateSecretModalProps
145145

146146
await createSecret(
147147
name,
148-
description || null,
149-
Array.from(secretBytes),
148+
secretBytes,
150149
secretType,
150+
description || null,
151151
threshold,
152152
totalShares,
153-
selectedGuardianIds,
154-
tagList
153+
tagList,
154+
null // password
155155
);
156156

157157
onCreated();
@@ -186,7 +186,7 @@ export function CreateSecretModal({ onClose, onCreated }: CreateSecretModalProps
186186
const isPast = steps.indexOf(step) > index;
187187

188188
return (
189-
<React.Fragment key={label}>
189+
<Fragment key={label}>
190190
<div
191191
className={`flex items-center gap-2 ${
192192
isActive
@@ -216,7 +216,7 @@ export function CreateSecretModal({ onClose, onCreated }: CreateSecretModalProps
216216
}`}
217217
/>
218218
)}
219-
</React.Fragment>
219+
</Fragment>
220220
);
221221
}
222222
)}

clients/wraith-vault/frontend/src/components/GuardianList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// GuardianList Component for WRAITH Vault
22

3-
import React, { useEffect, useState } from "react";
3+
import type { MouseEvent } from "react";
4+
import { useEffect, useState } from "react";
45
import { useGuardianStore } from "../stores/guardianStore";
56
import type { Guardian, GuardianStatus, TrustLevel } from "../types";
67

@@ -69,14 +70,13 @@ export function GuardianList({
6970
};
7071

7172
const handleHealthCheck = async (
72-
e: React.MouseEvent,
73+
e: MouseEvent,
7374
guardian: Guardian
7475
) => {
7576
e.stopPropagation();
7677
setCheckingHealth(guardian.id);
7778

7879
// Simulate health check (in real implementation, this would ping the guardian)
79-
const startTime = Date.now();
8080
const success = Math.random() > 0.3; // 70% success rate for demo
8181
const responseTime = success ? Math.floor(Math.random() * 200) + 50 : null;
8282
const errorMsg = success ? null : "Connection timeout";

clients/wraith-vault/frontend/src/components/RecoveryWizard.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// RecoveryWizard Component for WRAITH Vault
22
// Multi-step wizard for recovering secrets from guardian shards
33

4-
import React, { useState, useEffect } from "react";
4+
import { useState, useEffect, Fragment } from "react";
55
import { useRecoveryStore } from "../stores/recoveryStore";
66
import { useGuardianStore } from "../stores/guardianStore";
77
import { useSecretStore } from "../stores/secretStore";
8-
import type { SecretInfo, Guardian, EncryptedShard, RecoveryProgress } from "../types";
8+
import type { SecretInfo, Guardian, EncryptedShard } from "../types";
99
import * as tauri from "../lib/tauri";
1010

1111
type WizardStep = "select-secret" | "select-guardians" | "collect-shards" | "recovering" | "complete" | "error";
@@ -32,7 +32,6 @@ export function RecoveryWizard({
3232
startRecovery,
3333
addShard,
3434
completeRecovery,
35-
getProgress,
3635
cancelRecovery,
3736
clearResult,
3837
clearError,
@@ -96,7 +95,7 @@ export function RecoveryWizard({
9695
if (!selectedSecret) return;
9796

9897
try {
99-
const sessionId = await startRecovery(selectedSecret.id);
98+
await startRecovery(selectedSecret.id);
10099
setCurrentGuardianIndex(0);
101100
setStep("collect-shards");
102101
} catch (err) {
@@ -249,7 +248,7 @@ export function RecoveryWizard({
249248
step === "complete";
250249

251250
return (
252-
<React.Fragment key={label}>
251+
<Fragment key={label}>
253252
<div
254253
className={`flex items-center gap-2 ${
255254
isActive
@@ -279,7 +278,7 @@ export function RecoveryWizard({
279278
}`}
280279
/>
281280
)}
282-
</React.Fragment>
281+
</Fragment>
283282
);
284283
}
285284
)}

clients/wraith-vault/frontend/src/components/SecretDetail.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SecretDetail Component for WRAITH Vault
22
// Displays detailed information about a selected secret
33

4-
import React, { useState } from "react";
4+
import { useState } from "react";
55
import { useSecretStore } from "../stores/secretStore";
66
import type { SecretInfo, SecretType } from "../types";
77

@@ -36,7 +36,7 @@ interface SecretDetailProps {
3636
}
3737

3838
export function SecretDetail({ secret, onRecover, onClose }: SecretDetailProps) {
39-
const { rotateSecret, deleteSecret, loading, error } = useSecretStore();
39+
const { deleteSecret, loading, error } = useSecretStore();
4040
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
4141
const [showRotateConfirm, setShowRotateConfirm] = useState(false);
4242

@@ -48,9 +48,9 @@ export function SecretDetail({ secret, onRecover, onClose }: SecretDetailProps)
4848

4949
const handleRotate = async () => {
5050
try {
51-
// In a real implementation, you would prompt for the new secret data
52-
// For now, we'll just show a placeholder
53-
await rotateSecret(secret.id, []);
51+
// In a real implementation, this would trigger key rotation via Tauri
52+
// For now, just close the confirmation dialog
53+
// TODO: Implement key rotation when backend support is added
5454
setShowRotateConfirm(false);
5555
} catch (err) {
5656
console.error("Failed to rotate secret:", err);

clients/wraith-vault/frontend/src/components/SecretList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SecretList Component for WRAITH Vault
22

3-
import React, { useEffect, useState } from "react";
3+
import { useEffect, useState } from "react";
44
import { useSecretStore } from "../stores/secretStore";
55
import type { SecretInfo, SecretType } from "../types";
66

clients/wraith-vault/frontend/src/components/ShardStatus.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ShardStatus Component for WRAITH Vault
22
// Displays the distribution status of shards across guardians
33

4-
import React, { useEffect, useState } from "react";
4+
import { useEffect, useState } from "react";
55
import type { SecretInfo, Guardian, ShardAssignment, DistributionStatus } from "../types";
66
import * as tauri from "../lib/tauri";
77

0 commit comments

Comments
 (0)