继续沉淀结果页返回按钮

新增共享 PlatformBackActionButton 承接结果页轻量返回入口
将拼图方洞拼消消视觉小说等结果页返回按钮收口到共享组件
将拼消消跳一跳敲木鱼宝贝识物结果页返回按钮收口到共享组件
补充对应测试并更新 PlatformUiKit 收口计划与共享决策记录
This commit is contained in:
2026-06-11 04:52:48 +08:00
parent 1b89611c9a
commit 0d9259b762
20 changed files with 313 additions and 75 deletions

View File

@@ -235,3 +235,29 @@ test('baby object result blocks placeholder assets and exposes regeneration', as
expect(onPublish).not.toHaveBeenCalled();
expect(onStartTestRun).not.toHaveBeenCalled();
});
test('baby object result header back button reuses shared compact back action button', async () => {
const user = userEvent.setup();
const onBack = vi.fn();
render(
<BabyObjectMatchResultView
draft={createGeneratedDraft()}
isBusy
onBack={onBack}
/>,
);
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.className).toContain('px-3');
expect(backButton.querySelector('svg')?.className.baseVal).toContain('h-3.5');
expect((backButton as HTMLButtonElement).disabled).toBe(true);
await user.click(backButton);
expect(onBack).not.toHaveBeenCalled();
});

View File

@@ -1,5 +1,4 @@
import {
ArrowLeft,
CheckCircle2,
Loader2,
Play,
@@ -16,6 +15,7 @@ import {
normalizeBabyObjectMatchTags,
} from '../../../packages/shared/src/contracts/edutainmentBabyObject';
import { PlatformActionButton } from '../common/PlatformActionButton';
import { PlatformBackActionButton } from '../common/PlatformBackActionButton';
import { PlatformMediaFrame } from '../common/PlatformMediaFrame';
import { PlatformOverlayBadge } from '../common/PlatformOverlayBadge';
import { PlatformPillBadge } from '../common/PlatformPillBadge';
@@ -87,16 +87,11 @@ export function BabyObjectMatchResultView({
<div className="platform-page-stage platform-remap-surface flex h-full min-h-0 flex-col overflow-hidden px-3 pb-3 pt-3 sm:px-4 sm:pt-4 xl:px-5 xl:pb-4 xl:pt-4">
<div className="mx-auto flex h-full min-h-0 w-full max-w-5xl flex-col">
<div className="mb-3 flex shrink-0 items-center justify-between gap-3">
<PlatformActionButton
<PlatformBackActionButton
onClick={onBack}
disabled={isBusy}
tone="ghost"
size="xs"
className="min-h-0 gap-2 px-3 py-1.5 text-[11px]"
>
<ArrowLeft className="h-3.5 w-3.5" />
</PlatformActionButton>
className="px-3"
/>
<div className="flex min-w-0 items-center gap-2">
<PlatformPillBadge
tone={isPublished ? 'success' : 'neutral'}