fix(chat): keep toolbar background draggable (#1035)
This commit is contained in:
@@ -730,16 +730,19 @@ export function Chat() {
|
||||
{/* Left column: chat */}
|
||||
<div className="flex min-w-0 flex-1 flex-col">
|
||||
{/* Toolbar */}
|
||||
<div className="no-drag relative z-20 flex shrink-0 items-center justify-end px-4 py-2">
|
||||
<ChatToolbar
|
||||
questionDirectoryOpen={questionDirectoryVisible}
|
||||
questionDirectoryCount={questionDirectoryItems.length}
|
||||
onToggleQuestionDirectory={() =>
|
||||
setQuestionDirectoryOpenSessionKey((openSessionKey) =>
|
||||
openSessionKey === currentSessionKey ? null : currentSessionKey,
|
||||
)
|
||||
}
|
||||
/>
|
||||
<div className="relative flex shrink-0 items-center justify-end px-4 py-2">
|
||||
<div data-testid="chat-toolbar-drag-region" className="drag-region absolute inset-0 z-0" aria-hidden="true" />
|
||||
<div data-testid="chat-toolbar-actions" className="no-drag relative z-10">
|
||||
<ChatToolbar
|
||||
questionDirectoryOpen={questionDirectoryVisible}
|
||||
questionDirectoryCount={questionDirectoryItems.length}
|
||||
onToggleQuestionDirectory={() =>
|
||||
setQuestionDirectoryOpenSessionKey((openSessionKey) =>
|
||||
openSessionKey === currentSessionKey ? null : currentSessionKey,
|
||||
)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Messages Area */}
|
||||
|
||||
@@ -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(<Chat />);
|
||||
|
||||
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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user