继续沉淀结果页返回按钮

新增共享 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

@@ -148,6 +148,31 @@ function createReadyGeneratedItemAsset(index: number) {
}
describe('Match3DResultView', () => {
test('结果页头部返回按钮复用共享 compact back action button', () => {
const onBack = vi.fn();
render(
<Match3DResultView
profile={createProfile()}
onBack={onBack}
onStartTestRun={() => {}}
/>,
);
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);
});
test('标准白底面板使用 PlatformSubpanel lg 外壳', async () => {
match3dSpritesheetParser.loadMatch3DSpritesheetAssetRegions.mockResolvedValue(
Array.from({ length: 10 }, (_, index) => ({

View File

@@ -53,6 +53,7 @@ import {
import { readPuzzleReferenceImageAsDataUrl } from '../../services/puzzleReferenceImage';
import { useAuthUi } from '../auth/AuthUiContext';
import { PlatformActionButton } from '../common/PlatformActionButton';
import { PlatformBackActionButton } from '../common/PlatformBackActionButton';
import { PlatformAssetPickerGrid } from '../common/PlatformAssetPickerCard';
import { PlatformFieldLabel } from '../common/PlatformFieldLabel';
import { PlatformIconButton } from '../common/PlatformIconButton';
@@ -1354,18 +1355,11 @@ function Match3DResultHeader({
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"
/>
{badge}
</div>
);