diff --git a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatForm.svelte b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatForm.svelte index 6c9a11849c..3e7e6d2821 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatForm.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatForm.svelte @@ -7,6 +7,7 @@ ChatFormHelperText, ChatFormTextarea } from '$lib/components/app'; + import { MAX_WIDTH_CLASSES, DEFAULT_MAX_WIDTH_CLASS } from '$lib/constants/width-classes'; import { INPUT_CLASSES } from '$lib/constants/input-classes'; import { config } from '$lib/stores/settings.svelte'; import { FileTypeCategory, MimeTypeApplication } from '$lib/enums/files'; @@ -62,6 +63,9 @@ let previousIsLoading = $state(isLoading); let recordingSupported = $state(false); let textareaRef: ChatFormTextarea | undefined = $state(undefined); + let maxWidthClass = $derived( + currentConfig.responsiveChatWidth ? MAX_WIDTH_CLASSES : DEFAULT_MAX_WIDTH_CLASS + ); function getAcceptStringForFileType(fileType: FileTypeCategory): string { switch (fileType) { @@ -230,7 +234,7 @@
+
{processingState.getProcessingMessage()} @@ -220,7 +225,7 @@
{:else if message.role === 'assistant'} {#if config().disableReasoningFormat} -
{messageContent || ''}
+
{messageContent || ''}
{:else} {/if} @@ -375,7 +380,6 @@ .raw-output { width: 100%; - max-width: 48rem; margin-top: 1.5rem; padding: 1rem 1.25rem; border-radius: 1rem; diff --git a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessages.svelte b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessages.svelte index 45efeeb436..0f3b6de45d 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessages.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessages.svelte @@ -9,7 +9,9 @@ editAssistantMessage, regenerateMessageWithBranching } from '$lib/stores/chat.svelte'; + import { config } from '$lib/stores/settings.svelte'; import { getMessageSiblings } from '$lib/utils/branching'; + import { MAX_WIDTH_CLASSES, DEFAULT_MAX_WIDTH_CLASS } from '$lib/constants/width-classes'; interface Props { class?: string; @@ -21,6 +23,10 @@ let allConversationMessages = $state([]); + let maxWidthClass = $derived( + config().responsiveChatWidth ? MAX_WIDTH_CLASSES : DEFAULT_MAX_WIDTH_CLASS + ); + function refreshAllMessages() { const conversation = activeConversation(); @@ -103,7 +109,7 @@
{#each displayMessages as { message, siblingInfo } (message.id)} { @@ -77,7 +81,7 @@
-
+
{#each processingDetails as detail (detail)} {detail} {/each} @@ -108,7 +112,6 @@ align-items: center; gap: 1rem; justify-content: center; - max-width: 48rem; margin: 0 auto; } diff --git a/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte b/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte index 0c754faa88..3ce9899c6c 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte @@ -14,6 +14,8 @@ ConfirmationDialog } from '$lib/components/app'; import * as AlertDialog from '$lib/components/ui/alert-dialog'; + import { config } from '$lib/stores/settings.svelte'; + import { MAX_WIDTH_CLASSES, DEFAULT_MAX_WIDTH_CLASS } from '$lib/constants/width-classes'; import { AUTO_SCROLL_AT_BOTTOM_THRESHOLD, AUTO_SCROLL_INTERVAL, @@ -85,6 +87,10 @@ let isCurrentConversationLoading = $derived(isLoading()); + let maxWidthClass = $derived( + config().responsiveChatWidth ? MAX_WIDTH_CLASSES : DEFAULT_MAX_WIDTH_CLASS + ); + async function handleDeleteConfirm() { const conversation = activeConversation(); if (conversation) { @@ -302,7 +308,7 @@ {#if serverWarning()} - + {/if}
@@ -333,7 +339,7 @@ ondrop={handleDrop} role="main" > -
+

llama.cpp

diff --git a/tools/server/webui/src/lib/constants/width-classes.ts b/tools/server/webui/src/lib/constants/width-classes.ts new file mode 100644 index 0000000000..966b0ee894 --- /dev/null +++ b/tools/server/webui/src/lib/constants/width-classes.ts @@ -0,0 +1,4 @@ +export const MAX_WIDTH_CLASSES = + 'max-w-[48rem] md:max-w-[60rem] min-[1920px]:max-w-[80rem] min-[2560px]:max-w-[120rem]'; + +export const DEFAULT_MAX_WIDTH_CLASS = 'max-w-[48rem]';