Place teacher prompt buttons above the composer

This commit is contained in:
鲨鱼辣椒 committed 2026-09-29 20:06:31 +08:00
1 parent bb96941461
commit efd1894269
6 files changed
+96 -24

No files matched your search

+12 -3
View File
@@ -56,6 +56,15 @@ for (const width of [319, 508]) {
await expect(shortcuts.first()).toHaveText('看看进展');
await expect(shortcuts.nth(1)).toHaveText('解释代码');
await expect(shortcuts.nth(1)).toBeEnabled();
const row = panel.getByRole('group', { name: '快捷提问' });
const composer = panel.locator('.consultation-composer');
await expect(composer.locator('.consultation-hint')).toHaveCount(0);
await expect(shortcuts.first()).toHaveCSS('font-size', await panel.getByTestId('teacher-reply').first().evaluate(el => getComputedStyle(el).fontSize));
await expect(shortcuts.first()).toHaveCSS('font-weight', '400');
await expect(shortcuts.first()).toHaveCSS('box-shadow', 'none');
expect((await row.boundingBox())!.y + (await row.boundingBox())!.height).toBeLessThan((await composer.boundingBox())!.y);
await shortcuts.first().focus();
await expect(shortcuts.first()).toHaveCSS('outline-style', 'solid');
const form = (await panel.locator('form').boundingBox())!;
expect(form.y + form.height).toBeLessThanOrEqual(800);
expect(await panel.evaluate(el => el.scrollWidth <= el.clientWidth)).toBe(true);
@@ -120,12 +129,12 @@ for (const width of [319, 508]) {
await expect(hint).toBeEnabled();
await expect(hint).toHaveText('帮我整体看🧠');
expect(await hint.evaluate(el => el.scrollWidth <= el.clientWidth && el.scrollHeight <= el.clientHeight)).toBe(true);
await expect(hint).toHaveCSS('background-color', 'rgb(255, 242, 201)');
await expect(hint).toHaveCSS('background-color', 'rgb(250, 245, 232)');
const initialSend = (await send.boundingBox())!;
const hintBounds = (await hint.boundingBox())!;
expect(hintBounds.x).toBeLessThan(initialSend.x);
expect(hintBounds.height).toBeGreaterThanOrEqual(44);
expect(hintBounds.x + hintBounds.width).toBeLessThanOrEqual(initialSend.x);
expect(hintBounds.height).toBeGreaterThanOrEqual(36);
expect(hintBounds.y + hintBounds.height).toBeLessThan((await page.locator('.consultation-composer').boundingBox())!.y);
await page.getByTestId('teacher-chat-panel').screenshot({ path: test.info().outputPath(`composer-hint-${width}.png`) });
expect(await sent()).toEqual([]);
await input.fill('我想先自己说说');