From 1422d94faced3d81113b0511af324c72fa77979c Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Mon, 7 Jul 2025 11:14:43 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9Bfix:=20make=20three=20dots=20defaul?= =?UTF-8?q?t=20show=203=20dots=20and=20can=20trigger=20with=20right=20clic?= =?UTF-8?q?k=20=20(#5712)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐛fix: default show 3 dots * ✨enhancement: enable resizable left panel (#5713) * ✨enhancement: enable resizable left panel * Update web-app/src/hooks/useLeftPanel.ts Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- web-app/package.json | 1 + web-app/src/components/ui/resizable.tsx | 54 +++++++++++ web-app/src/containers/DownloadManegement.tsx | 31 +++++-- web-app/src/containers/LeftPanel.tsx | 27 +++++- web-app/src/containers/ThreadList.tsx | 9 +- web-app/src/hooks/useLeftPanel.ts | 4 + web-app/src/routes/__root.tsx | 93 ++++++++++++++++--- 7 files changed, 191 insertions(+), 28 deletions(-) create mode 100644 web-app/src/components/ui/resizable.tsx diff --git a/web-app/package.json b/web-app/package.json index 4874b310c..b56f09a0d 100644 --- a/web-app/package.json +++ b/web-app/package.json @@ -56,6 +56,7 @@ "react-i18next": "^15.5.1", "react-joyride": "^2.9.3", "react-markdown": "^10.1.0", + "react-resizable-panels": "^3.0.3", "react-syntax-highlighter": "^15.6.1", "react-syntax-highlighter-virtualized-renderer": "^1.1.0", "react-textarea-autosize": "^8.5.9", diff --git a/web-app/src/components/ui/resizable.tsx b/web-app/src/components/ui/resizable.tsx new file mode 100644 index 000000000..a3d586cf1 --- /dev/null +++ b/web-app/src/components/ui/resizable.tsx @@ -0,0 +1,54 @@ +import * as React from 'react' +import { GripVerticalIcon } from 'lucide-react' +import * as ResizablePrimitive from 'react-resizable-panels' + +import { cn } from '@/lib/utils' + +function ResizablePanelGroup({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function ResizablePanel({ + ...props +}: React.ComponentProps) { + return +} + +function ResizableHandle({ + withHandle, + className, + ...props +}: React.ComponentProps & { + withHandle?: boolean +}) { + return ( + div]:rotate-90', + className + )} + {...props} + > + {withHandle && ( +
+ +
+ )} +
+ ) +} + +export { ResizablePanelGroup, ResizablePanel, ResizableHandle } diff --git a/web-app/src/containers/DownloadManegement.tsx b/web-app/src/containers/DownloadManegement.tsx index 4659f668d..be9e9e0e9 100644 --- a/web-app/src/containers/DownloadManegement.tsx +++ b/web-app/src/containers/DownloadManegement.tsx @@ -182,7 +182,9 @@ export function DownloadManagement() { getProviders().then(setProviders) toast.success(t('common:toast.downloadComplete.title'), { id: 'download-complete', - description: t('common:toast.downloadComplete.description', { modelId: state.modelId }), + description: t('common:toast.downloadComplete.description', { + modelId: state.modelId, + }), }) }, [removeDownload, removeLocalDownloadingModel, setProviders, t] @@ -237,10 +239,14 @@ export function DownloadManagement() { {isLeftPanelOpen ? (
-
- {downloadCount} +
+ {t('downloads')} + +
+ {downloadCount} +
+
-

{t('downloads')}

@@ -272,7 +278,9 @@ export function DownloadManagement() { >
-

{t('downloading')}

+

+ {t('downloading')} +

{appUpdateState.isDownloading && ( @@ -309,10 +317,15 @@ export function DownloadManagement() { title="Cancel download" onClick={() => { abortDownload(download.name).then(() => { - toast.info(t('common:toast.downloadCancelled.title'), { - id: 'cancel-download', - description: t('common:toast.downloadCancelled.description'), - }) + toast.info( + t('common:toast.downloadCancelled.title'), + { + id: 'cancel-download', + description: t( + 'common:toast.downloadCancelled.description' + ), + } + ) if (downloadProcesses.length === 0) { setIsPopoverOpen(false) } diff --git a/web-app/src/containers/LeftPanel.tsx b/web-app/src/containers/LeftPanel.tsx index 748cb529f..fe07a71e5 100644 --- a/web-app/src/containers/LeftPanel.tsx +++ b/web-app/src/containers/LeftPanel.tsx @@ -79,6 +79,9 @@ const LeftPanel = () => { const searchContainerRef = useRef(null) const searchContainerMacRef = useRef(null) + // Determine if we're in a resizable context (large screen with panel open) + const isResizableContext = !isSmallScreen && open + // Use click outside hook for panel with debugging useClickOutside( () => { @@ -189,9 +192,17 @@ const LeftPanel = () => {