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" />
{t('pipelines.debugDialog.groupChat')}
</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 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" />
</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 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 messageInput = composer.locator('textarea');
const sendButton = composer.getByRole('button', { name: 'Send' });
const resetButton = composer.getByRole('button', {
name: 'Reset Conversation',
});
await expect(messageInput).toBeVisible();
await expect(messageInput).toHaveAttribute('rows', '1');
await expect(resetButton).toBeVisible();
const inputBox = await messageInput.boundingBox();
const sendBox = await sendButton.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(toolbarBox!.y).toBeLessThan(emptyStateBox!.y);
await debugPanel
.getByRole('button', { name: 'Reset Conversation' })
.click();
const streamSwitchBox = await composer.getByRole('switch').boundingBox();
const resetBox = await resetButton.boundingBox();
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(
page.getByText('Conversation reset successfully'),
).toBeVisible();