Skip to content

Feat: decouple execution-mode switching from probing, unify the Run control, and supporting store refactors#210

Open
pcolt wants to merge 8 commits into
feat/group-persist-pipelinefrom
feat/decouple-probing-execmode
Open

Feat: decouple execution-mode switching from probing, unify the Run control, and supporting store refactors#210
pcolt wants to merge 8 commits into
feat/group-persist-pipelinefrom
feat/decouple-probing-execmode

Conversation

@pcolt

@pcolt pcolt commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Note: merge first #208 than re-target to main before merging

It closes #204

  • Update CHANGELOG

Overview

Lift execution-mode selection out of SettingsModal and into the always-visible top-right overlay, unify the two Run controls into one, and make mode-switching both lightweight (no re-probe) and correct (never runs a stale configuration).

Since #203, the submit primitives take a self-contained config bag, so the active mode no longer needs to be committed through a probe. This PR turns the mode into a pair of overlay selectors — location (local/remote) and mode (coral/executable/pipeline) — and reorganises probe results so each target keeps its own validated payload.

Data model

Each target's payload lives in its natural store keyed per location: registryStore holds a local and a remote coral node registry; parametersStore holds a local and a remote executable parameter tree (now persisted).
Only a small status per backend kind still lives on each target (ExecutionTargetSettings.probes), giving 4 slots total across local/remote × coral/executable.
Live getters resolve against an internal activeLocation set by the switch orchestration, so switching location instantly changes what the palette / editor / submit see with no hydration copy, and per-location edits persist automatically. Execution location/backendKind are moved into their own persisted executionSelection store, decoupled from the { local, remote } runner config in settingsStore (which never reads that selection — every selection-dependent member takes it as an explicit argument).

UX

The overlay hosts the two selectors (replacing the read-only badge and the standalone view toggle); pipeline requires remote (enforced by disabling the invalid option). Switching to a combination that was never validated raises a toast pointing to Settings, and runs are blocked by a pre-submit guard.
SettingsModal's Save & Sync becomes an explicit Validate & Sync for the current mode's paths.
The Run control is unified in the sidebar (single → job config; pipeline → run pipeline), and all the other buttons in the old pipeline toolbar move in sidebar too.

Cleanup riding along

ProbeResult is slimmed to { ok, message, syncedAt } — probe status now lives per target × backend kind (ExecutionTargetSettings.probes), dropping the old flat AppSettings.lastProbe. Manual "Import Nodes" now merges into whichever location is active, rather than clobbering a single shared registry.

resized-pipeline.mp4

Summary

  • feat: overlay location/mode dropdowns (ExecutionBadge becomes interactive) replacing the standalone view toggle; the dropdowns write the two leaf stores directly
  • feat: execution location/backendKind moved into a dedicated persisted Svelte selection store (executionSelection, key execution_selection), decoupled from the electron-persisted runner config; the app reopens in the last location+mode
  • refactor: settingsStore stays a pure config store — selection-dependent members (getParametersFileName, saveParametersFileName, getProbe, recordProbe) take location/backendKind as explicit arguments; it never imports the selection store
  • feat: per-location coral registries in registryStore (internal activeLocation, persisted { local, remote }, best-effort migration from the old flat registered_nodes)
  • feat: per-location executable parameter trees in parametersStore, now persisted (execution_parameters)
  • refactor: slim ProbeResult to { ok, message, syncedAt }; probe status stored per target × backend kind (ExecutionTargetSettings.probes), dropping AppSettings.lastProbe
  • refactor: probe IPC takes a focused ProbeRequest { location, backendKind, target } (not the whole ExecutionSettings) and returns { status, metadata }; the renderer routes metadata to the per-location store
  • feat: unified sidebar Run for single + pipeline; move the pipeline toolbar (add-stage, import/export) into SidebarButtons; PipelineCanvas becomes a pure canvas
  • feat: manual "Import Nodes" merges into the active location's registry (shallow key-merge)
  • refactor: SettingsModal's location/backend-kind radios no longer change the active mode (that is now the overlay's job) — they select which combination to configure and Validate & Sync, seeded from the active selection when the accordion opens; Save & Sync → "Validate & Sync" with per-combo probe status
  • feat: pre-submit config guard (coral single + pipeline) blocking runs for un-validated combinations; switching to an un-validated combination toasts a hint

