Files
windmill/backend/windmill-trigger
Diego Imbert cd746e366f Merge origin/main into remove-workspace-drafts
Resolve three conflicts + adapt the workspace-drafts feature to the
per-user model:

* RawAppEditorHeader.svelte: keep our pendingDraftPath + onResetToDeployed
  props; drop main's onSaveDraft prop (dead in the per-user model — saves
  flow through UserDraftDbSyncer's autosave, no explicit "save draft"
  button exists anymore).

* ScriptEditorView.svelte's restoreDeployed: keep main's
  invalidateWorkspaceDrafts call but route the actual delete through our
  UserDraftDbSyncer.save({value: null}) instead of main's
  DraftService.deleteDraft (the workspace-draft endpoint no longer
  exists). Drop SessionItemNotFound import that was leftover from a HEAD
  refactor and never wired.

* sessionRuntime.svelte.ts: keep our SavedFlow/SavedScript types
  (Omit<X & UserDraftOverlay, 'draft'> & { draft? }) over main's
  NewScriptWithDraft / (Flow & { draft? }) shapes — the former carry the
  full overlay (is_draft, draft_saved_at, no_deployed, other_drafts_users)
  the editor reads. Adopt main's LoadSlot consolidation (single scriptSlot
  object replaces three vars + drops three dead getters from the
  interface that no consumer reads).

Cleanup the user flagged:

* Remove onSaveDraft prop + bind from RawAppEditor.svelte; ScriptBuilder
  and FlowBuilder never had it. Strip the dead onSaveDraft callbacks
  from ScriptEditorView, FlowEditorView, RawAppEditorView. In our model
  the editor auto-saves through UserDraftDbSyncer; there is no
  user-triggered save-draft event to fire.

* utils_draft_deploy.ts + rawAppDeploy.ts + CompareDrafts.svelte:
  replace main's new getXByPathWithDraft endpoints (workspace-draft
  variant we don't have) with our getXByPath({getDraft: true}). The
  WithDraftOverlay response shape is structurally compatible (.draft
  sub-object); strip the overlay markers (is_draft / draft_saved_at /
  no_deployed / other_drafts_users) on the deployed side so the
  DiffDrawer's cleanValueProperties doesn't render them as noise.

* utils_draft_deploy.ts's discardDraft: route the non-draft_only branch
  through UserDraftDbSyncer.save({value: null}) instead of
  DraftService.deleteDraft. Per-user semantics match what the workspace
  draft list (include_draft_only) returns — the user's own drafts.

ChatContextPicker.svelte: `DrillPicker<ChatLeafData>` doesn't compile
under Svelte 5's emitted Component type. Swap for
`ReturnType<typeof DrillPicker>` — `inner` is only used for
handleKeydown, the generic isn't needed at the binding site.
2026-06-09 08:17:37 +02:00
..