From 75857cdcea822749f23c9109b33f869ca322a3aa Mon Sep 17 00:00:00 2001 From: Shine1i Date: Thu, 26 Feb 2026 11:44:57 +0100 Subject: [PATCH] feat(recipe-studio): polish import/llm editors, refs preview, copy toast, and note layout behavior --- .../components/inline/inline-expression.tsx | 23 +--- .../components/recipe-graph-aux-node.tsx | 28 +--- .../shared/available-references-inline.tsx | 120 ++++++++++++++++++ .../recipe-studio/dialogs/import-dialog.tsx | 2 +- .../recipe-studio/dialogs/llm/general-tab.tsx | 4 +- .../hooks/use-recipe-persistence.ts | 2 +- .../recipe-studio/stores/recipe-studio.ts | 17 +-- 7 files changed, 131 insertions(+), 65 deletions(-) create mode 100644 studio/frontend/src/features/recipe-studio/components/shared/available-references-inline.tsx diff --git a/studio/frontend/src/features/recipe-studio/components/inline/inline-expression.tsx b/studio/frontend/src/features/recipe-studio/components/inline/inline-expression.tsx index 94c5470f49..16a36d1ad5 100644 --- a/studio/frontend/src/features/recipe-studio/components/inline/inline-expression.tsx +++ b/studio/frontend/src/features/recipe-studio/components/inline/inline-expression.tsx @@ -1,4 +1,3 @@ -import { Badge } from "@/components/ui/badge"; import { Input } from "@/components/ui/input"; import { Select, @@ -11,6 +10,7 @@ import type { ReactElement } from "react"; import { useRecipeStudioStore } from "../../stores/recipe-studio"; import type { ExpressionConfig, ExpressionDtype } from "../../types"; import { getAvailableVariableEntries } from "../../utils/variables"; +import { AvailableReferencesInline } from "../shared/available-references-inline"; import { InlineField } from "./inline-field"; type InlineExpressionProps = { @@ -58,26 +58,7 @@ export function InlineExpression({ /> - {vars.length > 0 && ( -
-

Available references

-
- {vars.map((v) => ( - - {v.name} - - ))} -
-
- )} + ); } diff --git a/studio/frontend/src/features/recipe-studio/components/recipe-graph-aux-node.tsx b/studio/frontend/src/features/recipe-studio/components/recipe-graph-aux-node.tsx index a08b538afc..2aa1988102 100644 --- a/studio/frontend/src/features/recipe-studio/components/recipe-graph-aux-node.tsx +++ b/studio/frontend/src/features/recipe-studio/components/recipe-graph-aux-node.tsx @@ -1,4 +1,3 @@ -import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Textarea } from "@/components/ui/textarea"; @@ -15,6 +14,7 @@ import type { LlmConfig, Score, ScoreOption } from "../types"; import { AUX_HANDLE_CLASS } from "../utils/handle-layout"; import { HANDLE_IDS } from "../utils/handles"; import { getAvailableVariableEntries } from "../utils/variables"; +import { AvailableReferencesInline } from "./shared/available-references-inline"; import { BaseNode, BaseNodeContent, BaseNodeHeader, BaseNodeHeaderTitle } from "./rf-ui/base-node"; type PromptField = "prompt" | "system_prompt"; @@ -59,27 +59,7 @@ function updateOptionAt( function AuxVariableBadges({ llmId }: { llmId: string }): ReactElement | null { const configs = useRecipeStudioStore((state) => state.configs); const vars = getAvailableVariableEntries(configs, llmId); - if (vars.length === 0) return null; - return ( -
-

Available references

-
- {vars.map((v) => ( - - {v.name} - - ))} -
-
- ); + return ; } function AuxNodeBase({ @@ -144,7 +124,7 @@ function AuxNodeBase({