feat(sliders): save/reset/export locked parameter snapshots (#106)#117
Open
FinbarArgus wants to merge 1 commit into
Open
feat(sliders): save/reset/export locked parameter snapshots (#106)#117FinbarArgus wants to merge 1 commit into
FinbarArgus wants to merge 1 commit into
Conversation
FinbarArgus
force-pushed
the
worktree-agent-a60828dd460c91265
branch
from
July 24, 2026 06:04
2f3660e to
ef21ce1
Compare
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
force-pushed
the
worktree-agent-a60828dd460c91265
branch
from
July 24, 2026 07:13
ef21ce1 to
19b8b5b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
How
Store (
stores/useSliders.js) — new snapshot state + actions:savedref ({ qname: value }ornull),hasSavedcomputed.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 onhasSaved),export-snapshot(gated onhasSaved).Wiring + persistence (
App.vue) — handlersonSaveSnapshot/onResetSaved/onExportSnapshot. The snapshot is persisted per-model inlocalStorage(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 newbuildParamValuesCsv()(columnsvessel_name,param_name,value,name_for_plotting, qname split like params_for_id) andsnapshotFilename()(<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.js—buildParamValuesCsvrows + non-finite handling;snapshotFilename.components/ControlPanel.test.js— save emits, reset/export gated onhasSaved, save disabled without sliders.308 frontend tests pass;
yarn buildclean. No backend changes. Existing initial/best-fit resets untouched.🤖 Generated with Claude Code