Skip to content

Commit 4ff829e

Browse files
benbenbenbenbenbenBen BabikServeurpersoCom
authored
ui: fix removed reasoning menu in single model mode on desktop (ggml-org#27985)
* ui: fix accidentally removed reasoning menu in single model mode on desktop * ui: formatting task run to fix storybook test * ui: mount the add menu reasoning submenu outside router mode only The models selector already owns the reasoning submenu in router mode, so the add menu only mounts it in single model mode. The first enabled item of the add menu is now the reasoning submenu, the accessibility story expects it. --------- Co-authored-by: Ben Babik <work@benjaminbabik.com> Co-authored-by: Pascal <admin@serveurperso.com>
1 parent f172be7 commit 4ff829e

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

tools/ui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionAdd/ChatFormActionAddDropdown.svelte

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<script lang="ts">
22
import { File, Image, MessageSquare, Mic, Plus, Video } from '@lucide/svelte';
3-
import { ChatFormActionAddToolsSubmenu, McpLogo } from '$lib/components/app';
3+
import {
4+
ChatFormActionAddReasoningSubmenu,
5+
ChatFormActionAddToolsSubmenu,
6+
McpLogo
7+
} from '$lib/components/app';
48
import { buttonVariants } from '$lib/components/ui/button';
59
import * as DropdownMenu from '$lib/components/ui/dropdown-menu';
610
import * as Tooltip from '$lib/components/ui/tooltip';
@@ -13,6 +17,7 @@
1317
import { getChatFormActionsContext } from '$lib/contexts';
1418
import { AttachmentAction, AttachmentItemEnabledWhen } from '$lib/enums';
1519
import { useAttachmentMenu } from '$lib/hooks/use-attachment-menu.svelte';
20+
import { serverStore } from '$lib/stores';
1621
1722
interface Props {
1823
class?: string;
@@ -92,6 +97,13 @@
9297
}
9398
}}
9499
>
100+
<!-- in router mode the models selector owns the reasoning submenu -->
101+
{#if !serverStore.isRouterMode}
102+
<ChatFormActionAddReasoningSubmenu />
103+
104+
<DropdownMenu.Separator />
105+
{/if}
106+
95107
<DropdownMenu.Item
96108
class="flex cursor-pointer items-center gap-2"
97109
onclick={() => attachmentMenu.callbacks[AttachmentAction.FILE_UPLOAD]()}

tools/ui/tests/stories/a11y/ChatScreenForm.a11y.stories.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
await screen.findByRole('menu');
4646

4747
await waitFor(() => {
48-
expect(document.activeElement).toHaveTextContent('Add files');
48+
expect(document.activeElement).toHaveTextContent('Reasoning');
4949
});
5050
}}
5151
/>

0 commit comments

Comments
 (0)