Show permanent tooltip for parameters on the first block of the workflow (#1616)

This commit is contained in:
Shuchang Zheng
2025-01-22 22:25:37 +08:00
committed by GitHub
parent 6f5490ab47
commit b8e9ab85d7
14 changed files with 106 additions and 19 deletions

View File

@@ -108,6 +108,7 @@ function ActionNode({ id, data }: NodeProps<ActionNode>) {
<HelpTooltip content={urlTooltip} />
</div>
<WorkflowBlockInputTextarea
isFirstInputInNode
nodeId={id}
onChange={(value) => {
handleChange("url", value);

View File

@@ -97,6 +97,7 @@ function ExtractionNode({ id, data }: NodeProps<ExtractionNode>) {
/>
</div>
<WorkflowBlockInputTextarea
isFirstInputInNode
nodeId={id}
onChange={(value) => {
if (!editable) {

View File

@@ -105,6 +105,7 @@ function FileDownloadNode({ id, data }: NodeProps<FileDownloadNode>) {
<HelpTooltip content={urlTooltip} />
</div>
<WorkflowBlockInputTextarea
isFirstInputInNode
nodeId={id}
onChange={(value) => {
handleChange("url", value);

View File

@@ -102,6 +102,7 @@ function LoginNode({ id, data }: NodeProps<LoginNode>) {
<HelpTooltip content={helpTooltips["login"]["url"]} />
</div>
<WorkflowBlockInputTextarea
isFirstInputInNode
nodeId={id}
onChange={(value) => {
handleChange("url", value);

View File

@@ -104,6 +104,7 @@ function LoopNode({ id, data }: NodeProps<LoopNode>) {
<HelpTooltip content={helpTooltips["loop"]["loopValue"]} />
</div>
<WorkflowBlockInput
isFirstInputInNode
nodeId={id}
value={inputs.loopVariableReference}
onChange={(value) => {

View File

@@ -104,6 +104,7 @@ function NavigationNode({ id, data }: NodeProps<NavigationNode>) {
<HelpTooltip content={helpTooltips["navigation"]["url"]} />
</div>
<WorkflowBlockInputTextarea
isFirstInputInNode
nodeId={id}
onChange={(value) => {
handleChange("url", value);

View File

@@ -82,6 +82,7 @@ function PDFParserNode({ id, data }: NodeProps<PDFParserNode>) {
<HelpTooltip content={helpTooltips["pdfParser"]["fileUrl"]} />
</div>
<WorkflowBlockInput
isFirstInputInNode
nodeId={id}
value={inputs.fileUrl}
onChange={(value) => {

View File

@@ -79,6 +79,7 @@ function SendEmailNode({ id, data }: NodeProps<SendEmailNode>) {
<div className="space-y-2">
<Label className="text-xs text-slate-300">Recipients</Label>
<WorkflowBlockInput
isFirstInputInNode
nodeId={id}
onChange={(value) => {
handleChange("recipients", value);

View File

@@ -125,6 +125,7 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
<HelpTooltip content={helpTooltips["task"]["url"]} />
</div>
<WorkflowBlockInputTextarea
isFirstInputInNode
nodeId={id}
onChange={(value) => {
handleChange("url", value);

View File

@@ -1,4 +1,3 @@
import { AutoResizingTextarea } from "@/components/AutoResizingTextarea/AutoResizingTextarea";
import { HelpTooltip } from "@/components/HelpTooltip";
import { Checkbox } from "@/components/ui/checkbox";
import { Label } from "@/components/ui/label";
@@ -24,6 +23,7 @@ import { NodeActionMenu } from "../NodeActionMenu";
import { ParametersMultiSelect } from "../TaskNode/ParametersMultiSelect";
import { WorkflowBlockIcon } from "../WorkflowBlockIcon";
import { type TextPromptNode } from "./types";
import { WorkflowBlockInputTextarea } from "@/components/WorkflowBlockInputTextarea";
function TextPromptNode({ id, data }: NodeProps<TextPromptNode>) {
const { updateNodeData } = useReactFlow();
@@ -88,13 +88,15 @@ function TextPromptNode({ id, data }: NodeProps<TextPromptNode>) {
<Label className="text-xs text-slate-300">Prompt</Label>
<HelpTooltip content={helpTooltips["textPrompt"]["prompt"]} />
</div>
<AutoResizingTextarea
onChange={(event) => {
<WorkflowBlockInputTextarea
isFirstInputInNode
nodeId={id}
onChange={(value) => {
if (!editable) {
return;
}
setInputs({ ...inputs, prompt: event.target.value });
updateNodeData(id, { prompt: event.target.value });
setInputs({ ...inputs, prompt: value });
updateNodeData(id, { prompt: value });
}}
value={inputs.prompt}
placeholder="What do you want to generate?"

View File

@@ -88,6 +88,7 @@ function ValidationNode({ id, data }: NodeProps<ValidationNode>) {
<div className="space-y-2">
<Label className="text-xs text-slate-300">Complete if...</Label>
<WorkflowBlockInputTextarea
isFirstInputInNode
nodeId={id}
onChange={(value) => {
handleChange("completeCriterion", value);

View File

@@ -1,5 +1,4 @@
import { HelpTooltip } from "@/components/HelpTooltip";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { useDeleteNodeCallback } from "@/routes/workflows/hooks/useDeleteNodeCallback";
import { useNodeLabelChangeHandler } from "@/routes/workflows/hooks/useLabelChangeHandler";
@@ -11,6 +10,7 @@ import { EditableNodeTitle } from "../components/EditableNodeTitle";
import { NodeActionMenu } from "../NodeActionMenu";
import { WorkflowBlockIcon } from "../WorkflowBlockIcon";
import type { WaitNode } from "./types";
import { WorkflowBlockInput } from "@/components/WorkflowBlockInput";
function WaitNode({ id, data }: NodeProps<WaitNode>) {
const { updateNodeData } = useReactFlow();
@@ -79,16 +79,18 @@ function WaitNode({ id, data }: NodeProps<WaitNode>) {
</Label>
<HelpTooltip content={helpTooltips["wait"]["waitInSeconds"]} />
</div>
<Input
<WorkflowBlockInput
nodeId={id}
isFirstInputInNode
type="number"
min="1"
max="300"
value={inputs.waitInSeconds}
onChange={(event) => {
onChange={(value) => {
if (!editable) {
return;
}
handleChange("waitInSeconds", Number(event.target.value));
handleChange("waitInSeconds", Number(value));
}}
className="nopan text-xs"
/>