继续沉淀结果页返回按钮
新增共享 PlatformBackActionButton 承接结果页轻量返回入口 将拼图方洞拼消消视觉小说等结果页返回按钮收口到共享组件 将拼消消跳一跳敲木鱼宝贝识物结果页返回按钮收口到共享组件 补充对应测试并更新 PlatformUiKit 收口计划与共享决策记录
This commit is contained in:
@@ -100,6 +100,29 @@ test('renders missing draft notice with shared PlatformEmptyState chrome', () =>
|
||||
expect(noticePanel?.className).toContain('text-[var(--platform-text-soft)]');
|
||||
});
|
||||
|
||||
test('renders shared compact back action button in result header', () => {
|
||||
const onBack = vi.fn();
|
||||
|
||||
render(
|
||||
<PuzzleResultView
|
||||
session={createSession()}
|
||||
onBack={onBack}
|
||||
onExecuteAction={() => {}}
|
||||
/>,
|
||||
);
|
||||
|
||||
const backButton = screen.getByRole('button', { name: '返回' });
|
||||
|
||||
expect(backButton.className).toContain('platform-button--ghost');
|
||||
expect(backButton.className).toContain('text-[11px]');
|
||||
expect(backButton.className).toContain('gap-1.5');
|
||||
expect(backButton.querySelector('svg')?.className.baseVal).toContain('h-3.5');
|
||||
|
||||
fireEvent.click(backButton);
|
||||
|
||||
expect(onBack).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
function createSession(
|
||||
overrides: Partial<PuzzleAgentSessionSnapshot> = {},
|
||||
): PuzzleAgentSessionSnapshot {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {
|
||||
ArrowLeft,
|
||||
CheckCircle2,
|
||||
Loader2,
|
||||
MessageSquareText,
|
||||
@@ -23,6 +22,7 @@ import { readPuzzleReferenceImageAsDataUrl } from '../../services/puzzleReferenc
|
||||
import { useAuthUi } from '../auth/AuthUiContext';
|
||||
import { CreativeImageInputPanel } from '../common/CreativeImageInputPanel';
|
||||
import { PlatformActionButton } from '../common/PlatformActionButton';
|
||||
import { PlatformBackActionButton } from '../common/PlatformBackActionButton';
|
||||
import { PlatformEmptyState } from '../common/PlatformEmptyState';
|
||||
import { PlatformFieldLabel } from '../common/PlatformFieldLabel';
|
||||
import { PlatformIconBadge } from '../common/PlatformIconBadge';
|
||||
@@ -425,18 +425,11 @@ function PuzzleResultHeader({
|
||||
|
||||
return (
|
||||
<div className="mb-4 flex items-center justify-between gap-3">
|
||||
<PlatformActionButton
|
||||
<PlatformBackActionButton
|
||||
onClick={onBack}
|
||||
disabled={isBusy}
|
||||
tone="ghost"
|
||||
size="xs"
|
||||
className="min-h-0 self-start py-1.5 text-[11px]"
|
||||
>
|
||||
<span className="inline-flex items-center gap-1.5">
|
||||
<ArrowLeft className="h-3.5 w-3.5" />
|
||||
返回
|
||||
</span>
|
||||
</PlatformActionButton>
|
||||
variant="compact"
|
||||
/>
|
||||
{autoSaveBadge}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user