New run: reuse asText rather than a second copy of it
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013TTfoK82awm8wvxXhHz3XF
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
type fluksio__api__routes__runs__RunRow as RunRow,
|
type fluksio__api__routes__runs__RunRow as RunRow,
|
||||||
RunsService,
|
RunsService,
|
||||||
} from "@/client"
|
} from "@/client"
|
||||||
|
import { asText } from "@/components/Flow/NodePanel"
|
||||||
import { flowQueryOptions, flowsQueryOptions } from "@/components/Flow/queries"
|
import { flowQueryOptions, flowsQueryOptions } from "@/components/Flow/queries"
|
||||||
import {
|
import {
|
||||||
declaredInputs,
|
declaredInputs,
|
||||||
@@ -353,7 +354,7 @@ function RunForm({ flow }: { flow: string }) {
|
|||||||
...Object.fromEntries(
|
...Object.fromEntries(
|
||||||
Object.entries(run.params).map(([key, value]) => [
|
Object.entries(run.params).map(([key, value]) => [
|
||||||
key,
|
key,
|
||||||
asParamText(value),
|
asText(value),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
@@ -437,13 +438,6 @@ function submissionKey(): string {
|
|||||||
return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`
|
return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A stored parameter back in the field it was typed into. */
|
|
||||||
function asParamText(value: unknown): string {
|
|
||||||
if (value === null || value === undefined) return ""
|
|
||||||
if (typeof value === "object") return JSON.stringify(value)
|
|
||||||
return String(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
function placeholderFor(dtype: DType | undefined): string {
|
function placeholderFor(dtype: DType | undefined): string {
|
||||||
if (dtype === "artifact") return "@run:<id>.<output> or sha256:…"
|
if (dtype === "artifact") return "@run:<id>.<output> or sha256:…"
|
||||||
if (dtype === "int" || dtype === "float") {
|
if (dtype === "int" || dtype === "float") {
|
||||||
|
|||||||
@@ -399,8 +399,8 @@ export function FlowRail({
|
|||||||
<FlaskConical className="mb-1 size-4" />
|
<FlaskConical className="mb-1 size-4" />
|
||||||
{empty ?? (
|
{empty ?? (
|
||||||
<p>
|
<p>
|
||||||
Nothing has been run yet. New run is where to start one, and a
|
Nothing has been run yet. New run is where to start one, and a run
|
||||||
run from the CLI or the API lands here too.
|
from the CLI or the API lands here too.
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user