Skip to content

Commit bff3827

Browse files
cagnuleinclaude
andcommitted
Always show the ramp unit selector without an enable checkbox
Ramp Unit never gated anything on save (only the Ramp From/Ramp To checkboxes decide whether the ramp is applied), so the extra enable/disable checkbox on it was just friction: users had to tick it before they could even see whether it was set to W or % FTP. Made it a `noToggle` field so it always renders as an active dropdown, defaulting to W. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 15f86b6 commit bff3827

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/inner_templates/workouteditor/workout-editor-app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
{ key: 'resistance', labelKey: 'workoutEditor.resistance', label: 'Resistance', type: 'number', step: 1, min: 0, max: 100, group: 'basic', devices: ['bike', 'elliptical'], defaultValue: 20 },
3232
{ key: 'cadence', labelKey: 'workoutEditor.cadence', label: 'Cadence', type: 'number', unitSuffix: 'rpm', min: 0, max: 240, group: 'basic', devices: ['bike', 'elliptical', 'rower'], defaultValue: 80 },
3333
{ key: 'power', labelKey: 'workoutEditor.power', label: 'Power', type: 'number', unitSuffix: 'W', min: 0, max: 2000, group: 'basic', devices: ['bike', 'rower'], defaultValue: 150 },
34-
{ key: 'powerrampunit', labelKey: 'workoutEditor.powerRampUnit', label: 'Ramp Unit', type: 'select', options: ['W', '% FTP'], group: 'advanced', devices: ['bike', 'rower'], defaultValue: 'W' },
34+
{ key: 'powerrampunit', labelKey: 'workoutEditor.powerRampUnit', label: 'Ramp Unit', type: 'select', options: ['W', '% FTP'], group: 'advanced', devices: ['bike', 'rower'], defaultValue: 'W', noToggle: true },
3535
{ key: 'powerfrom', labelKey: 'workoutEditor.powerRampFrom', label: 'Ramp From', type: 'number', min: 0, max: 2000, group: 'advanced', devices: ['bike', 'rower'], defaultValue: 100 },
3636
{ key: 'powerto', labelKey: 'workoutEditor.powerRampTo', label: 'Ramp To', type: 'number', min: 0, max: 2000, group: 'advanced', devices: ['bike', 'rower'], defaultValue: 200 },
3737
{ key: 'forcespeed', labelKey: 'workoutEditor.forceSpeed', label: 'Force Speed', type: 'bool', group: 'basic', devices: ['treadmill'], linkedTo: 'speed' },
@@ -821,8 +821,8 @@
821821
return;
822822
}
823823
const value = row[field.key];
824-
// For pace field, use speed's enabled state
825-
const isEnabled = field.syncWith ? (row['__enabled_' + field.syncWith] !== false) : (row['__enabled_' + field.key] !== false);
824+
// For pace field, use speed's enabled state; fields without a toggle are always enabled
825+
const isEnabled = field.noToggle ? true : (field.syncWith ? (row['__enabled_' + field.syncWith] !== false) : (row['__enabled_' + field.key] !== false));
826826
const fieldWrap = document.createElement('div');
827827
fieldWrap.className = 'field';
828828
if (!isEnabled) {
@@ -834,7 +834,7 @@
834834
const labelWrap = document.createElement('label');
835835
labelWrap.className = 'field-label';
836836

837-
const allowToggle = field.key !== 'name' && !field.linkedTo && !field.syncWith;
837+
const allowToggle = field.key !== 'name' && !field.linkedTo && !field.syncWith && !field.noToggle;
838838
if (allowToggle) {
839839
const enableCheckbox = document.createElement('input');
840840
enableCheckbox.type = 'checkbox';

0 commit comments

Comments
 (0)