Re-evaluate world info entry - simplified priority sort order Changed priority primarySort ternary to check disabled first, then constant, then normal.

efb63c7f24d1d1dd456b9d39c5340dcf67131de6

Khreed <135299775+KhreedAI@users.noreply.github.com>

1 files changed, +4 -27Showing whitespace changes
public/scripts/world-info.js+4 -27
@@ -1678,34 +1678,11 @@ export function sortWorldInfoEntries(data, { customSort = null } = {}) {
16781678 return aValue - bValue;
16791679 };
16801680 } else if (sortRule === 'priority') {
16811681 // First constant, then normal, then disabled, then by comment.
16821682 primarySort = (a, b) => {
1683- // Determine priority based on disable and constant flags
1683+ const aValue = a.disable ? 2 : a.constant ? 0 : 1;
16841684 const aPrioritybValue = ab.disable ? 2 : ab.constant ? 0 : 1;
1685- const bPriority = b.disable ? 2 : b.constant ? 0 : 1;
1685+ return aValue - bValue;
1686-
1687- // Compare priorities first
1688- if (aPriority !== bPriority) {
1689- return aPriority - bPriority;
1690- }
1691-
1692- // Normalize comments for comparison, handling null/undefined
1693- const commentA = a.comment ? a.comment.toLowerCase() : '';
1694- const commentB = b.comment ? b.comment.toLowerCase() : '';
1695-
1696- // Assign constant values for further comparison
1697- const constantA = a.constant ? 0 : 1;
1698- const constantB = b.constant ? 0 : 1;
1699-
1700- // If priorities are equal, compare constants
1701- if (aPriority === bPriority) {
1702- if (constantA !== constantB) {
1703- return constantA - constantB;
1704- }
1705- }
1706-
1707- // Finally, compare comments alphabetically
1708- return commentA.localeCompare(commentB);
17091686 };
17101687 } else {
17111688 primarySort = (a, b) => {