File tree Expand file tree Collapse file tree 6 files changed +36
-9
lines changed
tools/server/webui/src/lib Expand file tree Collapse file tree 6 files changed +36
-9
lines changed Original file line number Diff line number Diff line change 77 ChatFormHelperText ,
88 ChatFormTextarea
99 } from ' $lib/components/app' ;
10+ import { MAX_WIDTH_CLASSES , DEFAULT_MAX_WIDTH_CLASS } from ' $lib/constants/width-classes' ;
1011 import { INPUT_CLASSES } from ' $lib/constants/input-classes' ;
1112 import { config } from ' $lib/stores/settings.svelte' ;
1213 import { FileTypeCategory , MimeTypeApplication } from ' $lib/enums/files' ;
6263 let previousIsLoading = $state (isLoading );
6364 let recordingSupported = $state (false );
6465 let textareaRef: ChatFormTextarea | undefined = $state (undefined );
66+ let maxWidthClass = $derived (
67+ currentConfig .responsiveChatWidth ? MAX_WIDTH_CLASSES : DEFAULT_MAX_WIDTH_CLASS
68+ );
6569
6670 function getAcceptStringForFileType(fileType : FileTypeCategory ): string {
6771 switch (fileType ) {
230234
231235<form
232236 onsubmit ={handleSubmit }
233- class =" {INPUT_CLASSES } border-radius-bottom-none mx-auto max-w-[48rem] overflow-hidden rounded-3xl backdrop-blur-md {className }"
237+ class =" {INPUT_CLASSES } border-radius-bottom-none mx-auto { maxWidthClass } overflow-hidden rounded-3xl backdrop-blur-md {className }"
234238>
235239 <ChatAttachmentsList
236240 bind:uploadedFiles
Original file line number Diff line number Diff line change 2323 import { modelName as serverModelName } from ' $lib/stores/server.svelte' ;
2424 import { copyToClipboard } from ' $lib/utils/copy' ;
2525 import type { ApiChatCompletionToolCall } from ' $lib/types/api' ;
26+ import { MAX_WIDTH_CLASSES , DEFAULT_MAX_WIDTH_CLASS } from ' $lib/constants/width-classes' ;
2627
2728 interface Props {
2829 class? : string ;
100101
101102 return serverModel ;
102103 });
104+
105+ let maxWidthClass = $derived (
106+ config ().responsiveChatWidth ? MAX_WIDTH_CLASSES : DEFAULT_MAX_WIDTH_CLASS
107+ );
103108
104109 function handleCopyModel() {
105110 const model = displayedModel ();
174179 {/if }
175180
176181 {#if message ?.role === ' assistant' && isLoading () && ! message ?.content ?.trim ()}
177- <div class =" mt-6 w-full max-w-[48rem] " in:fade >
182+ <div class ="mt-6 w-full { maxWidthClass } " in:fade >
178183 <div class =" processing-container" >
179184 <span class =" processing-text" >
180185 {processingState .getProcessingMessage ()}
220225 </div >
221226 {:else if message .role === ' assistant' }
222227 {#if config ().disableReasoningFormat }
223- <pre class ="raw-output" >{messageContent || ' ' }</pre >
228+ <pre class ="raw-output { maxWidthClass } " >{messageContent || ' ' }</pre >
224229 {:else }
225230 <MarkdownContent content ={messageContent || ' ' } />
226231 {/if }
375380
376381 .raw-output {
377382 width : 100% ;
378- max-width : 48rem ;
379383 margin-top : 1.5rem ;
380384 padding : 1rem 1.25rem ;
381385 border-radius : 1rem ;
Original file line number Diff line number Diff line change 99 editAssistantMessage ,
1010 regenerateMessageWithBranching
1111 } from ' $lib/stores/chat.svelte' ;
12+ import { config } from ' $lib/stores/settings.svelte' ;
1213 import { getMessageSiblings } from ' $lib/utils/branching' ;
14+ import { MAX_WIDTH_CLASSES , DEFAULT_MAX_WIDTH_CLASS } from ' $lib/constants/width-classes' ;
1315
1416 interface Props {
1517 class? : string ;
2123
2224 let allConversationMessages = $state <DatabaseMessage []>([]);
2325
26+ let maxWidthClass = $derived (
27+ config ().responsiveChatWidth ? MAX_WIDTH_CLASSES : DEFAULT_MAX_WIDTH_CLASS
28+ );
29+
2430 function refreshAllMessages() {
2531 const conversation = activeConversation ();
2632
103109<div class ="flex h-full flex-col space-y-10 pt-16 md:pt-24 {className }" style =" height: auto; " >
104110 {#each displayMessages as { message, siblingInfo } (message .id )}
105111 <ChatMessage
106- class =" mx-auto w-full max-w-[48rem] "
112+ class ="mx-auto w-full { maxWidthClass } "
107113 {message }
108114 {siblingInfo }
109115 onDelete ={handleDeleteMessage }
Original file line number Diff line number Diff line change 44 import { slotsService } from ' $lib/services/slots' ;
55 import { isLoading , activeMessages , activeConversation } from ' $lib/stores/chat.svelte' ;
66 import { config } from ' $lib/stores/settings.svelte' ;
7+ import { MAX_WIDTH_CLASSES , DEFAULT_MAX_WIDTH_CLASS } from ' $lib/constants/width-classes' ;
78
89 const processingState = useProcessingState ();
910
1011 let isCurrentConversationLoading = $derived (isLoading ());
1112 let processingDetails = $derived (processingState .getProcessingDetails ());
1213 let showSlotsInfo = $derived (isCurrentConversationLoading || config ().keepStatsVisible );
14+ let maxWidthClass = $derived (
15+ config ().responsiveChatWidth ? MAX_WIDTH_CLASSES : DEFAULT_MAX_WIDTH_CLASS
16+ );
1317
1418 // Track loading state reactively by checking if conversation ID is in loading conversations array
1519 $effect (() => {
7781 </script >
7882
7983<div class ="chat-processing-info-container pointer-events-none" class:visible ={showSlotsInfo }>
80- <div class =" chat-processing-info-content" >
84+ <div class ="chat-processing-info-content { maxWidthClass } " >
8185 {#each processingDetails as detail (detail )}
8286 <span class ="chat-processing-info-detail pointer-events-auto" >{detail }</span >
8387 {/each }
108112 align-items : center ;
109113 gap : 1rem ;
110114 justify-content : center ;
111- max-width : 48rem ;
112115 margin : 0 auto ;
113116 }
114117
Original file line number Diff line number Diff line change 1414 ConfirmationDialog
1515 } from ' $lib/components/app' ;
1616 import * as AlertDialog from ' $lib/components/ui/alert-dialog' ;
17+ import { config } from ' $lib/stores/settings.svelte' ;
18+ import { MAX_WIDTH_CLASSES , DEFAULT_MAX_WIDTH_CLASS } from ' $lib/constants/width-classes' ;
1719 import {
1820 AUTO_SCROLL_AT_BOTTOM_THRESHOLD ,
1921 AUTO_SCROLL_INTERVAL ,
8587
8688 let isCurrentConversationLoading = $derived (isLoading ());
8789
90+ let maxWidthClass = $derived (
91+ config ().responsiveChatWidth ? MAX_WIDTH_CLASSES : DEFAULT_MAX_WIDTH_CLASS
92+ );
93+
8894 async function handleDeleteConfirm() {
8995 const conversation = activeConversation ();
9096 if (conversation ) {
302308 <ChatProcessingInfo />
303309
304310 {#if serverWarning ()}
305- <ChatScreenWarning class =" pointer-events-auto mx-auto max-w-[48rem] px-4" />
311+ <ChatScreenWarning class ="pointer-events-auto mx-auto { maxWidthClass } px-4" />
306312 {/if }
307313
308314 <div class =" conversation-chat-form pointer-events-auto rounded-t-3xl pb-4" >
333339 ondrop ={handleDrop }
334340 role =" main"
335341 >
336- <div class =" w-full max-w-[48rem] px-4" >
342+ <div class ="w-full { maxWidthClass } px-4" >
337343 <div class ="mb-8 text-center" in:fade ={{ duration : 300 }}>
338344 <h1 class =" mb-2 text-3xl font-semibold tracking-tight" >llama.cpp</h1 >
339345
Original file line number Diff line number Diff line change 1+ export const MAX_WIDTH_CLASSES =
2+ 'max-w-[48rem] md:max-w-[60rem] min-[1920px]:max-w-[80rem] min-[2560px]:max-w-[120rem]' ;
3+
4+ export const DEFAULT_MAX_WIDTH_CLASS = 'max-w-[48rem]' ;
You can’t perform that action at this time.
0 commit comments