Skip to content

Commit 4e84f03

Browse files
iamjr15claude
andcommitted
fix: resolve TypeScript build errors for Vercel deployment
- Fixed missing index parameter in attachment-group.tsx map functions - Added Web Speech API type declarations in voice-recorder.tsx - Added proper type annotations for onError context parameters in: - use-project-mutations.ts - use-sidebar.ts - use-messages.ts - use-threads.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 83cd46e commit 4e84f03

File tree

6 files changed

+56
-10
lines changed

6 files changed

+56
-10
lines changed

frontend/src/components/thread/attachment-group.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export function AttachmentGroup({
208208
"grid-cols-1 sm:grid-cols-2",
209209
className
210210
)}>
211-
{sortedFilesWithMeta.map((item) => (
211+
{sortedFilesWithMeta.map((item, index) => (
212212
<div
213213
key={item.path}
214214
className={item.wrapperClassName}
@@ -278,7 +278,7 @@ export function AttachmentGroup({
278278
// For inline layout with pre-computed data
279279
return (
280280
<div className={cn("flex flex-wrap gap-3", className)}>
281-
{visibleFilesWithMeta.map((item) => (
281+
{visibleFilesWithMeta.map((item, index) => (
282282
<div key={item.path} className={cn("relative group h-[54px]", item.wrapperClassName)}>
283283
<FileAttachment
284284
filepath={item.path}

frontend/src/components/thread/chat-input/voice-recorder.tsx

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,56 @@ interface VoiceRecorderProps {
88
disabled?: boolean;
99
}
1010

11+
// Web Speech API type declarations
12+
interface SpeechRecognitionEvent extends Event {
13+
results: SpeechRecognitionResultList;
14+
resultIndex: number;
15+
}
16+
17+
interface SpeechRecognitionResultList {
18+
length: number;
19+
item(index: number): SpeechRecognitionResult;
20+
[index: number]: SpeechRecognitionResult;
21+
}
22+
23+
interface SpeechRecognitionResult {
24+
length: number;
25+
item(index: number): SpeechRecognitionAlternative;
26+
[index: number]: SpeechRecognitionAlternative;
27+
isFinal: boolean;
28+
}
29+
30+
interface SpeechRecognitionAlternative {
31+
transcript: string;
32+
confidence: number;
33+
}
34+
35+
interface SpeechRecognitionErrorEvent extends Event {
36+
error: string;
37+
message?: string;
38+
}
39+
40+
interface SpeechRecognition extends EventTarget {
41+
continuous: boolean;
42+
interimResults: boolean;
43+
lang: string;
44+
onresult: ((event: SpeechRecognitionEvent) => void) | null;
45+
onerror: ((event: SpeechRecognitionErrorEvent) => void) | null;
46+
onend: (() => void) | null;
47+
start(): void;
48+
stop(): void;
49+
abort(): void;
50+
}
51+
52+
interface SpeechRecognitionConstructor {
53+
new(): SpeechRecognition;
54+
}
55+
1156
// Extend Window interface for webkit prefix
1257
declare global {
1358
interface Window {
14-
webkitSpeechRecognition: typeof SpeechRecognition;
59+
SpeechRecognition: SpeechRecognitionConstructor;
60+
webkitSpeechRecognition: SpeechRecognitionConstructor;
1561
}
1662
}
1763

frontend/src/hooks/react-query/sidebar/use-project-mutations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const useUpdateProject = () => {
8787
return { previousProjects, previousProject, projectId };
8888
},
8989
// Rollback on error
90-
onError: (_error, _variables, context) => {
90+
onError: (_error, _variables, context: { previousProjects?: Project[]; previousProject?: Project; projectId?: string } | undefined) => {
9191
if (context?.previousProjects) {
9292
queryClient.setQueryData(projectKeys.lists(), context.previousProjects);
9393
}
@@ -142,7 +142,7 @@ export const useDeleteProject = () => {
142142
return { previousProjects };
143143
},
144144
// Rollback on error
145-
onError: (_error, _variables, context) => {
145+
onError: (_error, _variables, context: { previousProjects?: Project[] } | undefined) => {
146146
if (context?.previousProjects) {
147147
queryClient.setQueryData(projectKeys.lists(), context.previousProjects);
148148
}

frontend/src/hooks/react-query/sidebar/use-sidebar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const useDeleteThread = () => {
8484
return { previousThreads };
8585
},
8686
// Rollback on error
87-
onError: (_error, _variables, context) => {
87+
onError: (_error, _variables, context: { previousThreads?: Thread[] } | undefined) => {
8888
if (context?.previousThreads) {
8989
queryClient.setQueryData(threadKeys.lists(), context.previousThreads);
9090
}
@@ -150,7 +150,7 @@ export const useDeleteMultipleThreads = () => {
150150

151151
return { previousThreads };
152152
},
153-
onError: (_error, _variables, context) => {
153+
onError: (_error, _variables, context: { previousThreads?: Thread[] } | undefined) => {
154154
if (context?.previousThreads) {
155155
queryClient.setQueryData(threadKeys.lists(), context.previousThreads);
156156
}

frontend/src/hooks/react-query/threads/use-messages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const useAddUserMessageMutation = () => {
6767
return { previousMessages, threadId };
6868
},
6969
// Rollback on error
70-
onError: (_error, _variables, context) => {
70+
onError: (_error, _variables, context: { previousMessages?: Message[]; threadId?: string } | undefined) => {
7171
if (context?.previousMessages && context?.threadId) {
7272
queryClient.setQueryData(
7373
threadKeys.messages(context.threadId),

frontend/src/hooks/react-query/threads/use-threads.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export const useToggleThreadPublicStatus = () => {
9797

9898
return { previousThread, threadId };
9999
},
100-
onError: (_error, _variables, context) => {
100+
onError: (_error, _variables, context: { previousThread?: Thread; threadId?: string } | undefined) => {
101101
if (context?.previousThread && context?.threadId) {
102102
queryClient.setQueryData(threadKeys.details(context.threadId), context.previousThread);
103103
}
@@ -139,7 +139,7 @@ export const useUpdateThreadMutation = () => {
139139

140140
return { previousThread, threadId };
141141
},
142-
onError: (_error, _variables, context) => {
142+
onError: (_error, _variables, context: { previousThread?: Thread; threadId?: string } | undefined) => {
143143
if (context?.previousThread && context?.threadId) {
144144
queryClient.setQueryData(threadKeys.details(context.threadId), context.previousThread);
145145
}

0 commit comments

Comments
 (0)