收口公开编号搜索结果弹层
平台入口公开编号搜索结果弹层改用 UnifiedModal 承接公共模态外壳 未命中提示与命中用户卡分别复用 PlatformStatusMessage 和 PlatformSubpanel 补充公开编号搜索结果弹层交互测试与收口文档记录
This commit is contained in:
@@ -237,6 +237,7 @@
|
||||
- 2026-06-10 验证补充:作品详情底部启动 / 改造动作收口补跑 `npm run test -- src/components/platform-entry/PlatformWorkDetailView.test.tsx src/components/common/PlatformActionButton.test.tsx`。
|
||||
- 2026-06-10 验证补充:作品详情点赞按钮收口补跑 `npm run test -- src/components/platform-entry/PlatformWorkDetailView.test.tsx src/components/common/PlatformActionButton.test.tsx src/components/common/platformActionButtonModel.test.ts`。
|
||||
- 2026-06-10 验证补充:creative-agent 模板确认弹层“关卡数”行内标题收口到 `PlatformFieldLabel variant="inlineForm"` 后,补跑 `npm run test -- src/components/creative-agent/CreativeAgentTemplateConfirmPanel.test.tsx src/components/common/PlatformFieldLabel.test.tsx`。
|
||||
- 2026-06-10 验证补充:平台入口公开编号搜索结果弹层收口到 `UnifiedModal`、`PlatformStatusMessage` 和 `PlatformSubpanel` 后,补跑 `npm run test -- src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx -t "public code search"`。
|
||||
- 2026-06-10 验证补充:平台作品详情主题标签和作品号复制 chip 收口后,补跑 `npm run test -- src/components/platform-entry/PlatformWorkDetailView.test.tsx src/components/common/PlatformPillBadge.test.tsx src/components/common/CopyCodeButton.test.tsx`。
|
||||
- 2026-06-10 验证补充:平台作品详情分享复制反馈按状态映射到 `PlatformStatusMessage surface="platform"` 后,补跑 `npm run test -- src/components/platform-entry/PlatformWorkDetailView.test.tsx src/components/common/PlatformStatusMessage.test.tsx`。
|
||||
- 2026-06-10 验证补充:大鱼吃小鱼结果页缺草稿空态收口补跑 `npm run test -- src/components/big-fish-result/BigFishResultView.test.tsx src/components/common/PlatformEmptyState.test.tsx`。
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -364,11 +364,13 @@ import {
|
||||
import type { CustomWorldProfile } from '../../types';
|
||||
import { useAuthUi } from '../auth/AuthUiContext';
|
||||
import { PlatformActionButton } from '../common/PlatformActionButton';
|
||||
import { PlatformModalCloseButton } from '../common/PlatformModalCloseButton';
|
||||
import { PlatformFieldLabel } from '../common/PlatformFieldLabel';
|
||||
import { PlatformStatusMessage } from '../common/PlatformStatusMessage';
|
||||
import { PlatformSubpanel } from '../common/PlatformSubpanel';
|
||||
import { PublishShareModal } from '../common/PublishShareModal';
|
||||
import type { PublishShareModalPayload } from '../common/publishShareModalModel';
|
||||
import { UnifiedConfirmDialog } from '../common/UnifiedConfirmDialog';
|
||||
import { UnifiedModal } from '../common/UnifiedModal';
|
||||
import { resolveCreativeAgentTargetSelectionStage } from '../creative-agent/creativeAgentViewModel';
|
||||
import {
|
||||
buildCreationWorkShelfItems,
|
||||
@@ -13942,6 +13944,11 @@ export function PlatformEntryFlowShellImpl({
|
||||
],
|
||||
);
|
||||
|
||||
const closePublicSearchResult = useCallback(() => {
|
||||
setSearchedPublicUser(null);
|
||||
setPublicSearchError(null);
|
||||
}, []);
|
||||
|
||||
const openProfilePlayedWorks = useCallback(() => {
|
||||
setIsProfilePlayStatsOpen(true);
|
||||
setIsProfilePlayStatsLoading(true);
|
||||
@@ -17054,49 +17061,47 @@ export function PlatformEntryFlowShellImpl({
|
||||
{pendingDeleteCreationWork?.detail}
|
||||
</UnifiedConfirmDialog>
|
||||
<AnimatePresence>
|
||||
{(searchedPublicUser || publicSearchError) && (
|
||||
{searchedPublicUser || publicSearchError ? (
|
||||
<motion.div
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
exit={{ opacity: 0 }}
|
||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/45 p-4"
|
||||
>
|
||||
<div className="platform-surface w-full max-w-md rounded-[1.6rem] p-5">
|
||||
<div className="flex items-start justify-between gap-4">
|
||||
<div>
|
||||
<div className="text-sm font-semibold text-[var(--platform-text-soft)]">
|
||||
公开编号搜索
|
||||
</div>
|
||||
<div className="mt-1 text-xl font-black text-[var(--platform-text-strong)]">
|
||||
{publicSearchError ? '未找到结果' : '命中用户'}
|
||||
</div>
|
||||
</div>
|
||||
<PlatformModalCloseButton
|
||||
onClick={() => {
|
||||
setSearchedPublicUser(null);
|
||||
setPublicSearchError(null);
|
||||
}}
|
||||
label="关闭搜索结果"
|
||||
variant="platformIcon"
|
||||
/>
|
||||
</div>
|
||||
<UnifiedModal
|
||||
open
|
||||
title={publicSearchError ? '未找到结果' : '命中用户'}
|
||||
description="公开编号搜索"
|
||||
onClose={closePublicSearchResult}
|
||||
closeOnBackdrop={false}
|
||||
closeLabel="关闭搜索结果"
|
||||
portal={false}
|
||||
size="sm"
|
||||
overlayClassName={`platform-theme ${platformThemeClass} !items-center bg-black/45 !p-4`}
|
||||
panelClassName="platform-remap-surface rounded-[1.6rem]"
|
||||
>
|
||||
{publicSearchError ? (
|
||||
<div className="mt-4 text-sm leading-6 text-[var(--platform-text-soft)]">
|
||||
<PlatformStatusMessage tone="neutral" surface="platform" size="md">
|
||||
{publicSearchError}
|
||||
</div>
|
||||
</PlatformStatusMessage>
|
||||
) : searchedPublicUser ? (
|
||||
<div className="mt-4 rounded-[1.2rem] border border-[var(--platform-line-soft)] p-4">
|
||||
<div className="text-lg font-bold text-[var(--platform-text-strong)]">
|
||||
{searchedPublicUser.displayName}
|
||||
<PlatformSubpanel
|
||||
as="section"
|
||||
surface="flat"
|
||||
radius="sm"
|
||||
padding="md"
|
||||
title={searchedPublicUser.displayName}
|
||||
titleVariant="strong"
|
||||
bodyClassName="mt-3"
|
||||
>
|
||||
<PlatformFieldLabel>陶泥号</PlatformFieldLabel>
|
||||
<div className="mt-1 text-sm font-semibold text-[var(--platform-text-base)]">
|
||||
{searchedPublicUser.publicUserCode}
|
||||
</div>
|
||||
<div className="mt-2 text-sm text-[var(--platform-text-soft)]">
|
||||
陶泥号 {searchedPublicUser.publicUserCode}
|
||||
</div>
|
||||
</div>
|
||||
</PlatformSubpanel>
|
||||
) : null}
|
||||
</div>
|
||||
</UnifiedModal>
|
||||
</motion.div>
|
||||
)}
|
||||
) : null}
|
||||
</AnimatePresence>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -7334,11 +7334,53 @@ test('public code search blocks edutainment work when entry switch is disabled',
|
||||
await user.type(searchInput, 'PZ-TMENT1');
|
||||
await user.click(screen.getByRole('button', { name: '搜索' }));
|
||||
|
||||
expect(await screen.findByText('未找到结果')).toBeTruthy();
|
||||
const dialog = await screen.findByRole('dialog', { name: '未找到结果' });
|
||||
expect(within(dialog).getByText('公开编号搜索')).toBeTruthy();
|
||||
expect(within(dialog).getByText('未找到拼图作品。')).toBeTruthy();
|
||||
await user.click(
|
||||
within(dialog).getByRole('button', { name: '关闭搜索结果' }),
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.queryByRole('dialog', { name: '未找到结果' })).toBeNull();
|
||||
});
|
||||
expect(screen.queryByText('儿童动作热身 Demo')).toBeNull();
|
||||
expect(getPuzzleGalleryDetail).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('public code search shows public user summary in shared search result modal and clears it on close', async () => {
|
||||
const user = userEvent.setup();
|
||||
vi.mocked(authServiceMocks.getPublicAuthUserByCode).mockResolvedValue({
|
||||
id: 'public-user-yjsh',
|
||||
publicUserCode: 'SY-00000001',
|
||||
username: 'author_user',
|
||||
displayName: '公开作者',
|
||||
avatarUrl: null,
|
||||
});
|
||||
|
||||
render(<TestWrapper withAuth />);
|
||||
await openDiscoverHub(user);
|
||||
|
||||
const searchInput =
|
||||
await screen.findByPlaceholderText('搜索作品号、名称、作者、描述');
|
||||
await user.type(searchInput, '月井守望');
|
||||
await user.click(screen.getByRole('button', { name: '搜索' }));
|
||||
|
||||
const dialog = await screen.findByRole('dialog', { name: '命中用户' });
|
||||
expect(within(dialog).getByText('公开编号搜索')).toBeTruthy();
|
||||
expect(within(dialog).getByText('公开作者')).toBeTruthy();
|
||||
expect(within(dialog).getByText('陶泥号')).toBeTruthy();
|
||||
expect(within(dialog).getByText('SY-00000001')).toBeTruthy();
|
||||
|
||||
await user.click(
|
||||
within(dialog).getByRole('button', { name: '关闭搜索结果' }),
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.queryByRole('dialog', { name: '命中用户' })).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
test('creation hub clears all private work shelves immediately after logout state', async () => {
|
||||
const user = userEvent.setup();
|
||||
const loggedInAuth = createAuthValue();
|
||||
|
||||
Reference in New Issue
Block a user