Test plan

  • npm run check, npm run check:electron, npm test pass (registry/graphParser tests adjusted for per-location load).
  • Validate remote/coral + remote/executable in Settings, then switch between them in the overlay: instant, correct registry/params, no re-probe.
  • Switch to a never-validated combination → toast prompts Settings; the run is blocked until validated.
  • remote/executable ↔ local/executable each load their own params (no mismatch); edits persist per location across switches and restart.
  • Import Nodes while in a coral combo → merges into that location's registry; persists across restart; the other location's registry is unaffected.
  • Single coral + executable runs submit as before (remote Docker Slurm + local); pipeline runs from the sidebar with correct --dependency; PipelineCanvas has no toolbar.
  • pipeline disabled while location is local; local disabled while mode is pipeline.
  • Restart in each combination → the correct per-location registry/params load without a forced re-sync; the app reopens in the last selected location+mode.
  • coral ↔ executable ↔ pipeline ↔ back remembers the coral/executable choice (backendKind survives a pipeline detour).
  • With the overlay on remote/coral, use the Settings radios to configure & Validate a different combination (e.g. local/executable) → its status turns valid without changing the canvas/overlay (no palette flip); switching the overlay to it later shows no "not validated" toast.

pcolt added 6 commits July 15, 2026 10:27
- feat: choose execution location/mode from interactive top-right dropdowns (ExecutionBadge); remove the standalone view toggle
- feat: keep coral registries and executable parameters per execution location, resolved by an internal activeLocation
- feat: unify the Run control in the sidebar (single job or pipeline) and move the pipeline toolbar there; PipelineCanvas becomes a pure canvas
- refactor: slim ProbeResult to status-only and return {status, metadata} from the probe IPC; route payload to the per-location store
- feat: pre-submit guard blocks runs for un-validated location/backend combinations
- refactor: SettingsModal drops the mode radios; Save & Sync becomes Validate & Sync for the current mode's paths
- test: per-location isolation coverage for the registry and parameters stores
- docs: CHANGELOG + CLAUDE.md for the overlay selector, per-location stores, and storage keys
- refactor: the renderer now sends { location, backendKind, target } to 'probe-sync-execution-settings' instead of the whole ExecutionSettings
- refactor: executionProbe helpers operate on the single target, decoupling the probe from the full settings shape
… selection store

- refactor: new persisted executionSelection store owns location/backendKind; AppSettings.execution is now a pure { local, remote } runner config (Electron reads no selection)
- refactor: settingsStore stays a pure config store — selection-dependent members take location/backendKind as explicit arguments instead of reading a store
- refactor: ExecutionBadge writes the leaf stores directly; drop the switchLocation/switchMode wrappers; keep a shared warnIfUnvalidated helper
- refactor: sshMessages exportAndEval* and the log/status read helpers take an explicit location argument
- test: isolation coverage for the executionSelection store
…ndent of the active mode

- feat: Settings "Execution paths" accordion regains location/backend-kind radios that pick which combination to configure and Validate & Sync, seeded from the active selection on open — they do not change the active mode (set from the overlay)
- refactor: per-location store writes take an explicit location (setRegistry(data, location), mergeRegistry(data, location), parametersStore.setValueFor); reads still resolve activeLocation, so validating a non-active combination never moves the active cursor
- refactor: applySyncedMetadata routes the probe payload to the explicit location instead of mutating activeLocation
- test: registry store coverage for explicit-location writes not moving the active cursor
- feat: dedicated plus icon (PlusIcon) for the Add stage button instead of the grid icon
- refactor: rename the pipeline "Pipeline I/O" sidebar group to "Import / Export"
- refactor: restyle ExecutionBadge as an elevated surface pill with larger, centered dropdowns; remove the focus ring on pointer click while keeping it for keyboard navigation
- refactor: reorder the top-right overlay so the dark-mode toggle sits above the execution badge
- docs: CHANGELOG #204 entry now covers validating any mode from Settings (radios no longer change the active mode) and reopening in the last selected mode
- docs: CLAUDE.md documents the executionSelection store, the pure arg-based settingsStore, explicit-location registry/params writes, the single|pipeline viewMode union, and the execution_selection storage key
@pcolt pcolt changed the title Feat: overlay execution-mode selection with per-location config and unified Run Feat: decouple execution-mode switching from probing and unify the Run control Jul 16, 2026
@pcolt pcolt changed the title Feat: decouple execution-mode switching from probing and unify the Run control Feat: decouple execution-mode switching from probing, unify the Run control, and supporting store refactors Jul 16, 2026
@pcolt
pcolt requested a review from luca-heltai July 17, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant