mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2026-07-09 16:09:13 +00:00
SKY-11457 Clarify Copilot queued send action (#6987)
This commit is contained in:
parent
744e0b3d66
commit
0ca97ff587
2 changed files with 47 additions and 6 deletions
|
|
@ -235,6 +235,45 @@ describe("WorkflowCopilotChat — keep the chat live during a turn", () => {
|
|||
expect(screen.getByRole("button", { name: "Cancel run" })).toBeTruthy();
|
||||
});
|
||||
|
||||
it("labels the in-flight follow-up action as the next send", async () => {
|
||||
await renderChat();
|
||||
await submit("build me a workflow");
|
||||
await waitFor(() => expect(postStreaming).toHaveBeenCalledTimes(1));
|
||||
|
||||
expect(
|
||||
screen.getByText(
|
||||
"Copilot is working. Your next send will wait for the next turn.",
|
||||
),
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
screen.getByPlaceholderText("Type a message to send next…"),
|
||||
).toBeTruthy();
|
||||
expect(screen.getByRole("button", { name: "Send next" })).toBeTruthy();
|
||||
expect(screen.queryByRole("button", { name: "Queue" })).toBeNull();
|
||||
});
|
||||
|
||||
it("explains that the next send waits while the live browser is starting", async () => {
|
||||
render(
|
||||
<WorkflowCopilotChat requiresLiveBrowser isLiveBrowserReady={false} />,
|
||||
);
|
||||
await waitFor(() =>
|
||||
expect(
|
||||
screen.getByPlaceholderText("Type a prompt to send when ready..."),
|
||||
).toBeTruthy(),
|
||||
);
|
||||
|
||||
expect(
|
||||
screen.getByText(
|
||||
"Live browser is starting. Your next send will wait until it connects.",
|
||||
),
|
||||
).toBeTruthy();
|
||||
expect(screen.getByRole("button", { name: "Send" })).toBeTruthy();
|
||||
// The old copy conflated sending with queuing; guard against its return.
|
||||
expect(screen.queryByRole("button", { name: "Queue" })).toBeNull();
|
||||
expect(screen.queryByText(/Send now to queue your prompt/)).toBeNull();
|
||||
expect(screen.queryByPlaceholderText(/Type a prompt to queue/)).toBeNull();
|
||||
});
|
||||
|
||||
it("still sends the message when dictation audio upload fails", async () => {
|
||||
await renderChat();
|
||||
speechState.takeAudioBlob.mockReturnValueOnce(
|
||||
|
|
|
|||
|
|
@ -2022,9 +2022,9 @@ export function WorkflowCopilotChat({
|
|||
const browserStatusText = queuedPrompt
|
||||
? queuedPromptWaitingStatus
|
||||
: isLoading
|
||||
? "Copilot is working — message will queue…"
|
||||
? "Copilot is working. Your next send will wait for the next turn."
|
||||
: isWaitingForLiveBrowser
|
||||
? "Live browser is starting. Send now to queue your prompt."
|
||||
? "Live browser is starting. Your next send will wait until it connects."
|
||||
: null;
|
||||
const inputStatusText = isSpeechListening
|
||||
? browserStatusText
|
||||
|
|
@ -2313,9 +2313,9 @@ export function WorkflowCopilotChat({
|
|||
queuedPrompt
|
||||
? "Prompt queued..."
|
||||
: isLoading
|
||||
? "Type a message to queue for the next turn…"
|
||||
? "Type a message to send next…"
|
||||
: isWaitingForLiveBrowser
|
||||
? "Type a prompt to queue..."
|
||||
? "Type a prompt to send when ready..."
|
||||
: "Message Skyvern Copilot…"
|
||||
}
|
||||
value={inputValue}
|
||||
|
|
@ -2350,13 +2350,15 @@ export function WorkflowCopilotChat({
|
|||
) : isLoading ? (
|
||||
<>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => handleSend()}
|
||||
title="Queue for the next turn"
|
||||
title="Send after this turn finishes"
|
||||
className="flex h-10 items-center justify-center rounded-lg border border-border px-3 text-sm font-medium text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
||||
>
|
||||
Queue
|
||||
Send next
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={cancelSend}
|
||||
title="Cancel run"
|
||||
className="flex h-10 items-center justify-center rounded-lg bg-destructive px-3 text-sm font-medium text-destructive-foreground hover:bg-destructive/90"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue