Skip to content

feat(sliders): save/reset/export locked parameter snapshots (#106)#117

Open
FinbarArgus wants to merge 1 commit into
mainfrom
worktree-agent-a60828dd460c91265
Open

feat(sliders): save/reset/export locked parameter snapshots (#106)#117
FinbarArgus wants to merge 1 commit into
mainfrom
worktree-agent-a60828dd460c91265

Conversation

@FinbarArgus

Copy link
Copy Markdown
Contributor

Closes #106

What

Adds a "saved snapshot" affordance to the Parameters tab, mirroring the existing Reset to init / Reset to best fit controls so it feels native:

  • Save current — lock in the current arbitrary slider values as a snapshot.
  • Reset to saved — restore those locked values after manual perturbation (so users don't have to memorise values they were testing).
  • Export values — download the saved values as a CSV.

How

Store (stores/useSliders.js) — new snapshot state + actions:

  • saved ref ({ qname: value } or null), hasSaved computed.
  • saveSnapshot() captures current values; resetToSaved() restores them (clamped to each slider's range, ignoring sliders that no longer exist); setSaved() (for restore-from-storage), clearSaved(). clear() also forgets the snapshot on model change.

UI (components/ControlPanel.vue) — three text buttons next to the existing resets: save-snapshot, reset-saved (gated on hasSaved), export-snapshot (gated on hasSaved).

Wiring + persistence (App.vue) — handlers onSaveSnapshot / onResetSaved / onExportSnapshot. The snapshot is persisted per-model in localStorage (cuflynx-saved-params:<filePrefix>) and restored when the model changes, matching the "don't memorise" intent across reloads.

Export format (lib/paramsCsv.js) — reuses the existing CSV helpers via new buildParamValuesCsv() (columns vessel_name,param_name,value,name_for_plotting, qname split like params_for_id) and snapshotFilename() (<model>_param_values_<yymmdd>.csv).

Tests

  • stores/useSliders.test.js — save / reset-to-saved (with clamping + missing-slider no-op) / setSaved / clearSaved / clear-forgets-snapshot / hasSaved gating.
  • lib/paramsCsv.test.jsbuildParamValuesCsv rows + non-finite handling; snapshotFilename.
  • components/ControlPanel.test.js — save emits, reset/export gated on hasSaved, save disabled without sliders.

308 frontend tests pass; yarn build clean. No backend changes. Existing initial/best-fit resets untouched.

🤖 Generated with Claude Code

@FinbarArgus
FinbarArgus force-pushed the worktree-agent-a60828dd460c91265 branch from 2f3660e to ef21ce1 Compare July 24, 2026 06:04
Add a "saved snapshot" affordance to the Parameters tab, alongside the
existing "Reset to init" / "Reset to best fit" controls:

- Save current: lock in the current arbitrary slider values.
- Reset to saved: restore the locked values after manual perturbation.
- Export values: download the saved values as a CSV.

The snapshot lives in the sliders store (saveSnapshot / resetToSaved /
setSaved / clearSaved / hasSaved) and is persisted per-model in
localStorage so it survives a reload. Export reuses lib/paramsCsv helpers
(buildParamValuesCsv / snapshotFilename), emitting a params_for_id-style
CSV of vessel_name,param_name,value,name_for_plotting.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@FinbarArgus
FinbarArgus force-pushed the worktree-agent-a60828dd460c91265 branch from ef21ce1 to 19b8b5b Compare July 24, 2026 07:13
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.

Enhancement: Adding save, lock, reset, and export options for arbitrary parameter slider values

1 participant