From 4136b04c42adc6782df037725c6263abcef6f9ac Mon Sep 17 00:00:00 2001
From: paisley <8197966+su8su@users.noreply.github.com>
Date: Mon, 18 May 2026 17:54:38 +0800
Subject: [PATCH] fix(chat): keep toolbar background draggable (#1035)
---
src/pages/Chat/index.tsx | 23 +++++++++++--------
.../unit/chat-artifact-panel-layout.test.tsx | 14 +++++++++++
2 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/src/pages/Chat/index.tsx b/src/pages/Chat/index.tsx
index ea635c4..3d2ab34 100644
--- a/src/pages/Chat/index.tsx
+++ b/src/pages/Chat/index.tsx
@@ -730,16 +730,19 @@ export function Chat() {
{/* Left column: chat */}
{/* Toolbar */}
-
-
- setQuestionDirectoryOpenSessionKey((openSessionKey) =>
- openSessionKey === currentSessionKey ? null : currentSessionKey,
- )
- }
- />
+
+
+
+
+ setQuestionDirectoryOpenSessionKey((openSessionKey) =>
+ openSessionKey === currentSessionKey ? null : currentSessionKey,
+ )
+ }
+ />
+
{/* Messages Area */}
diff --git a/tests/unit/chat-artifact-panel-layout.test.tsx b/tests/unit/chat-artifact-panel-layout.test.tsx
index 34083a3..2115f3c 100644
--- a/tests/unit/chat-artifact-panel-layout.test.tsx
+++ b/tests/unit/chat-artifact-panel-layout.test.tsx
@@ -72,6 +72,8 @@ vi.mock('@/hooks/use-stick-to-bottom-instant', () => ({
useStickToBottomInstant: () => ({
contentRef: { current: null },
scrollRef: { current: null },
+ scrollToBottom: vi.fn(),
+ isAtBottom: true,
}),
}));
@@ -88,6 +90,18 @@ vi.mock('@/pages/Chat/ChatToolbar', () => ({
}));
describe('Chat artifact panel layout', () => {
+ it('keeps the chat toolbar background draggable while actions remain clickable', async () => {
+ window.electron.platform = 'darwin';
+
+ render();
+
+ const dragRegion = await screen.findByTestId('chat-toolbar-drag-region');
+ const actions = await screen.findByTestId('chat-toolbar-actions');
+
+ expect(dragRegion).toHaveClass('drag-region');
+ expect(actions).toHaveClass('no-drag');
+ });
+
it('layers the right artifact panel above the macOS drag strip', async () => {
window.electron.platform = 'darwin';