Fix sizing of textareas in settings modal

This commit is contained in:
Webifi 2023-05-29 21:25:40 -05:00
parent 56eca2620e
commit c20c5da931
2 changed files with 17 additions and 12 deletions

View File

@ -96,6 +96,13 @@
<span class="menu-icon"><Fa icon={faClone}/></span> Clone Chat <span class="menu-icon"><Fa icon={faClone}/></span> Clone Chat
</a> </a>
<hr class="dropdown-divider"> <hr class="dropdown-divider">
<a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { if (chatId) restartChatSession() }}>
<span class="menu-icon"><Fa icon={faRotateRight}/></span> Restart Chat Session
</a>
<a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { if (chatId) close(); clearMessages(chatId) }}>
<span class="menu-icon"><Fa icon={faEraser}/></span> Clear Chat Messages
</a>
<hr class="dropdown-divider">
<a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { close(); exportChatAsJSON(chatId) }}> <a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { close(); exportChatAsJSON(chatId) }}>
<span class="menu-icon"><Fa icon={faDownload}/></span> Backup Chat JSON <span class="menu-icon"><Fa icon={faDownload}/></span> Backup Chat JSON
</a> </a>
@ -106,13 +113,6 @@
<span class="menu-icon"><Fa icon={faFileExport}/></span> Export Chat Markdown <span class="menu-icon"><Fa icon={faFileExport}/></span> Export Chat Markdown
</a> </a>
<hr class="dropdown-divider"> <hr class="dropdown-divider">
<a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { if (chatId) restartChatSession() }}>
<span class="menu-icon"><Fa icon={faRotateRight}/></span> Restart Chat Session
</a>
<a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { if (chatId) close(); clearMessages(chatId) }}>
<span class="menu-icon"><Fa icon={faEraser}/></span> Clear Chat Messages
</a>
<hr class="dropdown-divider">
<a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { if (chatId) close(); deleteChat() }}> <a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { if (chatId) close(); deleteChat() }}>
<span class="menu-icon"><Fa icon={faTrash}/></span> Delete Chat <span class="menu-icon"><Fa icon={faTrash}/></span> Delete Chat
</a> </a>

View File

@ -26,6 +26,7 @@
faUpload faUpload
} from '@fortawesome/free-solid-svg-icons/index' } from '@fortawesome/free-solid-svg-icons/index'
import { exportProfileAsJSON } from './Export.svelte' import { exportProfileAsJSON } from './Export.svelte'
import { afterUpdate } from 'svelte'
export let chatId:number export let chatId:number
export const show = () => { showSettings() } export const show = () => { showSettings() }
@ -44,6 +45,10 @@
$: chat = $chatsStorage.find((chat) => chat.id === chatId) as Chat $: chat = $chatsStorage.find((chat) => chat.id === chatId) as Chat
$: chatSettings = chat.settings $: chatSettings = chat.settings
$: globalStore = $globalStorage $: globalStore = $globalStorage
afterUpdate(() => {
sizeTextElements()
})
const closeSettings = () => { const closeSettings = () => {
showProfileMenu = false showProfileMenu = false
@ -164,7 +169,7 @@
// Refresh settings modal // Refresh settings modal
showSettingsModal++ showSettingsModal++
setTimeout(() => sizeTextElements, 100) setTimeout(() => sizeTextElements(), 0)
} }
const debounce = {} const debounce = {}
@ -260,6 +265,10 @@
<span class="menu-icon"><Fa icon={faClone}/></span> Clone Profile <span class="menu-icon"><Fa icon={faClone}/></span> Clone Profile
</a> </a>
<hr class="dropdown-divider"> <hr class="dropdown-divider">
<a href={'#'} class="dropdown-item" on:click|preventDefault={pinDefaultProfile}>
<span class="menu-icon"><Fa icon={faThumbtack}/></span> Set as Default Profile
</a>
<hr class="dropdown-divider">
<a href={'#'} <a href={'#'}
class="dropdown-item" class="dropdown-item"
on:click|preventDefault={() => { showProfileMenu = false; exportProfileAsJSON(chatId) }} on:click|preventDefault={() => { showProfileMenu = false; exportProfileAsJSON(chatId) }}
@ -270,10 +279,6 @@
<span class="menu-icon"><Fa icon={faUpload}/></span> Restore Profile JSON <span class="menu-icon"><Fa icon={faUpload}/></span> Restore Profile JSON
</a> </a>
<hr class="dropdown-divider"> <hr class="dropdown-divider">
<a href={'#'} class="dropdown-item" on:click|preventDefault={pinDefaultProfile}>
<span class="menu-icon"><Fa icon={faThumbtack}/></span> Set as Default Profile
</a>
<hr class="dropdown-divider">
<a href={'#'} class="dropdown-item" on:click|preventDefault={deleteProfile}> <a href={'#'} class="dropdown-item" on:click|preventDefault={deleteProfile}>
<span class="menu-icon"><Fa icon={faTrash}/></span> Delete Profile <span class="menu-icon"><Fa icon={faTrash}/></span> Delete Profile
</a> </a>