From 8d85f56e7727b29fa6f3648fd3e71dd9022c6965 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Wed, 22 Oct 2025 15:21:14 +0800 Subject: [PATCH] fix: update AI chat panel width range to use timelineMaxWidth --- .../ai-enhanced-timeline/AIEnhancedTimelineLayout.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/app-layout/ai-enhanced-timeline/AIEnhancedTimelineLayout.tsx b/apps/desktop/layer/renderer/src/modules/app-layout/ai-enhanced-timeline/AIEnhancedTimelineLayout.tsx index 1ec937ea0..7a692ee5b 100644 --- a/apps/desktop/layer/renderer/src/modules/app-layout/ai-enhanced-timeline/AIEnhancedTimelineLayout.tsx +++ b/apps/desktop/layer/renderer/src/modules/app-layout/ai-enhanced-timeline/AIEnhancedTimelineLayout.tsx @@ -104,7 +104,7 @@ const AIEnhancedTimelineLayoutImpl = () => { // AI chat resizable panel configuration const isAllView = view === FeedViewType.All - const widthRange: [number, number] = isAllView ? [500, 1200] : [300, 1200] + const widthRange: [number, number] = isAllView ? [500, timelineMaxWidth] : [300, timelineMaxWidth] const [minWidth, maxWidth] = widthRange const clampWidth = useCallback( @@ -120,8 +120,8 @@ const AIEnhancedTimelineLayoutImpl = () => { const resolvePreferredWidth = useCallback(() => { const ui = getUISettings() const halfScreen = getHalfScreenWidth() - return isAllView ? (ui.aiColWidthAll ?? halfScreen) : ui.aiColWidth - }, [getHalfScreenWidth, isAllView]) + return Math.min(isAllView ? (ui.aiColWidthAll ?? halfScreen) : ui.aiColWidth, timelineMaxWidth) + }, [getHalfScreenWidth, isAllView, timelineMaxWidth]) // Calculate initial width depending on view const initialAiWidth = useMemo(() => resolvePreferredWidth(), [resolvePreferredWidth])