Skip to content

Commit afa6bfe

Browse files
authored
Pre-MCP UI and architecture cleanup (ggml-org#19685)
* webui: extract non-MCP changes from mcp-mvp review split * webui: extract additional pre-MCP UI and architecture cleanup * chore: update webui build output
1 parent ae2d3f2 commit afa6bfe

File tree

13 files changed

+108
-56
lines changed

13 files changed

+108
-56
lines changed

tools/server/public/index.html.gz

-22 Bytes
Binary file not shown.

tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentThumbnailFile.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { RemoveButton } from '$lib/components/app';
2+
import { ActionIconRemove } from '$lib/components/app';
33
import { formatFileSize, getFileTypeLabel, getPreviewText, isTextFile } from '$lib/utils';
44
import { AttachmentType } from '$lib/enums';
55
@@ -104,7 +104,7 @@
104104
onclick={onClick}
105105
>
106106
<div class="absolute top-2 right-2 opacity-0 transition-opacity group-hover:opacity-100">
107-
<RemoveButton {id} {onRemove} />
107+
<ActionIconRemove {id} {onRemove} />
108108
</div>
109109

110110
<div class="pr-8">
@@ -158,7 +158,7 @@
158158

159159
{#if !readonly}
160160
<div class="absolute top-2 right-2 opacity-0 transition-opacity group-hover:opacity-100">
161-
<RemoveButton {id} {onRemove} />
161+
<ActionIconRemove {id} {onRemove} />
162162
</div>
163163
{/if}
164164
</button>

tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentThumbnailImage.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { RemoveButton } from '$lib/components/app';
2+
import { ActionIconRemove } from '$lib/components/app';
33
44
interface Props {
55
id: string;
@@ -58,7 +58,7 @@
5858
<div
5959
class="absolute top-1 right-1 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100"
6060
>
61-
<RemoveButton {id} {onRemove} class="text-white" />
61+
<ActionIconRemove {id} {onRemove} class="text-white" />
6262
</div>
6363
{/if}
6464
</div>

tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormTextarea.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
interface Props {
66
class?: string;
77
disabled?: boolean;
8+
onInput?: () => void;
89
onKeydown?: (event: KeyboardEvent) => void;
910
onPaste?: (event: ClipboardEvent) => void;
1011
placeholder?: string;
@@ -14,6 +15,7 @@
1415
let {
1516
class: className = '',
1617
disabled = false,
18+
onInput,
1719
onKeydown,
1820
onPaste,
1921
placeholder = 'Ask anything...',
@@ -52,7 +54,10 @@
5254
class:cursor-not-allowed={disabled}
5355
{disabled}
5456
onkeydown={onKeydown}
55-
oninput={(event) => autoResizeTextarea(event.currentTarget)}
57+
oninput={(event) => {
58+
autoResizeTextarea(event.currentTarget);
59+
onInput?.();
60+
}}
5661
onpaste={onPaste}
5762
{placeholder}
5863
></textarea>

tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreenHeader.svelte

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@
1414
</script>
1515

1616
<header
17-
class="md:background-transparent pointer-events-none fixed top-0 right-0 left-0 z-50 flex items-center justify-end bg-background/40 p-4 backdrop-blur-xl duration-200 ease-linear {sidebar.open
17+
class="pointer-events-none fixed top-0 right-0 left-0 z-50 flex items-center justify-end p-4 duration-200 ease-linear {sidebar.open
1818
? 'md:left-[var(--sidebar-width)]'
1919
: ''}"
2020
>
2121
<div class="pointer-events-auto flex items-center space-x-2">
22-
<Button variant="ghost" size="sm" onclick={toggleSettings}>
22+
<Button
23+
variant="ghost"
24+
size="icon"
25+
onclick={toggleSettings}
26+
class="rounded-full backdrop-blur-lg"
27+
>
2328
<Settings class="h-4 w-4" />
2429
</Button>
2530
</div>

tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreenProcessingInfo.svelte

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
let isCurrentConversationLoading = $derived(isLoading());
1212
let isStreaming = $derived(isChatStreaming());
1313
let hasProcessingData = $derived(processingState.processingState !== null);
14-
let processingDetails = $derived(processingState.getProcessingDetails());
14+
let processingDetails = $derived(processingState.getTechnicalDetails());
1515
1616
let showProcessingInfo = $derived(
1717
isCurrentConversationLoading || isStreaming || config().keepStatsVisible || hasProcessingData
@@ -63,7 +63,7 @@
6363
<div class="chat-processing-info-container pointer-events-none" class:visible={showProcessingInfo}>
6464
<div class="chat-processing-info-content">
6565
{#each processingDetails as detail (detail)}
66-
<span class="chat-processing-info-detail pointer-events-auto">{detail}</span>
66+
<span class="chat-processing-info-detail pointer-events-auto backdrop-blur-sm">{detail}</span>
6767
{/each}
6868
</div>
6969
</div>
@@ -73,7 +73,7 @@
7373
position: sticky;
7474
top: 0;
7575
z-index: 10;
76-
padding: 1.5rem 1rem;
76+
padding: 0 1rem 0.75rem;
7777
opacity: 0;
7878
transform: translateY(50%);
7979
transition:
@@ -100,7 +100,6 @@
100100
color: var(--muted-foreground);
101101
font-size: 0.75rem;
102102
padding: 0.25rem 0.75rem;
103-
background: var(--muted);
104103
border-radius: 0.375rem;
105104
font-family:
106105
ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;

tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsImportExportTab.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<script lang="ts">
22
import { Download, Upload, Trash2 } from '@lucide/svelte';
33
import { Button } from '$lib/components/ui/button';
4-
import { DialogConversationSelection } from '$lib/components/app';
4+
import { DialogConversationSelection, DialogConfirmation } from '$lib/components/app';
55
import { createMessageCountMap } from '$lib/utils';
66
import { conversationsStore, conversations } from '$lib/stores/conversations.svelte';
77
import { toast } from 'svelte-sonner';
8-
import DialogConfirmation from '$lib/components/app/dialogs/DialogConfirmation.svelte';
98
109
let exportedConversations = $state<DatabaseConversation[]>([]);
1110
let importedConversations = $state<DatabaseConversation[]>([]);

tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebar.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Input from '$lib/components/ui/input/input.svelte';
1010
import { conversationsStore, conversations } from '$lib/stores/conversations.svelte';
1111
import { chatStore } from '$lib/stores/chat.svelte';
12-
import { getPreviewText } from '$lib/utils/text';
12+
import { getPreviewText } from '$lib/utils';
1313
import ChatSidebarActions from './ChatSidebarActions.svelte';
1414
1515
const sidebar = Sidebar.useSidebar();

tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebarConversationItem.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import { Trash2, Pencil, MoreHorizontal, Download, Loader2, Square } from '@lucide/svelte';
3-
import { ActionDropdown } from '$lib/components/app';
3+
import { DropdownMenuActions } from '$lib/components/app';
44
import * as Tooltip from '$lib/components/ui/tooltip';
55
import { getAllLoadingChats } from '$lib/stores/chat.svelte';
66
import { conversationsStore } from '$lib/stores/conversations.svelte';
@@ -128,7 +128,7 @@
128128

129129
{#if renderActionsDropdown}
130130
<div class="actions flex items-center">
131-
<ActionDropdown
131+
<DropdownMenuActions
132132
triggerIcon={MoreHorizontal}
133133
triggerTooltip="More actions"
134134
bind:open={dropdownOpen}

tools/server/webui/src/lib/components/app/content/MarkdownContent.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@
616616
code={incompleteCodeBlock.code}
617617
language={incompleteCodeBlock.language || 'text'}
618618
disabled={true}
619-
onPreview={(code: string, lang: string) => {
619+
onPreview={(code, lang) => {
620620
previewCode = code;
621621
previewLanguage = lang;
622622
previewDialogOpen = true;

0 commit comments

Comments
 (0)