fix(pipelines): move chat reset action to footer

This commit is contained in:
RockChinQ
2026-08-26 00:20:16 +08:00
parent 0c5656d0d0
commit a936734efa
2 changed files with 30 additions and 13 deletions
@@ -879,16 +879,6 @@ export default function DebugDialog({
<Users className="size-4" /> <Users className="size-4" />
{t('pipelines.debugDialog.groupChat')} {t('pipelines.debugDialog.groupChat')}
</Button> </Button>
<Button
type="button"
variant="ghost"
size="sm"
className="ml-auto text-muted-foreground"
onClick={() => void resetConversation()}
>
<RotateCcw className="size-4" />
{t('pipelines.debugDialog.reset')}
</Button>
</div> </div>
<div className="flex-1 flex flex-col w-full h-full min-h-0"> <div className="flex-1 flex flex-col w-full h-full min-h-0">
@@ -1088,6 +1078,16 @@ export default function DebugDialog({
> >
<ImageIcon className="size-5" /> <ImageIcon className="size-5" />
</Button> </Button>
<Button
type="button"
variant="ghost"
size="sm"
className="ml-auto text-muted-foreground"
onClick={() => void resetConversation()}
>
<RotateCcw className="size-4" />
{t('pipelines.debugDialog.reset')}
</Button>
</div> </div>
<div className="flex min-w-0 items-end gap-2"> <div className="flex min-w-0 items-end gap-2">
@@ -272,8 +272,12 @@ test.describe('processor detail workbench', () => {
const composer = debugPanel.locator('[data-debug-composer="true"]'); const composer = debugPanel.locator('[data-debug-composer="true"]');
const messageInput = composer.locator('textarea'); const messageInput = composer.locator('textarea');
const sendButton = composer.getByRole('button', { name: 'Send' }); const sendButton = composer.getByRole('button', { name: 'Send' });
const resetButton = composer.getByRole('button', {
name: 'Reset Conversation',
});
await expect(messageInput).toBeVisible(); await expect(messageInput).toBeVisible();
await expect(messageInput).toHaveAttribute('rows', '1'); await expect(messageInput).toHaveAttribute('rows', '1');
await expect(resetButton).toBeVisible();
const inputBox = await messageInput.boundingBox(); const inputBox = await messageInput.boundingBox();
const sendBox = await sendButton.boundingBox(); const sendBox = await sendButton.boundingBox();
const toolbarBox = await sessionToolbar.boundingBox(); const toolbarBox = await sessionToolbar.boundingBox();
@@ -289,9 +293,22 @@ test.describe('processor detail workbench', () => {
expect(Math.abs(sendBox!.y - inputBox!.y)).toBeLessThanOrEqual(1); expect(Math.abs(sendBox!.y - inputBox!.y)).toBeLessThanOrEqual(1);
expect(toolbarBox!.y).toBeLessThan(emptyStateBox!.y); expect(toolbarBox!.y).toBeLessThan(emptyStateBox!.y);
await debugPanel const streamSwitchBox = await composer.getByRole('switch').boundingBox();
.getByRole('button', { name: 'Reset Conversation' }) const resetBox = await resetButton.boundingBox();
.click(); expect(streamSwitchBox).not.toBeNull();
expect(resetBox).not.toBeNull();
expect(resetBox!.x).toBeGreaterThan(
streamSwitchBox!.x + streamSwitchBox!.width,
);
expect(
Math.abs(
resetBox!.y +
resetBox!.height / 2 -
(streamSwitchBox!.y + streamSwitchBox!.height / 2),
),
).toBeLessThanOrEqual(1);
await resetButton.click();
await expect( await expect(
page.getByText('Conversation reset successfully'), page.getByText('Conversation reset successfully'),
).toBeVisible(); ).toBeVisible();