Skip to content

The design language that makes your AI harness better at design.

JavaScript

Sync generated provider output

github-actions[bot]a05436993fc7
diff --git a/.agent/skills/impeccable/scripts/live-browser.js b/.agent/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.agent/skills/impeccable/scripts/live-browser.js
+++ b/.agent/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.agents/skills/impeccable/scripts/live-browser.js b/.agents/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.agents/skills/impeccable/scripts/live-browser.js
+++ b/.agents/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.claude/skills/impeccable/scripts/live-browser.js b/.claude/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.claude/skills/impeccable/scripts/live-browser.js
+++ b/.claude/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.cursor/skills/impeccable/scripts/live-browser.js b/.cursor/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.cursor/skills/impeccable/scripts/live-browser.js
+++ b/.cursor/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.dsh/skills/impeccable/scripts/live-browser.js b/.dsh/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.dsh/skills/impeccable/scripts/live-browser.js
+++ b/.dsh/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.gemini/skills/impeccable/scripts/live-browser.js b/.gemini/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.gemini/skills/impeccable/scripts/live-browser.js
+++ b/.gemini/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.github/skills/impeccable/scripts/live-browser.js b/.github/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.github/skills/impeccable/scripts/live-browser.js
+++ b/.github/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.grok/skills/impeccable/scripts/live-browser.js b/.grok/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.grok/skills/impeccable/scripts/live-browser.js
+++ b/.grok/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.hermes/skills/impeccable/scripts/live-browser.js b/.hermes/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.hermes/skills/impeccable/scripts/live-browser.js
+++ b/.hermes/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.kiro/skills/impeccable/scripts/live-browser.js b/.kiro/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.kiro/skills/impeccable/scripts/live-browser.js
+++ b/.kiro/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.omp/skills/impeccable/scripts/live-browser.js b/.omp/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.omp/skills/impeccable/scripts/live-browser.js
+++ b/.omp/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.opencode/skills/impeccable/scripts/live-browser.js b/.opencode/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.opencode/skills/impeccable/scripts/live-browser.js
+++ b/.opencode/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.pi/skills/impeccable/scripts/live-browser.js b/.pi/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.pi/skills/impeccable/scripts/live-browser.js
+++ b/.pi/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.qoder/skills/impeccable/scripts/live-browser.js b/.qoder/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.qoder/skills/impeccable/scripts/live-browser.js
+++ b/.qoder/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.rovodev/skills/impeccable/scripts/live-browser.js b/.rovodev/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.rovodev/skills/impeccable/scripts/live-browser.js
+++ b/.rovodev/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.trae-cn/skills/impeccable/scripts/live-browser.js b/.trae-cn/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.trae-cn/skills/impeccable/scripts/live-browser.js
+++ b/.trae-cn/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.trae/skills/impeccable/scripts/live-browser.js b/.trae/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.trae/skills/impeccable/scripts/live-browser.js
+++ b/.trae/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.veto/skills/impeccable/scripts/live-browser.js b/.veto/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.veto/skills/impeccable/scripts/live-browser.js
+++ b/.veto/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/.vibe/skills/impeccable/scripts/live-browser.js b/.vibe/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/.vibe/skills/impeccable/scripts/live-browser.js
+++ b/.vibe/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/cursor-plugin/skills/impeccable/scripts/live-browser.js b/cursor-plugin/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/cursor-plugin/skills/impeccable/scripts/live-browser.js
+++ b/cursor-plugin/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();
diff --git a/plugin/skills/impeccable/scripts/live-browser.js b/plugin/skills/impeccable/scripts/live-browser.js
index ac5ab80e3..53a2d95fa 100644
--- a/plugin/skills/impeccable/scripts/live-browser.js
+++ b/plugin/skills/impeccable/scripts/live-browser.js
@@ -3130,6 +3130,11 @@
let paramsPanelBody = null; // grid holding the knob cells
let paramsCurrentValues = {}; // {paramId: value} - mirror of the visible variant's live values
let tuneOpen = false; // whether the Tune popover is open right now
+ // Tune values a saved session carried across a reload: {sessionId, variant,
+ // values}. Cycling refreshes of that session and variant restore them (a
+ // resume refreshes more than once); a refresh for any other variant, or a
+ // knob edit, drops them.
+ let restoredParamValues = null;
// Theme-aware Tune popover. Appears as a drawer that slides out from the
// contextual bar's bar-facing edge (below if the bar sits below the
@@ -3266,6 +3271,54 @@
}
}
+ function rememberSavedParamValues(saved) {
+ const values = saved.paramValues;
+ if (!values || typeof values !== 'object' || Array.isArray(values)) return;
+ if (Object.keys(values).length === 0) return;
+ const variant = Number(saved.visible != null ? saved.visible : saved.visibleVariant) || 0;
+ restoredParamValues = { sessionId: saved.id || null, variant, values: { ...values } };
+ }
+
+ function restoredParamValuesForVisibleVariant() {
+ const restored = restoredParamValues;
+ if (!restored) return null;
+ if (restored.sessionId === currentSessionId && restored.variant === visibleVariant) return restored.values;
+ restoredParamValues = null;
+ return null;
+ }
+
+ // The local save is what a reload resumes from, so an edit is saved there
+ // as well as checkpointed to the server.
+ function noteParamEdited() {
+ restoredParamValues = null;
+ saveSession();
+ queueCheckpoint('param_changed');
+ }
+
+ // A saved value comes from storage the page does not own, and the variant
+ // may have been regenerated since, so it must still fit the param it names.
+ function isValidSavedParamValue(p, value) {
+ if (p.kind === 'range') {
+ if (typeof value !== 'number' || !Number.isFinite(value)) return false;
+ const min = p.min != null ? Number(p.min) : 0;
+ const max = p.max != null ? Number(p.max) : 1;
+ return value >= min && value <= max;
+ }
+ if (p.kind === 'toggle') return typeof value === 'boolean';
+ if (p.kind === 'steps') {
+ return (p.options || []).some(o => (o && typeof o === 'object' ? o.value : o) === value);
+ }
+ return false;
+ }
+
+ function applySavedParamValues(variantEl, params, saved) {
+ for (const p of params) {
+ if (!Object.hasOwn(saved, p.id) || !isValidSavedParamValue(p, saved[p.id])) continue;
+ paramsCurrentValues[p.id] = saved[p.id];
+ applyParamValue(variantEl, p, saved[p.id]);
+ }
+ }
+
function formatRangeValue(input) {
const max = parseFloat(input.max), min = parseFloat(input.min);
const v = parseFloat(input.value);
@@ -3320,7 +3373,7 @@
paramsCurrentValues[p.id] = v;
readout.textContent = formatRangeValue(input);
applyParamValue(variantEl, p, v);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(input);
} else if (p.kind === 'toggle') {
@@ -3351,7 +3404,7 @@
knob.style.left = next ? '18px' : '2px';
readout.textContent = next ? 'On' : 'Off';
applyParamValue(variantEl, p, next);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
row.appendChild(track);
} else if (p.kind === 'steps') {
@@ -3388,7 +3441,7 @@
btn.style.color = on ? C.ink : P.text;
});
applyParamValue(variantEl, p, o.value);
- queueCheckpoint('param_changed');
+ noteParamEdited();
});
segRow.appendChild(b);
segBtns.push({ btn: b, val: o.value });
@@ -4937,6 +4990,9 @@
}
const variantEl = getVisibleVariantEl();
const params = parseVariantParams(variantEl);
+ // Values saved before a reload come back for the variant they were saved
+ // on; a switch to any other variant starts from its defaults.
+ const restored = restoredParamValuesForVisibleVariant();
if (!variantEl || params.length === 0) {
paramsCurrentValues = {};
tuneOpen = false;
@@ -4945,6 +5001,7 @@
return;
}
applyParamDefaults(variantEl, params);
+ if (restored) applySavedParamValues(variantEl, params, restored);
buildParamsPanel(variantEl, params);
if (tuneOpen) {
// If already visible (variant cycled while open), refresh in place
@@ -9531,6 +9588,7 @@ void main() {
if (saved.previewMode) currentPreviewMode = saved.previewMode;
if (saved.paramValues && typeof saved.paramValues === 'object') {
paramsCurrentValues = { ...saved.paramValues };
+ rememberSavedParamValues(saved);
}
if (saved.parameterState) parameterGenerationState = saved.parameterState;
sessionOrigin = saved.origin === 'agent' ? 'agent' : null;
@@ -10162,10 +10220,9 @@ void main() {
hideShaderOverlay();
if (isInsert) finalizeInsertSession();
disableInlineEdit();
- // Build the params panel for the restored visible variant. Previously
- // this was missed on page-reload resume: showVariantInDOM above fires
- // refreshParamsPanel, but state was still IDLE at that moment so it
- // hid. Now that state is CYCLING, re-fire.
+ // Build the params panel for the restored visible variant, with any
+ // Tune values saved before the reload (showVariantInDOM above may
+ // already have refreshed; a repeat for the same variant keeps them).
refreshParamsPanel();
}
saveSession();