mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
#713 Random sorting order
This commit is contained in:
@@ -2926,6 +2926,7 @@
|
||||
<option data-field="date_last_chat" data-order="desc" data-i18n="Recent">Recent</option>
|
||||
<option data-field="chat_size" data-order="desc" data-i18n="Most chats">Most chats</option>
|
||||
<option data-field="chat_size" data-order="asc" data-i18n="Least chats">Least chats</option>
|
||||
<option data-field="name" data-order="random" data-i18n="Random">Random</option>
|
||||
</select>
|
||||
</form>
|
||||
<div class="rm_tag_controls">
|
||||
|
@@ -906,6 +906,10 @@ export function formatInstructModePrompt(name, isImpersonate, promptBias, name1,
|
||||
|
||||
const sortFunc = (a, b) => power_user.sort_order == 'asc' ? compareFunc(a, b) : compareFunc(b, a);
|
||||
const compareFunc = (first, second) => {
|
||||
if (power_user.sort_order == 'random') {
|
||||
return Math.random() > 0.5 ? 1 : -1;
|
||||
}
|
||||
|
||||
switch (power_user.sort_rule) {
|
||||
case 'boolean':
|
||||
const a = first[power_user.sort_field];
|
||||
|
@@ -1206,6 +1206,7 @@ body.charListGrid #rm_print_characters_block {
|
||||
flex-wrap: wrap;
|
||||
flex-direction: row;
|
||||
justify-content: space-around;
|
||||
align-content: flex-start;
|
||||
}
|
||||
|
||||
body.charListGrid #rm_print_characters_block .character_select {
|
||||
|
Reference in New Issue
Block a user