Skip to content

Commit

Permalink
feat: move workflow param form to invoke button on inital trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhopperlowe committed Nov 22, 2024
1 parent 0711a79 commit c072793
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ui/admin/app/components/chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export function Chat({ className }: ChatProps) {
className={cn({
"w-full": threadId,
})}
popoverContentProps={{
sideOffset: !threadId ? -150 : undefined,
}}
loading={isInvoking || isRunning}
disabled={isInvoking || isRunning}
>
Expand Down
9 changes: 7 additions & 2 deletions ui/admin/app/components/chat/RunWorkflow.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from "react";
import { ComponentProps, useState } from "react";
import useSWR from "swr";

import { WorkflowService } from "~/lib/service/api/workflowService";
Expand All @@ -14,6 +14,7 @@ import {
type RunWorkflowProps = {
onSubmit: (params?: Record<string, string>) => void;
workflowId: string;
popoverContentProps?: ComponentProps<typeof PopoverContent>;
};

export function RunWorkflow({
Expand Down Expand Up @@ -49,12 +50,16 @@ export function RunWorkflow({
{...props}
disabled={props.disabled || open || isLoading}
loading={props.loading || isLoading}
onClick={() => setOpen((prev) => !prev)}
>
Run Workflow
</Button>
</PopoverTrigger>

<PopoverContent className="min-w-full" side="bottom" align="center">
<PopoverContent
{...props.popoverContentProps}
className="min-w-full"
>
<RunWorkflowForm
params={params}
onSubmit={(params) => {
Expand Down

0 comments on commit c072793

Please sign in to comment.