From c19dfddd0ff6e6ca9238d567cf95cee894c38e4a Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Thu, 11 Apr 2024 02:12:48 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20fix:=20Minor=20Fixes=20and=20Ref?= =?UTF-8?q?actors=20(#2388)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(useTextarea): set Textarea disabled message due to key higher in priority * fix(SidePanel): intended behavior for non-user provided keys * fix: generate specs * style: update combobox styling as before, with better dynamic height * chore: remove unused import --- client/src/common/types.ts | 1 + client/src/components/SidePanel/SidePanel.tsx | 8 +- client/src/components/SidePanel/Switcher.tsx | 12 +- client/src/components/ui/Combobox.tsx | 111 +++++++++--------- client/src/hooks/Input/useTextarea.ts | 6 +- packages/data-provider/specs/generate.spec.ts | 73 +++++++++++- 6 files changed, 136 insertions(+), 75 deletions(-) diff --git a/client/src/common/types.ts b/client/src/common/types.ts index 406812693b..a5a8a01c11 100644 --- a/client/src/common/types.ts +++ b/client/src/common/types.ts @@ -335,6 +335,7 @@ export interface ExtendedFile { export type ContextType = { navVisible: boolean; setNavVisible: (visible: boolean) => void }; export interface SwitcherProps { + endpoint?: EModelEndpoint | null; endpointKeyProvided: boolean; isCollapsed: boolean; } diff --git a/client/src/components/SidePanel/SidePanel.tsx b/client/src/components/SidePanel/SidePanel.tsx index 01874638a3..1f7f07da99 100644 --- a/client/src/components/SidePanel/SidePanel.tsx +++ b/client/src/components/SidePanel/SidePanel.tsx @@ -38,10 +38,10 @@ const SidePanel = ({ const [fullCollapse, setFullCollapse] = useState(fullPanelCollapse); const [collapsedSize, setCollapsedSize] = useState(navCollapsedSize); const { data: endpointsConfig = {} as TEndpointsConfig } = useGetEndpointsQuery(); - const { data: keyExpiry = { expiresAt: undefined } } = useUserKeyQuery(EModelEndpoint.assistants); const isSmallScreen = useMediaQuery('(max-width: 767px)'); const { conversation } = useChatContext(); const { endpoint } = conversation ?? {}; + const { data: keyExpiry = { expiresAt: undefined } } = useUserKeyQuery(endpoint ?? ''); const panelRef = useRef(null); @@ -187,7 +187,11 @@ const SidePanel = ({ isCollapsed ? 'h-[52px]' : 'px-2', )} > - +