ui: fix removed reasoning menu in single model mode on desktop (#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>
This commit is contained in:
authored and GitHub committed 2026-09-17 11:18:13 +02:00
1 parent f172be756a
commit 4ff829ec2e
2 files changed
+14 -2

No files matched your search

@@ -1,6 +1,10 @@
<script lang="ts">
import { File, Image, MessageSquare, Mic, Plus, Video } from '@lucide/svelte';
import { ChatFormActionAddToolsSubmenu, McpLogo } from '$lib/components/app';
import {
ChatFormActionAddReasoningSubmenu,
ChatFormActionAddToolsSubmenu,
McpLogo
} from '$lib/components/app';
import { buttonVariants } from '$lib/components/ui/button';
import * as DropdownMenu from '$lib/components/ui/dropdown-menu';
import * as Tooltip from '$lib/components/ui/tooltip';
@@ -13,6 +17,7 @@
import { getChatFormActionsContext } from '$lib/contexts';
import { AttachmentAction, AttachmentItemEnabledWhen } from '$lib/enums';
import { useAttachmentMenu } from '$lib/hooks/use-attachment-menu.svelte';
import { serverStore } from '$lib/stores';
interface Props {
class?: string;
@@ -92,6 +97,13 @@
}
}}
>
<!-- in router mode the models selector owns the reasoning submenu -->
{#if !serverStore.isRouterMode}
<ChatFormActionAddReasoningSubmenu />
<DropdownMenu.Separator />
{/if}
<DropdownMenu.Item
class="flex cursor-pointer items-center gap-2"
onclick={() => attachmentMenu.callbacks[AttachmentAction.FILE_UPLOAD]()}
@@ -45,7 +45,7 @@
await screen.findByRole('menu');
await waitFor(() => {
expect(document.activeElement).toHaveTextContent('Add files');
expect(document.activeElement).toHaveTextContent('Reasoning');
});
}}
/>