Files
windmill/frontend/src/lib/components/flow_builder.ts
T
Guilhem LemouelandClaude Opus 5 559ffb7285 feat: one breadcrumb in the page header, and the banners that used to sit under it
The header band now carries a single breadcrumb — workspace, fork, then the item's
path — built from one component, so every segment has the same size, weight and icon
size, and slashes separate them. The item's kind icon rides with its summary, after a
dot, rather than with the path.

The fork and drafts banners move into the band as badges plus a subtle Review button:
ahead/behind counts instead of a bare change total, and the per-kind breakdown stays on
the compare page. The home hero's CLI, MCP and Hub links move into an ellipsis menu,
alongside the toggle that pins the session chat to the page.

The flow editor and the app viewer hand their bar to the band too, and a route can drop
the band's bottom border when its own content draws one — the border stays in the box
with a transparent colour, so contents never shift a pixel across a navigation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 16:22:24 +02:00

82 lines
3.8 KiB
TypeScript

import type { Flow, OpenFlow } from '$lib/gen'
import type { StateStore } from '$lib/utils'
import type { FlowState } from './flows/flowState'
import type { Trigger } from './triggers/utils'
import type { DiffDrawerI } from './diff_drawer'
import type { FlowBuilderWhitelabelCustomUi } from './custom_ui'
import type { ScheduleTrigger } from './triggers'
import type { stepState } from './stepHistoryLoader.svelte'
import type { WorkspaceItem } from './workspacePicker'
export type FlowBuilderProps = {
initialPath?: string
/** The draft row's own path (the URL path). `initialPath` is re-seeded from the
* draft's `draft_path` so the topbar shows the pending name, so it can't be used
* to resolve what is actually deployed. */
userDraftPath?: string
/** Moves the draft's base to the head and keeps its content; offered in the diff
* drawer while the draft is behind, and called with the version the drawer shows
* as head. */
onTakeLatest?: (head?: string) => void | Promise<void>
pathStoreInit?: string | undefined
newFlow: boolean
selectedId: string | undefined
initialArgs?: Record<string, any>
loading?: boolean
flowStore: StateStore<OpenFlow>
flowStateStore: StateStore<FlowState>
savedFlow?: Flow & { no_deployed?: boolean }
diffDrawer?: DiffDrawerI | undefined
customUi?: FlowBuilderWhitelabelCustomUi
disableAi?: boolean
disabledFlowInputs?: boolean
savedPrimarySchedule?: ScheduleTrigger | undefined // used to set the primary schedule in the legacy primaryScheduleStore
version?: number | undefined
/** flow_version the draft was forked from (as text, like `draft_base`); when
* set, the deploy-time staleness check compares it (not the load-time head
* `version`) against the latest. */
draftBaseVersion?: string | undefined
draftTriggersFromUrl?: Trigger[] | undefined
selectedTriggerIndexFromUrl?: number | undefined
children?: import('svelte').Snippet
loadedFromHistoryFromUrl?: {
flowJobInitial: boolean | undefined
stepsState: Record<string, stepState>
}
noInitial?: boolean
liveEditorDraftStoragePath?: string
// Indicator-only draft key overrides. When the flow editor is embedded
// (e.g. the sessions preview) its autosave runs under a different
// (workspace, path) than `$workspaceStore`/`liveEditorDraftStoragePath`
// (a forked workspace, and a path this component doesn't own). These let
// the host point the `AutosaveIndicator` at the key its own autosave uses,
// WITHOUT repurposing `liveEditorDraftStoragePath` (which still drives this
// component's setLiveEditorDraft/flush). Undefined → fall back, so the
// full-page editor is unaffected.
autosaveWorkspace?: string
autosavePath?: string
onDeploy?: ({ path }: { path: string }) => void
onDeployError?: ({ error }: { error: any }) => void
onDetails?: ({ path }: { path: string }) => void
onHistoryRestore?: () => void
onNavigate?: (item: WorkspaceItem) => void
// Threaded to the `AutosaveIndicator` popover so its "Reset to
// deployed" button can do the same thing the load-time toast offers.
onResetToDeployed?: () => void | Promise<void>
// See ScriptBuilderProps — same semantics for the flow editor's
// indicator.
loadedFromDraft?: boolean
othersDraftsCount?: number
onOpenOthersDrafts?: () => void
// Fired whenever a test run is started from the flow editor, with the
// preview job id. Used by whitelabel embedders to track test jobs.
onTestJob?: (e: { jobId: string }) => void
// Condensed top bar: smaller (sm) buttons, a shorter bar, and the
// EditorHeader's path/breadcrumb row dropped (summary only). Used by the
// session preview to save vertical room.
condensedHeader?: boolean
/** The editor's path/summary and actions go to the route's page header instead of a bar of
* its own. Only the full-page editor sets it; embedders keep their own bar. */
ownsPageHeader?: boolean
}