diff --git a/ui/apps/chat/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte b/ui/apps/chat/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte index 987c5a350cac..d71a8da5d891 100644 --- a/ui/apps/chat/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte +++ b/ui/apps/chat/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte @@ -2,7 +2,6 @@ import { Button } from '@ggml-org/llama-ui/ui/button'; import { SkipForward, Square } from '@lucide/svelte'; import { - ChatFormActionReasoning, ChatFormActionRecord, ChatFormActionsAdd, ChatFormActionSubmit, @@ -149,12 +148,12 @@ {/if} {#if showModelSelector} - - + {/if} diff --git a/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelector.svelte b/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelector.svelte index 3b24b83a0472..7138a07f91cb 100644 --- a/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelector.svelte +++ b/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelector.svelte @@ -1,8 +1,11 @@ + +{#snippet header()} + {#if reasoning.isOff} + + {:else} + + {/if} + + Reasoning + + {current} +{/snippet} + +{#snippet levelLabel(level: ReasoningEffortLevel)} + {@const tokenLabel = reasoning.tokenLabel(level)} + + {#if reasoning.isSelected(level)} + + {:else} +
+ {/if} + + {level.label} + + {#if tokenLabel} + {tokenLabel} + {/if} +{/snippet} + +{#if variant === 'menu'} + + + +
+ {#each reasoning.levels as level (level.value)} + reasoning.select(level)}> + {@render levelLabel(level)} + + {/each} +
+
+
+{:else} +
+ +
+ {#each reasoning.levels as level (level.value)} + + {/each} +
+
+
+{/if} diff --git a/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorReasoningBadge.svelte b/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorReasoningBadge.svelte new file mode 100644 index 000000000000..fabc65c5425c --- /dev/null +++ b/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorReasoningBadge.svelte @@ -0,0 +1,34 @@ + + + +{#if reasoning.isOff} + + +{:else if reasoning.currentEffort !== ReasoningEffort.DEFAULT} + + + + Reasoning {REASONING_EFFORT_LABELS[reasoning.currentEffort]} + +{/if} diff --git a/ui/apps/chat/src/lib/components/app/navigation/DropdownMenuSearchable.svelte b/ui/apps/chat/src/lib/components/app/navigation/DropdownMenuSearchable.svelte index 4bfccbc91d7e..bc652d811dba 100644 --- a/ui/apps/chat/src/lib/components/app/navigation/DropdownMenuSearchable.svelte +++ b/ui/apps/chat/src/lib/components/app/navigation/DropdownMenuSearchable.svelte @@ -18,10 +18,18 @@ searchClass?: string; children: Snippet; /** - * Optional sticky footer: it sticks to the bottom of DropdownMenu.Content's own - * scrollport, which must stay the scroll container (overflow-y-auto + max-height). + * Optional footer. By default it sticks to the bottom of the parent's scrollport + * (overflow-y-auto + max-height), see `scrollport`. */ footer?: Snippet; + /** + * Scroll the header and the list in a box of their own, with the footer under it + * instead of sticking. For a parent that scales as it opens (a dropdown's zoom-in): + * WebKit pins a bottom-sticky element against the scaled box, so the footer would + * ride up the list until the animation ends. The parent is then a flex column that + * does not scroll itself (flex flex-col overflow-hidden + max-height). + */ + scrollport?: boolean; } let { @@ -34,6 +42,7 @@ onSearchChange, onSearchKeyDown, placeholder = 'Search...', + scrollport = false, searchClass = '', searchValue = $bindable('') }: Props = $props(); @@ -42,32 +51,42 @@ let stickyHeaderHeight = $state(0); -
- -
+{#snippet body()} +
+ +
+ +
+ +
+ {@render children()} -
- -
- {@render children()} + {#if isEmpty} +
{emptyMessage}
+ {/if} +
+
+{/snippet} - {#if isEmpty} -
{emptyMessage}
- {/if} +{#if scrollport} +
+ {@render body()}
-
+{:else} + {@render body()} +{/if} {#if footer} -
+