diff --git a/src/lib/components/admin/Settings/Models.svelte b/src/lib/components/admin/Settings/Models.svelte index b7084d8ce..920d280f5 100644 --- a/src/lib/components/admin/Settings/Models.svelte +++ b/src/lib/components/admin/Settings/Models.svelte @@ -38,9 +38,16 @@ let showResetModal = false; $: if (models) { - filteredModels = models.filter( - (m) => searchValue === '' || m.name.toLowerCase().includes(searchValue.toLowerCase()) - ); + filteredModels = models + .filter((m) => searchValue === '' || m.name.toLowerCase().includes(searchValue.toLowerCase())) + .sort((a, b) => { + // Check if either model is inactive and push them to the bottom + if ((a.is_active ?? true) !== (b.is_active ?? true)) { + return (b.is_active ?? true) - (a.is_active ?? true); + } + // If both models' active states are the same, sort alphabetically + return a.name.localeCompare(b.name); + }); } let searchValue = ''; diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 042159bb4..16e3cdb91 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -688,6 +688,7 @@ ) ) { // Prevent Enter key from creating a new line + // Uses keyCode '13' for Enter key for chinese/japanese keyboards if (e.keyCode === 13 && !e.shiftKey) { e.preventDefault(); }