diff --git a/apps/chat-e2e/src/tests/overlay/modelIdFeature.test.ts b/apps/chat-e2e/src/tests/overlay/modelIdFeature.test.ts index 6f080e03d..6f2378585 100644 --- a/apps/chat-e2e/src/tests/overlay/modelIdFeature.test.ts +++ b/apps/chat-e2e/src/tests/overlay/modelIdFeature.test.ts @@ -6,6 +6,7 @@ import { GeneratorUtil, ModelsUtil } from '@/src/utils'; import { expect } from '@playwright/test'; const expectedModelId = 'gpt-4'; +const fallbackModelId = 'gpt-35-turbo'; dialOverlayTest( `[Overlay] Defaults set in the code: modelID is used for new conversation.\n` + @@ -25,12 +26,22 @@ dialOverlayTest( overlayAgentInfoAssertion, talkToAgentDialogAssertion, setTestIds, + localStorageManager, }) => { setTestIds('EPMRTC-3781', 'EPMRTC-4693'); const randomAgentRequest = 'test'; - const randomModelId = GeneratorUtil.randomArrayElement( - ModelsUtil.getRecentModelIds().filter((m) => m !== expectedModelId), + const recentModelIds = ModelsUtil.getRecentModelIds().filter( + (m) => m !== expectedModelId, ); + if (!recentModelIds.length) { + // recentModelIds can be empty + await localStorageManager.setRecentModelsIds( + ModelsUtil.getModel(fallbackModelId)!, + ); + } + const randomModelId = recentModelIds.length + ? GeneratorUtil.randomArrayElement(recentModelIds) + : fallbackModelId; const randomModel = ModelsUtil.getOpenAIEntity(randomModelId)!; const expectedModel = ModelsUtil.getModel(expectedModelId)!; diff --git a/apps/chat/src/components/Chat/ChatSettings/AddonsDialog.tsx b/apps/chat/src/components/Chat/ChatSettings/AddonsDialog.tsx index b5bfc9139..da8355032 100644 --- a/apps/chat/src/components/Chat/ChatSettings/AddonsDialog.tsx +++ b/apps/chat/src/components/Chat/ChatSettings/AddonsDialog.tsx @@ -179,7 +179,7 @@ export const AddonsDialog: FC = ({ dataQa="addons-dialog" portalId="chat" onClose={onClose} - overlayClassName="fixed inset-0 top-[48px] !items-start" + overlayClassName="fixed inset-0 top-[48px]" state={isOpen ? ModalState.OPENED : ModalState.CLOSED} hideClose containerClassName="flex h-fit max-h-full h-[700px] w-full grow justify-between flex-col gap-4 divide-tertiary py-4 md:grow-0 xl:max-w-[720px] 2xl:max-w-[780px]" diff --git a/apps/chat/src/store/models/models.reducers.ts b/apps/chat/src/store/models/models.reducers.ts index fd0a74f3e..fa6ec63d6 100644 --- a/apps/chat/src/store/models/models.reducers.ts +++ b/apps/chat/src/store/models/models.reducers.ts @@ -144,7 +144,7 @@ export const modelsSlice = createSlice({ ({ id }) => id === payload.defaultModelId, ); - if (payload.localStorageRecentModelsIds?.length) { + if (payload.localStorageRecentModelsIds) { state.recentModelsIds = payload.localStorageRecentModelsIds; } else if (payload.defaultRecentModelsIds.length) { state.recentModelsIds = payload.defaultRecentModelsIds;