Enable Workflow Copilot for all users (#4533)
This commit is contained in:
committed by
GitHub
parent
ab58527684
commit
9f57bdb703
@@ -1,6 +1,5 @@
|
|||||||
import { forwardRef } from "react";
|
import { forwardRef } from "react";
|
||||||
import { ChatBubbleIcon } from "@radix-ui/react-icons";
|
import { ChatBubbleIcon } from "@radix-ui/react-icons";
|
||||||
import { useIsSkyvernUser } from "@/hooks/useIsSkyvernUser";
|
|
||||||
|
|
||||||
interface WorkflowCopilotButtonProps {
|
interface WorkflowCopilotButtonProps {
|
||||||
messageCount: number;
|
messageCount: number;
|
||||||
@@ -11,12 +10,6 @@ export const WorkflowCopilotButton = forwardRef<
|
|||||||
HTMLButtonElement,
|
HTMLButtonElement,
|
||||||
WorkflowCopilotButtonProps
|
WorkflowCopilotButtonProps
|
||||||
>(({ messageCount, onClick }, ref) => {
|
>(({ messageCount, onClick }, ref) => {
|
||||||
const isSkyvernUser = useIsSkyvernUser();
|
|
||||||
|
|
||||||
if (!isSkyvernUser) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
ref={ref}
|
ref={ref}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { useState, useEffect, useLayoutEffect, useRef, memo } from "react";
|
import { useState, useEffect, useLayoutEffect, useRef, memo } from "react";
|
||||||
import { getClient } from "@/api/AxiosClient";
|
import { getClient } from "@/api/AxiosClient";
|
||||||
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
|
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
|
||||||
import { useIsSkyvernUser } from "@/hooks/useIsSkyvernUser";
|
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { ReloadIcon, Cross2Icon } from "@radix-ui/react-icons";
|
import { ReloadIcon, Cross2Icon } from "@radix-ui/react-icons";
|
||||||
import { stringify as convertToYAML } from "yaml";
|
import { stringify as convertToYAML } from "yaml";
|
||||||
@@ -123,7 +122,6 @@ export function WorkflowCopilotChat({
|
|||||||
onMessageCountChange,
|
onMessageCountChange,
|
||||||
buttonRef,
|
buttonRef,
|
||||||
}: WorkflowCopilotChatProps = {}) {
|
}: WorkflowCopilotChatProps = {}) {
|
||||||
const isSkyvernUser = useIsSkyvernUser();
|
|
||||||
const [messages, setMessages] = useState<ChatMessage[]>([]);
|
const [messages, setMessages] = useState<ChatMessage[]>([]);
|
||||||
const [inputValue, setInputValue] = useState("");
|
const [inputValue, setInputValue] = useState("");
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
@@ -649,8 +647,7 @@ export function WorkflowCopilotChat({
|
|||||||
}
|
}
|
||||||
}, [isOpen, buttonRef, size.width, size.height]);
|
}, [isOpen, buttonRef, size.width, size.height]);
|
||||||
|
|
||||||
// Only show to Skyvern users
|
if (!isOpen) {
|
||||||
if (!isSkyvernUser || !isOpen) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -670,7 +667,7 @@ export function WorkflowCopilotChat({
|
|||||||
onMouseDown={handleMouseDown}
|
onMouseDown={handleMouseDown}
|
||||||
>
|
>
|
||||||
<h3 className="text-sm font-semibold text-slate-200">
|
<h3 className="text-sm font-semibold text-slate-200">
|
||||||
Workflow Copilot
|
Workflow Copilot (Beta)
|
||||||
</h3>
|
</h3>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user