Skip to content

Commit 3e0c5b1

Browse files
Fix build errors
1 parent e61ae50 commit 3e0c5b1

File tree

13 files changed

+21
-125
lines changed

13 files changed

+21
-125
lines changed

packages/web/src/app/[domain]/browse/layout.tsx

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import { FileTreePanel } from "@/features/fileTree/components/fileTreePanel";
88
import { TopBar } from "@/app/[domain]/components/topBar";
99
import { useBrowseParams } from "./hooks/useBrowseParams";
1010
import { FileSearchCommandDialog } from "./components/fileSearchCommandDialog";
11-
import { useBrowseState } from "./hooks/useBrowseState";
1211
import { useDomain } from "@/hooks/useDomain";
13-
import { useBrowseNavigation } from "./hooks/useBrowseNavigation";
1412
import { SearchBar } from "../components/searchBar";
1513

1614
interface LayoutProps {
@@ -20,25 +18,11 @@ interface LayoutProps {
2018
export default function Layout({
2119
children,
2220
}: LayoutProps) {
23-
return (
24-
<BrowseStateProvider>
25-
<InnerLayout>
26-
{children}
27-
</InnerLayout>
28-
</BrowseStateProvider>
29-
);
30-
}
31-
32-
const InnerLayout = ({
33-
children
34-
}: LayoutProps) => {
3521
const { repoName, revisionName } = useBrowseParams();
36-
const { state: { isFileSearchOpen }, updateBrowseState } = useBrowseState();
37-
const { navigateToPath } = useBrowseNavigation();
3822
const domain = useDomain();
3923

4024
return (
41-
<>
25+
<BrowseStateProvider>
4226
<div className="flex flex-col h-screen">
4327
<TopBar
4428
domain={domain}
@@ -79,24 +63,7 @@ const InnerLayout = ({
7963
</ResizablePanel>
8064
</ResizablePanelGroup>
8165
</div>
82-
<FileSearchCommandDialog
83-
repoName={repoName}
84-
revisionName={revisionName}
85-
isOpen={isFileSearchOpen}
86-
onOpenChange={(isOpen) => {
87-
updateBrowseState({
88-
isFileSearchOpen: isOpen,
89-
});
90-
}}
91-
onSelect={(file) => {
92-
navigateToPath({
93-
repoName,
94-
revisionName,
95-
path: file.path,
96-
pathType: 'blob',
97-
});
98-
}}
99-
/>
100-
</>
101-
)
66+
<FileSearchCommandDialog />
67+
</BrowseStateProvider>
68+
);
10269
}

packages/web/src/app/[domain]/chat/components/chatSidePanel.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigge
77
import { ResizablePanel } from "@/components/ui/resizable";
88
import { ScrollArea } from "@/components/ui/scroll-area";
99
import { Separator } from "@/components/ui/separator";
10-
import { Skeleton } from "@/components/ui/skeleton";
1110
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
1211
import { deleteChat, updateChatName } from "@/features/chat/actions";
1312
import { useDomain } from "@/hooks/useDomain";
@@ -263,24 +262,3 @@ export const ChatSidePanel = ({
263262
</>
264263
)
265264
}
266-
267-
const ChatHistorySkeleton = () => {
268-
return (
269-
<div className="flex flex-col gap-1">
270-
{Array.from({ length: 20 }).map((_, index) => (
271-
<Skeleton
272-
key={index}
273-
className={cn(
274-
"h-7 rounded-md",
275-
index % 6 === 0 ? "w-[70%]" :
276-
index % 6 === 1 ? "w-[85%]" :
277-
index % 6 === 2 ? "w-full" :
278-
index % 6 === 3 ? "w-[85%]" :
279-
index % 6 === 4 ? "w-[70%]" :
280-
"w-[85%]"
281-
)}
282-
/>
283-
))}
284-
</div>
285-
)
286-
}

packages/web/src/app/[domain]/chat/components/renameChatDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const RenameChatDialog = ({ isOpen, onOpenChange, onRename, currentName }
3232
form.reset({
3333
name: currentName,
3434
});
35-
}, [currentName]);
35+
}, [currentName, form]);
3636

