Skip to content

Commit c48c9aa

Browse files
committed
feat(mobile): disable multi-model chat on mobile
Side-by-side multi-model comparison is unusable at phone widths. Gate it off in ModelSelector (multiModelAllowed = false when isMobile), so a second model can't be added on mobile regardless of the workspace setting.
1 parent 5f68896 commit c48c9aa

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

web/src/refresh-components/popovers/ModelSelector.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { getModelIcon } from "@/lib/languageModels";
66
import { Button, SelectButton, Popover, Divider } from "@opal/components";
77
import { SvgPlusCircle, SvgX } from "@opal/icons";
88
import { useSettingsContext } from "@/providers/SettingsProvider";
9+
import useScreenSize from "@/hooks/useScreenSize";
910
import { LLMOption } from "@/refresh-components/popovers/interfaces";
1011
import ModelListContent from "@/refresh-components/popovers/ModelListContent";
1112

@@ -44,8 +45,11 @@ export default function ModelSelector({
4445
const anchorRef = useRef<HTMLElement | null>(null);
4546

4647
const settings = useSettingsContext();
48+
const { isMobile } = useScreenSize();
49+
// Multi-model (side-by-side) comparison is a poor fit for phone widths, so it's
50+
// disabled on mobile regardless of the workspace setting.
4751
const multiModelAllowed =
48-
settings?.settings?.multi_model_chat_enabled ?? true;
52+
!isMobile && (settings?.settings?.multi_model_chat_enabled ?? true);
4953

5054
const isMultiModel = selectedModels.length > 1;
5155
const atMax = selectedModels.length >= MAX_MODELS || !multiModelAllowed;

0 commit comments

Comments
 (0)