Fix "Response Length" slider showing wrong value (#3659) - "Mad Lab Mode" was falsely "resetting" the slider control, for no obvious reason besides weird implementation.

bdbe04325983e7741f643339af5733926ec0ad99

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +10 -8Showing whitespace changes
public/scripts/power-user.js+10 -8
@@ -492,7 +492,7 @@ function switchSwipeNumAllMessages() {
492492
493493var originalSliderValues = [];
494494
495495async function switchLabMode({ noReset = false } = {}) {
496496
497497 /* if (power_user.enableZenSliders && power_user.enableLabMode) {
498498 toastr.warning("Can't start Lab Mode while Zen Sliders are active")
@@ -522,12 +522,15 @@ async function switchLabMode() {
522522 $('#labModeWarning').removeClass('displayNone');
523523 //$("#advanced-ai-config-block input[type='range']").hide()
524524
525+ $('#amount_gen_counter').attr('min', '1')
526+ .attr('max', '99999')
527+ .attr('step', '1');
525528 $('#amount_gen').attr('min', '1')
526529 .attr('max', '99999')
527530 .attr('step', '1');
528531
529532
530533 } else if (!noReset) {
531534 //re apply the original sliders values to each input
532535 originalSliderValues.forEach(function (slider) {
533536 $('#' + slider.id)
@@ -539,9 +542,8 @@ async function switchLabMode() {
539542 $('#advanced-ai-config-block input[type=\'range\']').show();
540543 $('#labModeWarning').addClass('displayNone');
541544
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');
545547 }
546548}
547549
@@ -1538,7 +1540,7 @@ async function loadPowerUserSettings(settings, data) {
15381540 $('#prefer_character_prompt').prop('checked', power_user.prefer_character_prompt);
15391541 $('#prefer_character_jailbreak').prop('checked', power_user.prefer_character_jailbreak);
15401542 $('#enableZenSliders').prop('checked', power_user.enableZenSliders).trigger('input');
15411543 $('#enableLabMode').prop('checked', power_user.enableLabMode).trigger('input', { fromInit: true });
15421544 $(`input[name="avatar_style"][value="${power_user.avatar_style}"]`).prop('checked', true);
15431545 $(`#chat_display option[value=${power_user.chat_display}]`).attr('selected', true).trigger('change');
15441546 $('#chat_width_slider').val(power_user.chat_width);
@@ -3577,7 +3579,7 @@ $(document).ready(() => {
35773579 saveSettingsDebounced();
35783580 });
35793581
35803582 $('#enableLabMode').on('input', function (event, { fromInit = false } = {}) {
35813583 const value = !!$(this).prop('checked');
35823584 if (power_user.enableZenSliders === true && value === true) {
35833585 //disallow Lab Mode if ZenSliders are active
@@ -3587,7 +3589,7 @@ $(document).ready(() => {
35873589 }
35883590
35893591 power_user.enableLabMode = value;
35903592 switchLabMode({ noReset: fromInit });
35913593 saveSettingsDebounced();
35923594 });
35933595