3737
const onSubmit = (data: z.infer<typeof formSchema>) => {
3838
onRename(data.name);

packages/web/src/features/chat/components/chatBox/chatBoxToolbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip
77
import { LanguageModelInfo } from "@/features/chat/types";
88
import { RepositoryQuery } from "@/lib/types";
99
import { AtSignIcon } from "lucide-react";
10-
import { useCallback, useEffect } from "react";
10+
import { useCallback } from "react";
1111
import { useHotkeys } from "react-hotkeys-hook";
1212
import { ReactEditor, useSlate } from "slate-react";
1313
import { useSelectedLanguageModel } from "../../useSelectedLanguageModel";

packages/web/src/features/chat/components/chatBox/suggestionsBox.tsx

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
'use client';
22

3-
import { createPortal } from "react-dom";
4-
import { FileSuggestion, RefineSuggestion, RepoSuggestion, Suggestion } from "./types";
5-
import { forwardRef, useMemo } from "react";
6-
import { Skeleton } from "@/components/ui/skeleton";
7-
import { cn, getCodeHostInfoForRepo } from "@/lib/utils";
83
import { VscodeFileIcon } from "@/app/components/vscodeFileIcon";
9-
import Image from "next/image";
10-
import { BookIcon } from "lucide-react";
11-
import { VscFiles, VscRepo } from "react-icons/vsc";
4+
import { Skeleton } from "@/components/ui/skeleton";
5+
import { cn } from "@/lib/utils";
6+
import { forwardRef, useMemo } from "react";
7+
import { createPortal } from "react-dom";
8+
import { VscFiles } from "react-icons/vsc";
9+
import { FileSuggestion, RefineSuggestion, Suggestion } from "./types";
1210

1311
interface SuggestionBoxProps {
1412
selectedIndex: number;
@@ -68,11 +66,6 @@ export const SuggestionBox = forwardRef<HTMLDivElement, SuggestionBoxProps>(({
6866
<RefineSuggestionListItem refine={suggestion} />
6967
)
7068
}
71-
{
72-
suggestion.type === 'repo' && (
73-
<RepoSuggestionListItem repo={suggestion} />
74-
)
75-
}
7669
</div>
7770
))}
7871
</div>
@@ -105,8 +98,6 @@ const RefineSuggestionListItem = ({ refine }: { refine: RefineSuggestion }) => {
10598

10699
const Icon = useMemo(() => {
107100
switch (refine.targetSuggestionMode) {
108-
case 'repo':
109-
return VscRepo;
110101
case 'file':
111102
return VscFiles;
112103
}
@@ -126,32 +117,3 @@ const RefineSuggestionListItem = ({ refine }: { refine: RefineSuggestion }) => {
126117
</>
127118
)
128119
}
129-
130-
const RepoSuggestionListItem = ({ repo }: { repo: RepoSuggestion }) => {
131-
const info = getCodeHostInfoForRepo({
132-
codeHostType: repo.codeHostType,
133-
name: repo.name,
134-
});
135-
136-
return (
137-
<>
138-
{info?.icon ? (
139-
<Image
140-
src={info.icon}
141-
alt={info.codeHostName}
142-
className={`w-4 h-4 ${info.iconClassName} flex-shrink-0 mt-1`}
143-
/>
144-
) : (
145-
<BookIcon className="w-4 h-4 flex-shrink-0 mt-1" />
146-
)}
147-
<div className="flex flex-col w-full">
148-
<span className="text-sm font-medium">
149-
{repo.name.split('/').pop()}
150-
</span>
151-
<span className="text-xs text-muted-foreground">
152-
{repo.name}
153-
</span>
154-
</div>
155-
</>
156-
)
157-
}

packages/web/src/features/chat/components/chatBox/useSuggestionModeAndQuery.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,6 @@ export const useSuggestionModeAndQuery = () => {
6262
};
6363
}
6464

65-
// Repo mode.
66-
match = text.match(/^@repo:(.*)$/);
67-
if (match) {
68-
return {
69-
suggestionMode: "repo",
70-
suggestionQuery: match[1],
71-
range,
72-
};
73-
}
74-
7565
// If the user starts typing, fallback to file mode.
7666
// In the future, it would be nice to have a "all" mode that
7767
// searches across all mode types.

packages/web/src/features/chat/components/chatThread/answerCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ export const AnswerCard = forwardRef<HTMLDivElement, AnswerCardProps>(({
134134
<MarkdownRenderer
135135
ref={markdownRendererRef}
136136
content={answerText}
137-
isStreaming={false}
138137
// scroll-mt offsets the scroll position for headings to take account
139138
// of the sticky "answer" header.
140139
className="prose prose-sm max-w-none prose-headings:scroll-mt-14"

packages/web/src/features/chat/components/chatThread/chatThreadListItem.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ export const ChatThreadListItem = forwardRef<HTMLDivElement, ChatThreadListItemP
250250
)}
251251
<MarkdownRenderer
252252
content={`**${userQuestion.trim()}**`}
253-
isStreaming={false}
254253
className="prose-p:m-0"
255254
/>
256255
</div>
@@ -359,7 +358,6 @@ export const ChatThreadListItem = forwardRef<HTMLDivElement, ChatThreadListItemP
359358
<MarkdownRenderer
360359
key={index}
361360
content={part.text}
362-
isStreaming={isStreaming}
363361
className="text-sm"
364362
/>
365363
)

packages/web/src/features/chat/components/chatThread/codeFoldingExpandButton.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ export const CodeFoldingExpandButton = ({
3838
} else {
3939
onExpand(direction);
4040
}
41-
}, []);
41+
}, [onExpand]);
4242

4343
return (
4444
<>
45-
{expandDirections.map((direction) => (
45+
{expandDirections.map((direction, index) => (
4646
<div
47+
key={index}
4748
className="py-[3px] px-1.5 bg-chat-reference hover:bg-chat-reference-hover cursor-pointer" onClick={() => onClick(direction)}
4849
>
4950
{direction === 'up' && <PiArrowLineUp className="w-4 h-4" />}

packages/web/src/features/chat/components/chatThread/codeFoldingExtension.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
import { expect, test, describe } from 'vitest'
23
import {
34
calculateVisibleRanges,

0 commit comments

Comments
 (0)