收口智能创作与大鱼动作按钮

将智能创作首页 prompt suggestion 按钮迁移到共享动作按钮组件
将大鱼吃小鱼结果页 hero 动作迁移到共享按钮组件
补充轻量列表行暂不单独抽象的团队决策与收口文档
This commit is contained in:
2026-06-10 16:05:05 +08:00
parent eb73ffb34d
commit f336352d37
6 changed files with 54 additions and 19 deletions

View File

@@ -336,6 +336,27 @@ describe('BigFishResultView', () => {
}
});
test('reuses shared hero action chrome for top-level result actions', () => {
render(
<BigFishResultView
session={createSession()}
onBack={() => {}}
onExecuteAction={() => {}}
onStartTestRun={() => {}}
/>,
);
expect(screen.getByRole('button', { name: '返回' }).className).toContain(
'rounded-full',
);
expect(screen.getByRole('button', { name: '测试' }).className).toContain(
'platform-action-button--editor-dark',
);
expect(screen.getByRole('button', { name: '发布' }).className).toContain(
'platform-action-button--editor-dark',
);
});
test('shows publish failures in a dismissible modal', () => {
const onDismissError = vi.fn();

View File

@@ -20,6 +20,7 @@ import { PlatformActionButton } from '../common/PlatformActionButton';
import { PlatformEmptyState } from '../common/PlatformEmptyState';
import { PlatformFieldLabel } from '../common/PlatformFieldLabel';
import { PlatformIconBadge } from '../common/PlatformIconBadge';
import { PlatformIconButton } from '../common/PlatformIconButton';
import { PlatformMediaFrame } from '../common/PlatformMediaFrame';
import { PlatformPillBadge } from '../common/PlatformPillBadge';
import { PlatformStatusMessage } from '../common/PlatformStatusMessage';
@@ -397,34 +398,39 @@ export function BigFishResultView({
<div className="platform-remap-surface mx-auto flex h-full min-h-0 w-full max-w-6xl flex-col gap-3 overflow-hidden px-1 sm:px-0">
<div className="platform-result-hero relative overflow-hidden rounded-[1.8rem] border border-cyan-100/16 bg-[radial-gradient(circle_at_top_left,rgba(45,212,191,0.2),transparent_32%),linear-gradient(135deg,rgba(8,47,73,0.98),rgba(15,23,42,0.98))] px-4 py-4 text-white sm:px-5">
<div className="flex items-start justify-between gap-3">
<button
type="button"
<PlatformIconButton
onClick={onBack}
disabled={isBusy}
className="inline-flex h-10 w-10 items-center justify-center rounded-full border border-white/16 bg-white/10 text-white/84 disabled:opacity-45"
>
<ArrowLeft className="h-4 w-4" />
</button>
label="返回"
title="返回"
variant="darkMini"
className="h-10 w-10 !border-white/16 !bg-white/10 !text-white/84 backdrop-blur hover:!bg-white/16 hover:!text-white"
icon={<ArrowLeft className="h-4 w-4" />}
/>
<div className="flex gap-2">
<button
type="button"
<PlatformActionButton
disabled={isBusy}
onClick={() => {
onStartTestRun();
}}
className="inline-flex items-center gap-2 rounded-full bg-white/12 px-4 py-2 text-sm font-bold text-white disabled:opacity-45"
surface="editorDark"
tone="secondary"
shape="pill"
className="!border-white/16 !bg-white/12 !text-white hover:!bg-white/18"
>
<Play className="h-4 w-4" />
</button>
<button
type="button"
</PlatformActionButton>
<PlatformActionButton
disabled={!canClickPublish}
onClick={() => {
setIsPublishSubmitting(true);
onExecuteAction({ action: 'big_fish_publish_game' });
}}
className="inline-flex items-center gap-2 rounded-full bg-cyan-200 px-4 py-2 text-sm font-bold text-slate-950 disabled:opacity-45"
surface="editorDark"
tone="primary"
shape="pill"
className="!border-cyan-200/70 !bg-cyan-200 !text-slate-950 hover:!bg-cyan-100"
>
{isPublishSubmitting && isBusy && !isPublished ? (
<Loader2 className="h-4 w-4 animate-spin" />
@@ -436,7 +442,7 @@ export function BigFishResultView({
: isPublishSubmitting && isBusy
? '发布中'
: '发布'}
</button>
</PlatformActionButton>
</div>
</div>
<div className="mt-6">

View File

@@ -56,9 +56,12 @@ test('CreativeAgentHome reuses shared button chrome for drawer and reward action
const rewardButton = screen.getByRole('button', {
name: '搓闪应用 分1亿激励',
});
const promptButton = screen.getByRole('button', { name: '你是谁' });
expect(menuButton.className).toContain('platform-icon-button');
expect(rewardButton.className).toContain('platform-button');
expect(promptButton.className).toContain('platform-button');
expect(promptButton.className).toContain('creative-agent-home__prompt');
await user.click(menuButton);

View File

@@ -143,8 +143,9 @@ function CreativeAgentPromptButton({
const Icon = item.icon;
return (
<button
type="button"
<PlatformActionButton
tone="secondary"
shape="pill"
disabled={disabled}
onClick={onClick}
className={`creative-agent-home__prompt creative-agent-home__prompt--${item.tone}`}
@@ -154,7 +155,7 @@ function CreativeAgentPromptButton({
{item.badge ? (
<span className="creative-agent-home__prompt-badge">{item.badge}</span>
) : null}
</button>
</PlatformActionButton>
);
}