Remove legacy chat lazy load

This commit is contained in:
Cohee 2023-09-21 22:07:56 +03:00
parent 6ae1b7a72b
commit ae4a9a7b14
5 changed files with 1 additions and 48 deletions

View File

@ -164,7 +164,6 @@
"custom_stopping_strings_macro": true,
"fuzzy_search": true,
"encode_tags": false,
"lazy_load": 100,
"ui_mode": 1
},
"extension_settings": {

View File

@ -1898,7 +1898,6 @@
"Waifu Mode": "!!!РЕЖИМ ВАЙФУ!!!",
"Message Timer": "Таймер сообщений",
"Model Icon": "Показать значки модели",
"Lazy Chat Loading": "Ленивая загрузка чата",
"# of messages (0 = disabled)": "# сообщений (0 = отключено)",
"Advanced Character Search": "Расширенный поиск персонажей",
"Allow {{char}}: in bot messages": "Показывать {{char}}: в ответах",
@ -2895,7 +2894,6 @@
"Instruct": "Instruct",
"Instruct Mode": "Modalità Instruct",
"Last Sequence": "Ultima sequenza",
"Lazy Chat Loading": "Caricamento svogliato della chat",
"Least tokens": "Token minimi",
"Light": "Leggero",
"Load koboldcpp order": "Ripristina l'ordine di koboldcpp",

View File

@ -2742,7 +2742,7 @@
<span data-i18n="AI Message Blur Tint">AI Message</span>
</div>
</div>
<div data-newbie-hidden id="font-blur-UIpresets-block" class="flex-container flexFlowColumn">
<div data-newbie-hidden id="font-blur-UIpresets-block" class="flex-container flexFlowColumn flexNoGap">
<div id="font-scale-block" class="range-block">
<div class="range-block-title" data-i18n="Font Scale">
Font Scale
@ -2850,22 +2850,6 @@
</div>
</div>
</div>
<div data-newbie-hidden class="range-block">
<div class="range-block-title">
<span data-i18n="Lazy Chat Loading">Lazy Chat Loading</span><br>
<small data-i18n="# of messages (0 = disabled)"># of messages (0 = disabled)</small>
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input id="lazy_load" class="wide100p" type="range" min="0" max="100" step="10" value="0">
<div class="slider_hint">
<span>0</span>
<span>50</span>
<span>100</span>
</div>
</div>
</div>
</div>
<div>
<span data-i18n="Avatar Style">Avatar Style:</span><br>
<label>

View File

@ -1173,16 +1173,6 @@ async function printMessages() {
const item = chat[i];
addOneMessage(item, { scroll: i === chat.length - 1 });
}
if (power_user.lazy_load > 0) {
const height = $('#chat').height();
const scrollHeight = $('#chat').prop('scrollHeight');
// Only hide if oveflowing the scroll
if (scrollHeight > height) {
$('#chat').children('.mes').slice(0, -power_user.lazy_load).hide();
}
}
}
function clearChat() {
@ -7016,17 +7006,6 @@ jQuery(async function () {
$("#groupCurrentMemberListToggle .inline-drawer-icon").trigger('click');
}, 200);
$('#chat').on('scroll', async () => {
// if on the start of the chat and has hidden messages
if ($('#chat').scrollTop() === 0 && $('#chat').children('.mes').not(':visible').length > 0) {
// show next hidden messages
const prevHeight = $('#chat').prop('scrollHeight');
$('#chat').children('.mes').not(':visible').slice(-power_user.lazy_load).show();
const newHeight = $('#chat').prop('scrollHeight');
$('#chat').scrollTop(newHeight - prevHeight);
}
});
$("#chat").on('mousewheel touchstart', () => {
scrollLock = true;
});

View File

@ -205,7 +205,6 @@ let power_user = {
custom_stopping_strings_macro: true,
fuzzy_search: false,
encode_tags: false,
lazy_load: 0,
servers: [],
};
@ -832,7 +831,6 @@ function loadPowerUserSettings(settings, data) {
$('#fuzzy_search_checkbox').prop("checked", power_user.fuzzy_search);
$('#persona_show_notifications').prop("checked", power_user.persona_show_notifications);
$('#encode_tags').prop("checked", power_user.encode_tags);
$('#lazy_load').val(Number(power_user.lazy_load));
$("#console_log_prompts").prop("checked", power_user.console_log_prompts);
$('#auto_fix_generated_markdown').prop("checked", power_user.auto_fix_generated_markdown);
@ -2239,11 +2237,6 @@ $(document).ready(() => {
saveSettingsDebounced();
});
$('#lazy_load').on('input', function () {
power_user.lazy_load = Number($(this).val());
saveSettingsDebounced();
});
$('#disable_group_trimming').on('input', function () {
power_user.disable_group_trimming = !!$(this).prop('checked');
saveSettingsDebounced();