Skip to content

Commit c0a67cc

Browse files
committed
fix: task + stop btn
1 parent 562f998 commit c0a67cc

4 files changed

Lines changed: 22 additions & 19 deletions

File tree

src/activate/registerPearListener.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import * as vscode from "vscode"
22
import { ClineProvider } from "../core/webview/ClineProvider"
33
import { assert } from "../utils/util"
4-
import { CreatorModeConfig } from "../schemas"
5-
64

75
export const getPearaiExtension = async () => {
86
const pearAiExtension = vscode.extensions.getExtension("pearai.pearai")

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,11 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
12391239
overflow: "hidden",
12401240
}}>
12411241
{apiConfiguration?.creatorModeConfig?.creatorMode === true && (
1242-
<PlanningBar requestedPlan="YEET" isGenerating={isStreaming} />
1242+
<PlanningBar
1243+
requestedPlan={task?.text || ""}
1244+
isGenerating={isStreaming}
1245+
stopCallback={() => vscode.postMessage({ type: "cancelTask" })}
1246+
/>
12431247
)}
12441248
{task ? (
12451249
<>

webview-ui/src/components/chat/PlanningBar.tsx

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import { CodeBracketIcon } from "@heroicons/react/24/outline"
22
import { Button } from "./button"
3-
import { DocumentTextIcon as SolidDocumentTextIcon } from "@heroicons/react/24/solid"
3+
import { DocumentTextIcon as SolidDocumentTextIcon, StopCircleIcon, StopIcon } from "@heroicons/react/24/solid"
44
import { FC } from "react"
55
import { cn } from "@/lib/utils"
66

77
export type PlanningBarProps = {
88
isGenerating?: boolean;
99
requestedPlan: string;
10-
nextCallback?: () => void;
10+
stopCallback?: () => void;
1111
className?: string;
1212
};
1313

1414
export const PlanningBar: FC<PlanningBarProps> = ({
1515
isGenerating,
1616
requestedPlan,
17-
nextCallback,
17+
stopCallback,
1818
className,
1919
}) => {
2020
return (
2121
<div
2222
className={cn(
23-
"bg-[#161718] w-full rounded-full flex text-white justify-between min-w-64 h-10 gap-4 relative overflow-clip",
23+
"bg-[#000] w-full rounded-full flex text-white justify-between min-w-64 h-10 gap-4 relative overflow-clip",
2424
className,
2525
)}
2626
>
@@ -38,26 +38,27 @@ export const PlanningBar: FC<PlanningBarProps> = ({
3838
</div>
3939

4040
<div className="flex justify-center align-middle mr-2 gap-4">
41-
<div className="my-auto">
41+
<div className="m-auto flex gap-2">
42+
<div className="flex my-auto">
4243
<Button
4344
variant="default"
4445
toggled
45-
className="bg-black hover:bg-black rounded-r-none"
46+
className="bg-black hover:bg-black rounded-r-none cursor-default"
4647
>
4748
<SolidDocumentTextIcon />
4849
</Button>
49-
<Button className="rounded-r-none bg-blue-700/60 hover:bg-blue-700/60 ">
50+
<Button className="rounded-l-none bg-blue-700/60 hover:bg-blue-700/60 cursor-default">
5051
<CodeBracketIcon />
5152
</Button>
53+
</div>
54+
55+
<Button variant="default" className="my-auto">
56+
Not Working?
57+
</Button>
58+
<Button className="my-auto bg-red-500/20 hover:bg-red-500/40" disabled={!isGenerating} onClick={stopCallback}>
59+
<StopIcon className="fill-red-500" />
60+
</Button>
5261
</div>
53-
<Button
54-
size="default"
55-
variant="secondary"
56-
className="my-auto rounded-lg text-[0.9em] cursor-pointer"
57-
onClick={nextCallback}
58-
>
59-
Next
60-
</Button>
6162
{/* <ArrowTurnDownLeftIcon className="size-4" /> */}
6263
</div>
6364
</div>

webview-ui/src/components/chat/button/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { cn } from "@/lib/utils"
66
// FROM: https://vscode.dev/github/trypear/pearai-submodule/blob/acorn/253-submodule-api-fixed/gui/src/pages/creator/ui/button/index.tsx#L1-L121
77
// TODO: UI LIBRARY COMPONENT SHARING SHIZZ HERE!
88
const buttonVariants = cva(
9-
"inline-flex items-center justify-center gap-2 border-none whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#a1a1aa] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
9+
"inline-flex items-center justify-center gap-2 border-none whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#a1a1aa] disabled:pointer-events-none cursor-pointer disabled:cursor-default disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
1010
{
1111
variants: {
1212
variant: {

0 commit comments

Comments
 (0)