Fix "Response Length" slider showing wrong value (#3659) - "Mad Lab Mode" was falsely "resetting" the slider control, for no obvious reason besides weird implementation.
Signed| @@ -492,7 +492,7 @@ function switchSwipeNumAllMessages() { | ||
| 492 | 492 | |
| 493 | 493 | var originalSliderValues = []; |
| 494 | 494 | |
| 495 | 495 | async function switchLabMode({ noReset = false } = {}) { |
| 496 | 496 | |
| 497 | 497 | /* if (power_user.enableZenSliders && power_user.enableLabMode) { |
| 498 | 498 | toastr.warning("Can't start Lab Mode while Zen Sliders are active") |
| @@ -522,12 +522,15 @@ async function switchLabMode() { | ||
| 522 | 522 | $('#labModeWarning').removeClass('displayNone'); |
| 523 | 523 | //$("#advanced-ai-config-block input[type='range']").hide() |
| 524 | 524 | |
| 525 | + $('#amount_gen_counter').attr('min', '1') | |
| 526 | + .attr('max', '99999') | |
| 527 | + .attr('step', '1'); | |
| 525 | 528 | $('#amount_gen').attr('min', '1') |
| 526 | 529 | .attr('max', '99999') |
| 527 | 530 | .attr('step', '1'); |
| 528 | 531 | |
| 529 | 532 | |
| 530 | 533 | } else if (!noReset) { |
| 531 | 534 | //re apply the original sliders values to each input |
| 532 | 535 | originalSliderValues.forEach(function (slider) { |
| 533 | 536 | $('#' + slider.id) |
| @@ -539,9 +542,8 @@ async function switchLabMode() { | ||
| 539 | 542 | $('#advanced-ai-config-block input[type=\'range\']').show(); |
| 540 | 543 | $('#labModeWarning').addClass('displayNone'); |
| 541 | 544 | |
| 542 | - $('#amount_gen').attr('min', '16') | |
| 545 | + // To set the correct amount_gen back, we just call the function calculating it correctly | |
| 543 | - .attr('max', '2048') | |
| 546 | + switchMaxContextSize(); | |
| 544 | - .attr('step', '1'); | |
| 545 | 547 | } |
| 546 | 548 | } |
| 547 | 549 | |
| @@ -1538,7 +1540,7 @@ async function loadPowerUserSettings(settings, data) { | ||
| 1538 | 1540 | $('#prefer_character_prompt').prop('checked', power_user.prefer_character_prompt); |
| 1539 | 1541 | $('#prefer_character_jailbreak').prop('checked', power_user.prefer_character_jailbreak); |
| 1540 | 1542 | $('#enableZenSliders').prop('checked', power_user.enableZenSliders).trigger('input'); |
| 1541 | 1543 | $('#enableLabMode').prop('checked', power_user.enableLabMode).trigger('input', { fromInit: true }); |
| 1542 | 1544 | $(`input[name="avatar_style"][value="${power_user.avatar_style}"]`).prop('checked', true); |
| 1543 | 1545 | $(`#chat_display option[value=${power_user.chat_display}]`).attr('selected', true).trigger('change'); |
| 1544 | 1546 | $('#chat_width_slider').val(power_user.chat_width); |
| @@ -3577,7 +3579,7 @@ $(document).ready(() => { | ||
| 3577 | 3579 | saveSettingsDebounced(); |
| 3578 | 3580 | }); |
| 3579 | 3581 | |
| 3580 | 3582 | $('#enableLabMode').on('input', function (event, { fromInit = false } = {}) { |
| 3581 | 3583 | const value = !!$(this).prop('checked'); |
| 3582 | 3584 | if (power_user.enableZenSliders === true && value === true) { |
| 3583 | 3585 | //disallow Lab Mode if ZenSliders are active |
| @@ -3587,7 +3589,7 @@ $(document).ready(() => { | ||
| 3587 | 3589 | } |
| 3588 | 3590 | |
| 3589 | 3591 | power_user.enableLabMode = value; |
| 3590 | 3592 | switchLabMode({ noReset: fromInit }); |
| 3591 | 3593 | saveSettingsDebounced(); |
| 3592 | 3594 | }); |
| 3593 | 3595 | |