收口运行态状态提示组件
新增 PlatformRuntimeStatusToast 统一运行态短错误、成功和反馈 toast 迁移跳一跳、拼图、敲木鱼、方洞和宝贝爱画运行态状态 chip 补充公共组件与运行态回归测试,并更新 PlatformUiKit 文档和 Hermes 决策记录
This commit is contained in:
@@ -117,7 +117,11 @@ test('finish then save stores original drawing in local demo service', () => {
|
||||
magicImageSrc: null,
|
||||
}),
|
||||
);
|
||||
expect(screen.getByText('已保存')).toBeTruthy();
|
||||
const savedToast = screen.getByText('已保存');
|
||||
expect(savedToast.className).toContain('platform-runtime-status-toast');
|
||||
expect(savedToast.className).toContain(
|
||||
'baby-love-drawing-runtime__status--saved',
|
||||
);
|
||||
});
|
||||
|
||||
test('back button calls onBack callback', () => {
|
||||
|
||||
@@ -31,6 +31,7 @@ import {
|
||||
} from '../../services/edutainment-baby-drawing';
|
||||
import type { MocapHandInput } from '../../services/useMocapInput';
|
||||
import { useMocapInput } from '../../services/useMocapInput';
|
||||
import { PlatformRuntimeStatusToast } from '../common/PlatformRuntimeStatusToast';
|
||||
import {
|
||||
appendPointToStroke,
|
||||
BABY_LOVE_DRAWING_BRUSH_SIZE,
|
||||
@@ -884,14 +885,23 @@ export function BabyLoveDrawingRuntimeShell({
|
||||
</div>
|
||||
|
||||
{error ? (
|
||||
<div className="baby-love-drawing-runtime__error">{error}</div>
|
||||
<PlatformRuntimeStatusToast
|
||||
tone="error"
|
||||
className="baby-love-drawing-runtime__status baby-love-drawing-runtime__status--top"
|
||||
>
|
||||
{error}
|
||||
</PlatformRuntimeStatusToast>
|
||||
) : null}
|
||||
|
||||
{savedRecord ? (
|
||||
<div className="baby-love-drawing-runtime__saved" role="status">
|
||||
<PlatformRuntimeStatusToast
|
||||
tone="success"
|
||||
role="status"
|
||||
className="baby-love-drawing-runtime__status baby-love-drawing-runtime__status--saved"
|
||||
>
|
||||
<ImagePlus className="h-5 w-5" />
|
||||
已保存
|
||||
</div>
|
||||
</PlatformRuntimeStatusToast>
|
||||
) : null}
|
||||
|
||||
{leftHandPoint ? (
|
||||
|
||||
Reference in New Issue
Block a user